ElectrometerCommandFactory#

class lsst.ts.electrometer.ElectrometerCommandFactory#

Bases: object

Format SCPI commands common to supported electrometers.

Methods Summary

acquire_data()

Build a command that starts acquiring data.

activate_filter(mode, filter_type, active)

Build a command that enables or disables a digital filter.

always_read()

Build a command that reads the full buffer continuously.

auto_integration_time_on(mode)

Return a command to enable automatic integration time.

auto_nplc_on(mode)

Turn on auto NPLC.

clear()

Return a command to clear device status.

clear_buffer()

Build a command that clears the buffer.

clear_device()

Build a command that clears the device.

disable_all()

Return combo of commands for disable all command.

discharge_capacitor()

Discharges the capacitor.

enable_all_instrument_errors()

Return enable all instrument errors.

enable_display(enable)

Return enable display command string.

enable_sync(enable)

Return enable sync.

enable_temperature_reading(enable)

Return enable temperature reading.

enable_zero_check(enable)

Return enable zero check.

enable_zero_correction(enable)

Return enable zero correction.

format_trac([timestamp, temperature, ...])

Build a command that configures the trace buffer format.

get_buffer_quantity()

Build a command that queries the number of buffered samples.

get_filter_status(mode, filter_type)

Build a command that queries a digital filter status.

get_hardware_info()

Build a command that queries the hardware identification string.

get_integration_time(mode)

Return get integration time command string.

get_last_error()

Build a command that queries the last error.

get_measure(read_option)

Return get measure.

get_mode()

Return get mode.

get_range(mode)

Return get range command string.

get_timer(mode)

Return the get nplc command.

get_trace_format()

Build a command that queries the trace format.

get_voltage_level()

Return a command to query voltage source level.

get_voltage_limit()

Return a command to query voltage source limit.

get_voltage_range()

Return a command to query voltage source range.

get_voltage_source_status()

Return a command to query voltage source status.

init_buffer()

Return start storing readings into the buffer.

integration_time(mode[, time])

Return integration time.

next_read()

Build a command that reads the next buffer sample.

output_trigger_line(output_trigger_input)

Sets output trigger line

perform_zero_calibration(mode, auto, ...)

Return combo of commands for perform zero calibration command.

prepare_buffer()

Return combo of commands for prepare buffer command.

read_buffer()

Return read buffer.

reset_device()

Return reset device.

select_device_timer([timer])

Return select device timer.

select_source([source])

Return a command to select the trigger source.

set_autodischarge(autodischarge_state)

Build a command that sets the autodischarge state.

set_buffer_size([buffer_size])

Return set buffer size.

set_infinite_triggers()

Return take infinite measurements

set_mode(mode)

Return set mode.

set_range(auto, range_value, mode)

Return set range.

set_resolution(mode, digit)

Return a command to set measurement resolution.

set_timer(mode, value)

Return set time command string.

set_voltage_level(amplitude)

Return a command to set voltage source level.

set_voltage_limit(limit)

Return a command to set voltage source limit.

set_voltage_range(range)

Return a command to set voltage source range.

start_storing_buffer()

Return start storing buffer.

stop_storing_buffer()

Return stop storing buffer.

stop_taking_data()

Stops taking measurements

toggle_voltage_source(enable)

Return a command to enable or disable the voltage source.

Methods Documentation

acquire_data()#

Build a command that starts acquiring data.

Returns:

command – Generated command string.

Return type:

str

activate_filter(mode, filter_type, active)#

Build a command that enables or disables a digital filter.

Parameters:
  • mode (str or enums.UnitMode) – Measurement mode.

  • filter_type (int or enums.Filter) – Filter type.

  • active (bool) – Whether to enable the filter.

Returns:

command – The generated command string.

Return type:

str

always_read()#

Build a command that reads the full buffer continuously.

Returns:

command – Generated command string.

Return type:

str

auto_integration_time_on(mode)#

Return a command to enable automatic integration time.

Parameters:

mode (str or enums.UnitMode) – Measurement mode.

Returns:

command – The generated command string.

Return type:

str

auto_nplc_on(mode)#

Turn on auto NPLC.

Parameters:

mode (UnitMode) – The unit to change setting.

Returns:

command – The formatted command.

Return type:

str

clear()#

Return a command to clear device status.

clear_buffer()#

Build a command that clears the buffer.

Returns:

command – The generated command string.

Return type:

str

clear_device()#

Build a command that clears the device.

Returns:

command – The generated command string.

Return type:

str

disable_all()#

Return combo of commands for disable all command.

Returns:

command – The generated command string.

Return type:

str

discharge_capacitor()#

Discharges the capacitor.

Returns:

command – The generated command string.

Return type:

str

enable_all_instrument_errors()#

Return enable all instrument errors.

Returns:

command – The generated command string.

Return type:

str

enable_display(enable)#

Return enable display command string.

Parameters:

enable (bool) – Whether to enable the display.

Returns:

command – The generated command string.

Return type:

str

enable_sync(enable)#

Return enable sync.

Parameters:

enable (bool) – Whether to enable sync.

Returns:

command – The generated command string.

Return type:

str

enable_temperature_reading(enable)#

Return enable temperature reading.

Parameters:

enable (bool) – Whether to enable temperature reading.

Returns:

command – The generated command string.

Return type:

str

enable_zero_check(enable)#

Return enable zero check.

Parameters:

enable (bool) – Whether to enable zero check.

Returns:

command – The generated command string.

Return type:

str

enable_zero_correction(enable)#

Return enable zero correction.

Parameters:

enable (bool) – Whether to enable zero correction.

Returns:

command – The generated command string.

Return type:

str

format_trac(timestamp=True, temperature=False, voltage=False, set_mode=False, mode='VOLT', channel=False)#

