ElectrometerController

class lsst.ts.electrometer.ElectrometerController(csc, log=None)

Bases: object

Class that provides high level control for electrometer.

Parameters:
cscElectrometerCSC

A copy of the CSC.

logNone or logging.Logger

A logger.

Attributes:
commandercommander.Commander

The tcpip interface for writing and reading from the device.

commandsElectrometerCommandFactory

The interface for providing formatted commands for the commander.

modeUnitMode

The mode/unit of the electrometer.

rangefloat

The range of intensities that the electrometer can read.

integration_timefloat

The amount of time the electrometer reads per scan.

median_filter_activebool

Whether the median filter is active.

filter_activebool

Whether any filter is active.

avg_filter_activebool

Whether the average filter is active.

connectedbool

Whether the port is open.

last_valueint

The last value of the electrometer intensity read.

read_freqfloat

The frequency that readings are gotten from the device buffer.

configuration_delayfloat

The delay to allow the electrometer to configure.

auto_rangebool

Whether automatic range is active.

manual_start_timefloat

The start TAI time of a scan [s].

manual_end_timefloat

The end TAI time of a scan [s].

serial_lockasyncio.Lock

The lock for protecting the synchronous serial communication.

modesdict

Associate SAL Command number with electrometer UnitMode enum.

voltage_statusbool

Is voltage source enabled.

temperaturefloat

The temperature (deg_C) returned from the probe.

vsourcefloat

The voltage (V) source input.

Attributes Summary

connected

Methods Summary

check_error()

Check the error.

configure(config)

Configure the controller.

connect()

Open connection to the electrometer.

disconnect()

Close connection to the electrometer.

get_avg_filter_status()

Get the average filter status.

get_integration_time()

Get the integration time value.

get_intensity()

Get the intensity.

get_med_filter_status()

Get the median filter status.

get_mode()

Get the mode/unit.

get_range()

Get the range value.

get_voltage_level()

get_voltage_limit()

get_voltage_range()

get_voltage_source_status()

make_primary_header()

Make primary header for fits file that follows Rubin Obs.

parse_buffer(response)

Parse the buffer values.

perform_zero_calibration()

Perform zero calibration.

prepare_scan()

Prepare the keithley for scanning.

send_command(command[, has_reply, timeout])

Send a command to the device and return a reply if it has one.

set_digital_filter(activate_filter, ...)

Set the digital filter(s).

set_integration_time(int_time)

Set the integration time.

set_mode(mode)

Set the mode/unit.

set_range(set_range)

Set the range.

set_voltage_level(level)

set_voltage_limit(limit)

set_voltage_range(range)

start_scan()

Start storing values in the Keithley electrometer's buffer.

start_scan_dt(scan_duration)

Start storing values in the Keithley electrometer's buffer, for a set duration.

stop_scan()

Stop storing values in the Keithley electrometer.

toggle_voltage_source(toggle)

write_fits_file(signal, times, temperature, ...)

Write fits file of the intensity, time, and temperature values.

Attributes Documentation

connected

Methods Documentation

async check_error()

Check the error.

configure(config: SimpleNamespace) None

Configure the controller.

Parameters:
configtypes.SimpleNamespace

The parsed yaml as a dict-like object.

async connect() None

Open connection to the electrometer.

async disconnect() None

Close connection to the electrometer.

async get_avg_filter_status()

Get the average filter status.

async get_integration_time()

Get the integration time value.

async get_intensity()

Get the intensity.

async get_med_filter_status()

Get the median filter status.

async get_mode()

Get the mode/unit.

async get_range()

Get the range value.

async get_voltage_level()
async get_voltage_limit()
async get_voltage_range()
async get_voltage_source_status()
make_primary_header()

Make primary header for fits file that follows Rubin Obs. format.

parse_buffer(response)

Parse the buffer values.

Parameters:
responsestr

The response from the read buffer command.

Returns:
intensitylist

The intensity values

timelist

The time values

temperaturelist

The temperature values.

unitlist

The unit values.

voltagelist

The voltage values.

async perform_zero_calibration()

Perform zero calibration.

async prepare_scan()

Prepare the keithley for scanning.

async send_command(command: str, has_reply: bool = False, timeout: Optional[int] = None)

Send a command to the device and return a reply if it has one.

Parameters:
commandstr

The message to be sent.

has_replybool

Whether the message has a reply.

Returns:
replystr or None

If has_reply is True then returns string reply. If false, then returns None.

async set_digital_filter(activate_filter: bool, activate_avg_filter: bool, activate_med_filter: bool)

Set the digital filter(s).

Parameters:
activate_filterbool

Whether any filter should be activated.

activate_avg_filterbool

Whether the average filter should be activated.

activate_med_filterbool

Whether the median filter should be activated.

async set_integration_time(int_time)

Set the integration time.

Parameters:
int_timefloat

The integration time.

async set_mode(mode)

Set the mode/unit.

Parameters:
modeint

The mode of the electrometer.

async set_range(set_range)

Set the range.

Parameters:
set_rangefloat

The new range value.

async set_voltage_level(level)
async set_voltage_limit(limit)
async set_voltage_range(range)
async start_scan()

Start storing values in the Keithley electrometer’s buffer.

async start_scan_dt(scan_duration)

Start storing values in the Keithley electrometer’s buffer, for a set duration.

Parameters:
scan_durationfloat

The amount of time to store values for.

async stop_scan()

Stop storing values in the Keithley electrometer.

async toggle_voltage_source(toggle)
async write_fits_file(signal, times, temperature, unit, voltage)

Write fits file of the intensity, time, and temperature values.

Parameters:
signallist of float

The amount of photons in a given reading, unit depends on mode of electrometer. * Curr: Ampere - Measure current * Volt: V - Measure volts * Char: Coulomb - Measure charge

timeslist of float

The time (TAI) of the signal data taken.

temperaturelist of float

A consistent temperature value (deg_C) obtained from the temperature probe over the period of signal acquisition.

unitlist of str

The unit of the signal data. (constant)

voltagelist of float

The source input in Volts maintained during signal acquisition.