skippylab.instruments package¶
Submodules¶
skippylab.instruments.function_generators module¶
Function generators
skippylab.instruments.gpibcontrollers module¶
Wrapper around the PrologixGPIBEthernet adapter, to transparently manage instruments which are connected via GPIB and the respective controller
skippylab.instruments.oscilloscopes module¶
Communicate with oscilloscope via vxi11 protocol over LAN network
-
class
skippylab.instruments.oscilloscopes.
AbstractBaseOscilloscope
(ip='169.254.68.19', loglevel=20)[source]¶ Bases:
object
A oscilloscope with a high sampling rate in the order of several gigasamples. Defines the scope API the DAQ reiles on
-
ACQUIRE_ONE
= 'SEQ'¶
-
CONTINOUS_RUN
= 'RUNSTop'¶
-
MAXTRIALS
= 5¶
-
samplingrate
¶ Get the current sampling rate
Returns: float (GSamples/sec)
-
select_channel
(channel)[source]¶ Select a channel for the data acquisition
Parameters: channel (int) – Channel number Returns: None
-
string_encoding
= 'iso-8859-1'¶
-
-
class
skippylab.instruments.oscilloscopes.
RhodeSchwarzRTO1044
(ip)[source]¶ Bases:
skippylab.instruments.oscilloscopes.AbstractBaseOscilloscope
Made by Rhode&Schwarz, scope with sampling rate up to 20GSamples/s
-
samplingrate
¶ Get the current sampling rate
Returns: float (GSamples/sec)
-
-
class
skippylab.instruments.oscilloscopes.
TektronixDPO4104B
(ip, loglevel=20)[source]¶ Bases:
skippylab.instruments.oscilloscopes.AbstractBaseOscilloscope
Oscilloscope of type DPO4104B manufactured by Tektronix
-
acquire
¶
-
acquire_mode
¶
-
acquire_waveform
(header=None, return_digitizer_levels=False)[source]¶ Get the waveform data
Keyword Arguments: Returns: np.ndarray
-
average_waveform
(n=10)[source]¶ Acquire some waveforms and take the average
- Keyword Args.
- n (int): number of waveforms to average over
Returns: tuple(np.array). xs, ys
-
binary_formats
= {'RI': '!b'}¶
-
binary_header_pattern
= re.compile('#(?P<bin_head>[0-9]*)')¶
-
data
¶
-
data_start
¶
-
data_stop
¶
-
data_width
¶
-
static
decode_ascii_waveform
(response)[source]¶ Search the response for waveform data when in ascii format
Parameters: response (str) – Hopefully the result of a CURVE command or similar Returns: np.ndarray
-
decode_binary_waveform
(response, header)[source]¶ Decaode a waveform in binary format. To do so, the header is required to know about the exact format.
Parameters: Returns: np.ndarray
-
static
decode_header
(response, return_last_index=False, absolute_timing=False)[source]¶ Parse a response searching for waveform header data
Parameters: head (str) – hopefully the result of some WAVFrm or similar command
Keyword Arguments: Returns: dict/tuple
-
histbox
¶
-
histend
¶
-
histogram
¶ Return a histogram which might be recorded by the scope
-
histstart
¶
-
make_n_acquisitions
(n, trials=20, return_only_charge=False, single_acquisition=True, return_digitizer_levels=False)[source]¶ Acquire n waveforms
Parameters: n (int) – Number of waveforms to acquire
Keyword Arguments: - trials (int) – Set breaking condition when to abort acquisition
- return_only_charge (bool) – don’t get the wf, but only integrated charge instead
- single_acquisition (bool) – use the scopes single acquisition mode
- return_digitizer_levels (bool) – return the waveform data in digitizer levels, not volts. Saves space for storage, since int8 can be used for 1-bit representation. ..and there is no float8 for obvious reasons.
Returns: [wf_1,wf_2,…]
Return type:
-
pull
(buff_header=True, use_buffered_acq_window=True, use_channel_info=True)[source]¶ Fit in the API for the DAQ. Returns waveform data
Keyword Arguments: - buff_header (bool) – buffer the header for subsequent acquisition without changing the parameters of the acquistion (much faster)
- Default value of this should be False, however requires DAQ API change (FIXME!) –
- use_buffered_acq_window (bool) – set this flag to cache the length of the acquisition window internally so that it does not get resetted when switching channels
- use_channel_info (bool) – select the channel on each submit
Returns: dict
-
reset_acquisition_window
()[source]¶ Reset the acquisition window to the maximum possible acquisition window Returns:In
None
-
samplingrate
¶ The samplingrate in GSamples/S
Returns: float
-
select_channel
(channel)[source]¶ Select the channel for the readout
Parameters: channel (int) – Channel number (1-4) Returns: None
-
set_acquisition_window
(start, stop)[source]¶ Set the acquisition window in bin number
Parameters: Returns: None
-
set_acquisition_window_from_internal_buffer
()[source]¶ Use the internal buffer to set the data acquisition window. Might be necessary if the channel was switched in the meantime
Returns: None
-
set_feature_acquisition_window
(leading, trailing, n_waveforms=20)[source]¶ Set the acquisition window around the most prominent feature in the waveform
Parameters: - Keyword Args
- n_waveforms (int): average over n_waveforms to identify the most prominent feature
Returns: None
-
show_waveforms
(n=5)[source]¶ Demonstration function: Will use pylab show to plot some acquired waveforms
Keyword Arguments: n (int) – number of waveforms to show Returns: None
-
source
¶
-
time_binwidth
¶ Get the binwidth of the time - that is sampling rate
Returns: float
-
trigger_frequency_enabled
¶
-
triggerrate
¶ The rate the scope is triggering. The scope in principle provides this number, however we have to work around it as it does not work reliably
Keyword Arguments: interval (int) – time interval to integrate measurement over in seconds Returns: float
-
waveform_bins
¶ Get the time bin numbers for the waveform voltage data
Returns: np.ndarray
-
waveform_enc
¶
-
waveform_times
¶ Get the time for the waveform bins
Returns: np.ndarray
-
-
class
skippylab.instruments.oscilloscopes.
UnknownOscilloscope
(ip='169.254.68.19', loglevel=20)[source]¶ Bases:
skippylab.instruments.oscilloscopes.AbstractBaseOscilloscope
Use for testing and debugging
skippylab.instruments.powersupplies module¶
Connection to power supply unit
-
class
skippylab.instruments.powersupplies.
KeysightE3631APowerSupply
(ip='10.25.124.252', gpib_address=5, loglevel=20)[source]¶ Bases:
object
A low voltage power supply with two channels, +6V and +- 25V manufactured by Keysight. The power supply does not have an ethernet port, so the connection is done via GPIB and a prologix GPIB Ethernet connector
-
error_state
¶ Read out the error register of the power supply
Returns: str
-
measure_current
(channel)[source]¶ Measure current on givven channel
Parameters: channel (str) – Returns: float
-
output
¶
-