Build a command that configures the trace buffer format.

Parameters:
  • channel (bool) – Whether to store channel data.

  • timestamp (bool) – Whether to store timestamp data.

  • temperature (bool) – Whether to store temperature data.

Returns:

command – The generated command string.

Return type:

str

get_buffer_quantity()#

Build a command that queries the number of buffered samples.

Returns:

command – The generated command string.

Return type:

str

get_filter_status(mode, filter_type)#

Build a command that queries a digital filter status.

Parameters:
Returns:

command – The generated command string.

Return type:

str

get_hardware_info()#

Build a command that queries the hardware identification string.

Returns:

command – The generated command string.

Return type:

str

get_integration_time(mode)#

Return get integration time command string.

Parameters:

mode (UnitMode) – The unit of the integration time to check.

Returns:

command – The generated command string.

Return type:

str

get_last_error()#

Build a command that queries the last error.

Returns:

command – The generated command string.

Return type:

str

get_measure(read_option)#

Return get measure.

Parameters:

read_option (ReadingOption) – The reading option.

Returns:

command – The generated command string.

Return type:

str

get_mode()#

Return get mode.

Returns:

command – The generated command string.

Return type:

str

get_range(mode)#

Return get range command string.

Parameters:

mode (UnitMode) – The unit of the range to check.

Returns:

command – The generated command string.

Return type:

str

get_timer(mode)#

Return the get nplc command.

Parameters:

mode (str) – The name of the mode to set the nplc for.

get_trace_format()#

Build a command that queries the trace format.

Returns:

command – The generated command string.

Return type:

str

get_voltage_level()#

Return a command to query voltage source level.

get_voltage_limit()#

Return a command to query voltage source limit.

get_voltage_range()#

Return a command to query voltage source range.

get_voltage_source_status()#

Return a command to query voltage source status.

init_buffer()#

Return start storing readings into the buffer.

Returns:

command – The generated command string.

Return type:

str

integration_time(mode, time=0.001)#

Return integration time.

Parameters:
  • mode (UnitMode) – The unit of the aperture to set.

  • time (float, optional) – The integration time of the aperture. Defaults to 0.001 seconds.

Returns:

command – The generated command string.

Return type:

str

next_read()#

Build a command that reads the next buffer sample.

Returns:

command – The generated command string.

Return type:

str

output_trigger_line(output_trigger_input)#

Sets output trigger line

Returns:

command – The generated command string.

Return type:

str

perform_zero_calibration(mode, auto, range_value, int_time)#

Return combo of commands for perform zero calibration command. Required when setting mode to Volts/Amps to cancel any internal offsets. See page 4-10 in User’s manual for sequence

Parameters:
  • mode (UnitMode) – The unit of the device

  • auto (bool) – Whether auto range is activated.

  • range_value (float) – The range of the values.

  • int_time (float) – Integration time to use for the calibration.

Returns:

command – The generated command string

Return type:

str

prepare_buffer()#

Return combo of commands for prepare buffer command.

Returns:

command – The generated command string.

Return type:

str

read_buffer()#

Return read buffer.

Returns:

command – The generated command string.

Return type:

str

reset_device()#

Return reset device.

Returns:

command – The generated command string.

Return type:

str

select_device_timer(timer=0.001)#

Return select device timer.

Parameters:

timer (float) – The internal device loop timer. Values below 0.001 can cause instability.

Returns:

command – The generated command string.

Return type:

str

select_source(source=Source.TIM)#

Return a command to select the trigger source.

Parameters:

source (enums.Source, optional) – Trigger source.

Returns:

command – The generated command string.

Return type:

str

set_autodischarge(autodischarge_state)#

Build a command that sets the autodischarge state.

Returns:

command – The generated command string.

Return type:

str

set_buffer_size(buffer_size=50000)#

Return set buffer size.

Parameters:

buffer_size (int) – The number of values to store in the buffer. Maximum is 50000.

set_infinite_triggers()#

Return take infinite measurements

Returns:

command – The generated command string.

Return type:

str

set_mode(mode)#

Return set mode.

Parameters:

mode (UnitMode) – The unit to switch to.

Returns:

command – The generated command string.

Return type:

str

set_range(auto, range_value, mode)#

Return set range.

Parameters:
  • auto (bool) – Whether auto range is activated.

  • range_value (float) – The range to set. Not used if auto is true.

  • mode (enums.UnitMode) – The unit of the range to set.

Returns:

command – The generated command string.

Return type:

str

set_resolution(mode, digit)#

Return a command to set measurement resolution.

Parameters:
  • mode (str or enums.UnitMode) – Measurement mode.

  • digit (int) – Number of resolution digits.

set_timer(mode, value)#

Return set time command string.

Parameters:
  • mode (str or enums.UnitMode) – Measurement mode.

  • value (float) – Timer value in power-line cycles.

Returns:

command – The generated command string.

Return type:

str

set_voltage_level(amplitude)#

Return a command to set voltage source level.

Parameters:

amplitude (float) – Voltage level to set.

set_voltage_limit(limit)#

Return a command to set voltage source limit.

Parameters:

limit (float) – Voltage limit to set.

set_voltage_range(range)#

Return a command to set voltage source range.

Parameters:

range (float) – Voltage range to set.

start_storing_buffer()#

Return start storing buffer.

Returns:

command – The generated command string.

Return type:

str

stop_storing_buffer()#

Return stop storing buffer.

Returns:

command – The generated command string.

Return type:

str

stop_taking_data()#

Stops taking measurements

Returns:

command – The generated command string.

Return type:

str

toggle_voltage_source(enable)#

Return a command to enable or disable the voltage source.

Parameters:

enable (bool) – Whether to enable the voltage source.