skippylab.instruments package

Submodules

skippylab.instruments.function_generators module

Function generators

class skippylab.instruments.function_generators.Agilent3322OAFunctionGenerator(ip='10.25.123.111', gpib_address=15, loglevel=20)[source]

Bases: object

skippylab.instruments.gpibcontrollers module

Wrapper around the PrologixGPIBEthernet adapter, to transparently manage instruments which are connected via GPIB and the respective controller

skippylab.instruments.gpibcontrollers.prologix_gpib_ethernet_provider(ip, gpib_addres)[source]

Provide a vxi11 compatible instrument which is accesible transparently through its ip.

Parameters:
  • ip (str) – ip address of the controller
  • gpib_address (str) – gpib adress of the instrument
Returns:

vxi11.instrument

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
acquire_waveform()[source]
ping()[source]

Check if oscilloscope is connected

reopen_socket()[source]

Close and reopen the socket after a timeout

Returns:None
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

acquire_waveform()[source]

Get the voltage values for a single waveform

Returns:np.ndarray
do_single_acquisition()[source]
run()[source]

Start continuous acquisitions

Returns:

samplingrate

Get the current sampling rate

Returns:float (GSamples/sec)
select_channel(channel)[source]

Select the channel for the readout.

Parameters:channel (int) – Channel number (1-4)
Returns:None
stop()[source]
triggerrate

Get the triggerrate of the scope

Parameters:interval (float) – measurement time in seconds to
Returns:float
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:
 
  • header (dict) – if header is None, a new header will be acquired
  • 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:

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]*)')
static convert_waveform(header, waveform)[source]
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:
  • response (str) – Hopefully the response to some CURVE command or similar
  • header (dict) – A parsed waveform header
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:
 
  • return_last_index (bool) – if True, also the last index of the header in the string will be returned
  • absolute_timing (bool) – try to infer the absolute timeing (whatever that means) # FIXME!
Returns:

dict/tuple

fill_buffer()[source]

Returns:

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:

list

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:
  • start (int) – start bin
  • stop (int) – stop bin
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:
  • leading (float) – leading ns before the most prominent feature
  • trailing (float) – trailing ns after the most prominent feature
Keyword Args
n_waveforms (int): average over n_waveforms to identify the most prominent feature
Returns:None
set_waveform_encoding(enc)[source]

Define the waveform encoding

Parameters:enc

Returns:

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_continuous()[source]
trigger_frequency_enabled
trigger_single()[source]
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

acquire_waveform()[source]
samplingrate()[source]

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
class skippylab.instruments.oscilloscopes.Waveform(header, raw_waveform)[source]

Bases: object

A non-oscilloscope dependent representation of a measured waveform

load()[source]
save()[source]
time_bins()[source]
volts()[source]
skippylab.instruments.oscilloscopes.get_header(self)[source]
skippylab.instruments.oscilloscopes.set_header(self, header)[source]
skippylab.instruments.oscilloscopes.setget(command)[source]

Shortcut to construct property object to wrap getters and setters for a number of settings

Parameters:
  • command (str) – The command being used to get/set. Get will be a query
  • value (str) – The value to set
Returns:

property object

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
off()[source]

Cut the power on all channels

Returns:None
on()[source]

Enable power on all channels

Returns:None
output
ping()[source]

Check the connection

Returns:str
select_channel(channel)[source]

Select either the +6, +25 or -25V channel

Parameters:channel (str or int) –
Returns:None
set_voltage(channel, voltage)[source]

Set the supplied voltage of a channel to the desired value

Parameters:
Returns:

None

Module contents