Stanford Research Systems¶
SRS345
Function Generator¶
- class instruments.srs.SRS345(filelike)[source]¶
The SRS DS345 is a 30MHz function generator.
Example usage:
>>> import instruments as ik >>> import instruments.units as u >>> srs = ik.srs.SRS345.open_gpib('/dev/ttyUSB0', 1) >>> srs.frequency = 1 * u.MHz >>> print(srs.offset) >>> srs.function = srs.Function.triangle
- class Function(value)[source]¶
Enum containing valid output function modes for the SRS 345
- arbitrary = 5¶
- noise = 4¶
- ramp = 3¶
- sinusoid = 0¶
- square = 1¶
- triangle = 2¶
- property frequency¶
Gets/sets the output frequency.
- property offset¶
Gets/sets the offset voltage for the output waveform.
SRS830
Lock-In Amplifier¶
- class instruments.srs.SRS830(filelike, outx_mode=None)[source]¶
Communicates with a Stanford Research Systems 830 Lock-In Amplifier.
Example usage:
>>> import instruments as ik >>> import instruments.units as u >>> srs = ik.srs.SRS830.open_gpibusb('/dev/ttyUSB0', 1) >>> srs.frequency = 1000 * u.hertz # Lock-In frequency >>> data = srs.take_measurement(1, 10) # 1Hz sample rate, 10 samples total
- class FreqSource(value)[source]¶
Enum for the SRS830 frequency source settings.
- external = 0¶
- internal = 1¶
- class Mode(value)[source]¶
Enum containing valid modes for the SRS 830
- aux1 = 'aux1'¶
- aux2 = 'aux2'¶
- aux3 = 'aux3'¶
- aux4 = 'aux4'¶
- ch1 = 'ch1'¶
- ch2 = 'ch2'¶
- none = 'none'¶
- r = 'r'¶
- ref = 'ref'¶
- theta = 'theta'¶
- x = 'x'¶
- xnoise = 'xnoise'¶
- y = 'y'¶
- ynoise = 'ynoise'¶
- auto_offset(mode)[source]¶
Sets a specific channel mode to auto offset. This is the same as pressing the auto offset key on the display.
It sets the offset of the mode specified to zero.
- auto_phase()[source]¶
Sets the lock-in to auto phase. This does the same thing as pushing the auto phase button.
Do not send this message again without waiting the correct amount of time for the lock-in to finish.
- data_snap(mode1, mode2)[source]¶
Takes a snapshot of the current parameters are defined by variables mode1 and mode2.
For combinations (X,Y) and (R,THETA), they are taken at the same instant. All other combinations are done sequentially, and may not represent values taken from the same timestamp.
Returns a list of floats, arranged in the order that they are given in the function input parameters.
- init(sample_rate, buffer_mode)[source]¶
Wrapper function to prepare the SRS830 for measurement. Sets both the data sampling rate and the end of buffer mode
- Parameters:
sample_rate (
Quantity
orstr
) – The desired sampling rate. Acceptable set values are \(2^n\) where \(n \in \{-4...+9\}\) in units Hertz or the stringtrigger
.buffer_mode (SRS830.BufferMode) – This sets the behaviour of the instrument when the data storage buffer is full. Setting to
one_shot
will stop acquisition, whileloop
will repeat from the start.
- read_data_buffer(channel)[source]¶
Reads the entire data buffer for a specific channel. Transfer is done in ASCII mode. Although binary would be faster, this is not currently implemented.
Returns a list of floats containing instrument’s measurements.
- Parameters:
channel (
SRS830.Mode
orstr
) – Channel data buffer to read from. Valid channels are given by {CH1|CH2}.- Return type:
tuple`[`float
, …] or if numpy is installed,numpy.array
- set_channel_display(channel, display, ratio)[source]¶
Sets the display of the two channels. Channel 1 can display X, R, X Noise, Aux In 1, Aux In 2 Channel 2 can display Y, Theta, Y Noise, Aux In 3, Aux In 4
Channel 1 can have ratio of None, Aux In 1, Aux In 2 Channel 2 can have ratio of None, Aux In 3, Aux In 4
- Parameters:
channel (
Mode
orstr
) – Channel you wish to set the display of. Valid input is one of {CH1|CH2}.display (
Mode
orstr
) – Setting the channel will be changed to. Valid input is one of {X|Y|R|THETA|XNOISE|YNOISE|AUX1|AUX2|AUX3|AUX4}ratio (
Mode
orstr
) – Desired ratio setting for this channel. Valid input is one of {NONE|AUX1|AUX2|AUX3|AUX4}
- set_offset_expand(mode, offset, expand)[source]¶
Sets the channel offset and expand parameters. Offset is a percentage, and expand is given as a multiplication factor of 1, 10, or 100.
- Parameters:
mode (
SRS830.Mode
orstr
) – The channel mode that you wish to change the offset and/or the expand of. Valid modes are X, Y, and R.offset (float) – Offset of the mode, given as a percent. offset = <-105…+105>.
expand (int) – Expansion factor for the measurement. Valid input is {1|10|100}.
- start_data_transfer()[source]¶
Wrapper function to start the actual data transfer. Sets the transfer mode to FAST2, and triggers the data transfer to start after a delay of 0.5 seconds.
- start_scan()[source]¶
After setting the data transfer on via the dataTransfer function, this is used to start the scan. The scan starts after a delay of 0.5 seconds.
- take_measurement(sample_rate, num_samples)[source]¶
Wrapper function that allows you to easily take measurements with a specified sample rate and number of desired samples.
Function will call time.sleep() for the required amount of time it will take the instrument to complete this sampling operation.
Returns a list containing two items, each of which are lists containing the channel data. The order is [[Ch1 data], [Ch2 data]].
- Parameters:
sample_rate (int) – Set the desired sample rate of the measurement. See
sample_rate
for more information.num_samples (int) – Number of samples to take.
- Return type:
tuple`[`tuple`[`float
, …],tuple`[`float
, …]] or if numpy is installed,numpy.array`[`numpy.array
,numpy.array
]
- property amplitude¶
Gets/set the amplitude of the internal reference signal.
Set value should be 0.004 <= newval <= 5.000
- property amplitude_max¶
- property amplitude_min¶
- property buffer_mode¶
Gets/sets the end of buffer mode.
This sets the behaviour of the instrument when the data storage buffer is full. Setting to
one_shot
will stop acquisition, whileloop
will repeat from the start.- Type:
- property coupling¶
Gets/sets the input coupling to either ‘ac’ or ‘dc’.
- Type:
- property data_transfer¶
Gets/sets the data transfer status.
Note that this function only makes use of 2 of the 3 data transfer modes supported by the SRS830. The supported modes are FAST0 and FAST2. The other, FAST1, is for legacy systems which this package does not support.
- Type:
- property frequency¶
Gets/sets the lock-in amplifier reference frequency.
- property frequency_source¶
- Gets/sets the frequency source used. This is either an external source,
or uses the internal reference.
- Type:
- property input_shield_ground¶
Function sets the input shield grounding to either ‘float’ or ‘ground’.
- Type:
- property phase¶
Gets/set the phase of the internal reference signal.
Set value should be -360deg <= newval < +730deg.
- property phase_max¶
- property phase_min¶
SRSCTC100
Cryogenic Temperature Controller¶
- class instruments.srs.SRSCTC100(filelike)[source]¶
Communicates with a Stanford Research Systems CTC-100 cryogenic temperature controller.
- class Channel(ctc, chan_name)[source]¶
Represents an input or output channel on an SRS CTC-100 cryogenic temperature controller.
- get_log()[source]¶
Gets all of the log data points currently saved in the instrument memory.
- Returns:
Tuple of all the log data points. First value is time, second is the measurement value.
- Return type:
If numpy is installed, tuple of 2x
Quantity
, each comprised of a numpy array (numpy.dnarray
). Else,tuple`[`tuple`[`~pint.Quantity
, …],tuple`[`~pint.Quantity
, …]]
- get_log_point(which='next', units=None)[source]¶
Get a log data point from the instrument.
- Parameters:
- Returns:
The log data point with units
- Return type:
- property average¶
Gets the average measurement for the specified channel as determined by the statistics gathering.
- Type:
- property name¶
Gets/sets the name of the channel that will be used by the instrument to identify the channel in programming and on the display.
- Type:
- property sensor_type¶
Gets the type of sensor attached to the specified channel.
- Type:
- property stats_points¶
Gets/sets the number of sample points to use for the channel statistics.
- Type:
- property std_dev¶
Gets the standard deviation for the specified channel as determined by the statistics gathering.
- Type:
- property units¶
Gets the appropriate units for the specified channel.
Units can be one of
celsius
,watt
,volt
,ohm
, ordimensionless
.- Type:
- class SensorType(value)[source]¶
Enum containing valid sensor types for the SRS CTC-100
- diode = 'Diode'¶
- rox = 'ROX'¶
- rtd = 'RTD'¶
- thermistor = 'Thermistor'¶
- channel_units()[source]¶
Returns a dictionary from channel names to channel units, using the
getOutput.units
command. Unknown units and dimensionless quantities are presented the same way by the instrument, and so both are reported usingu.dimensionless
.- Return type:
dict
with channel names as keys and units as values
- errcheck()[source]¶
Performs an error check query against the CTC100. This function does not return anything, but will raise an
IOError
if the error code received by the instrument is not zero.- Returns:
Nothing
- sendcmd(cmd)[source]¶
Sends a command without waiting for a response.
- Parameters:
cmd (str) – String containing the command to be sent.
- property channel¶
Gets a specific measurement channel on the SRS CTC100. This is accessed like one would access a
dict
. Here you must use the actual channel names to address a specific channel. This is different from most other instruments in InstrumentKit because the CRC100 channel names can change by the user.The list of current valid channel names can be accessed by the
SRSCTC100._channel_names()
function.- Type:
- property display_figures¶
Gets/sets the number of significant figures to display. Valid range is 0-6 inclusive.
- Type:
- property error_check_toggle¶
Gets/sets if errors should be checked for after every command.
- Bool:
SRSDG645
Digital Delay Generator¶
- class instruments.srs.SRSDG645(filelike)[source]¶
Communicates with a Stanford Research Systems DG645 digital delay generator, using the SCPI commands documented in the user’s guide.
Example usage:
>>> import instruments as ik >>> import instruments.units as u >>> srs = ik.srs.SRSDG645.open_gpibusb('/dev/ttyUSB0', 1) >>> srs.channel["B"].delay = (srs.channel["A"], u.Quantity(10, 'ns')) >>> srs.output["AB"].level_amplitude = u.Quantity(4.0, "V")
- class Channel(parent, chan)[source]¶
Class representing a sensor attached to the SRS DG644.
Warning
This class should NOT be manually created by the user. It is designed to be initialized by the
SRSDG644
class.- property delay¶
Gets/sets the delay of this channel. Formatted as a two-tuple of the reference and the delay time. For example,
(SRSDG644.Channels.A, u.Quantity(10, "ps"))
indicates a delay of 9 picoseconds from delay channel A.- Units:
Assume seconds if no units given.
- class Channels(value)[source]¶
Enumeration of valid delay channels for the DDG.
- A = 2¶
- B = 3¶
- C = 4¶
- D = 5¶
- E = 6¶
- F = 7¶
- G = 8¶
- H = 9¶
- T0 = 0¶
- T1 = 1¶
- class DisplayMode(value)[source]¶
Enumeration of possible modes for the physical front-panel display.
- adv_triggering_enable = 4¶
- burst_T0_config = 14¶
- burst_count = 9¶
- burst_delay = 8¶
- burst_mode = 7¶
- burst_period = 10¶
- channel_delay = 11¶
- channel_levels = 12¶
- channel_polarity = 13¶
- prescale_config = 6¶
- trigger_holdoff = 5¶
- trigger_line = 3¶
- trigger_rate = 0¶
- trigger_single_shot = 2¶
- trigger_threshold = 1¶
- class Output(parent, idx)[source]¶
An output from the DDG.
- property level_amplitude¶
Amplitude (in voltage) of the output level for this output.
- property level_offset¶
Amplitude offset (in voltage) of the output level for this output.
- property polarity¶
Polarity of this output.
- Type:
- class Outputs(value)[source]¶
Enumeration of valid outputs from the DDG.
- AB = 1¶
- CD = 2¶
- EF = 3¶
- GH = 4¶
- T0 = 0¶
- class TriggerSource(value)[source]¶
Enumeration of the different allowed trigger sources and modes.
- external_falling = 2¶
- external_rising = 1¶
- internal = 0¶
- line = 6¶
- single_shot = 5¶
- ss_external_falling = 4¶
- ss_external_rising = 3¶
- property burst_count¶
Gets/sets the burst count. When burst mode is enabled, the DG645 outputs burst count delay cycles per trigger. Valid numbers for burst count are between 1 and 2**32 - 1
- property burst_delay¶
Gets/sets the burst delay. When burst mode is enabled the DG645 delays the first burst pulse relative to the trigger by the burst delay. The burst delay may range from 0 ps to < 2000 s with a resolution of 5 ps.
- Units:
Assume seconds if no units given.
- property burst_period¶
Gets/sets the burst period. The burst period sets the time between delay cycles during a burst. The burst period may range from 100 ns to 2000 – 10 ns in 10 ns steps.
- Units:
Assume seconds if no units given.
- property channel¶
Gets a specific channel object.
The desired channel is accessed by passing an EnumValue from
SRSDG645.Channels
. For example, to access channel A:>>> import instruments as ik >>> inst = ik.srs.SRSDG645.open_gpibusb('/dev/ttyUSB0', 1) >>> inst.channel[inst.Channels.A]
See the example in
SRSDG645
for a more complete example.- Return type:
- property display¶
Gets/sets the front-panel display mode for the connected DDG. The mode is a tuple of the display mode and the channel.
- Type:
tuple
of anSRSDG645.DisplayMode
and anSRSDG645.Channels
- property enable_burst_t0_first¶
Gets/sets whether T0 output in burst mode is on first. If enabled, the T0 output is enabled for first delay cycle of the burst only. If disabled, the T0 output is enabled for all delay cycles of the burst.
- Type:
- property holdoff¶
Gets/sets the trigger holdoff time.
- property output¶
Gets the specified output port.
- Type:
- property trigger_rate¶
Gets/sets the rate of the internal trigger.
- property trigger_source¶
Gets/sets the source for the trigger.
- Type: