AlazarTech oscilloscope plugin

PLACE plugin for the AlazarTech ATS660 and ATS9440 oscilloscope cards.

Oscilloscopes are at the heart of many data acquisition experiments and contain many configuration options. At the time of this writing, this PLACE module is by far the most complex. However, even though it is complex, it still follows the basic PLACE philosophy of config/update/cleanup.

This plugin can be used as an example for how to program complex instruments into the PLACE system.

class place.plugins.alazartech.alazartech.ATSGeneric(config, plotter)[source]

Generic AlazarTech oscillscope card.

All AlazarTech cards use the same underlying driver. This class provides access to these universal features. This class should be overridden if classes are needed for specific cards.

Note

This class currently only supports boards providing data in an unsigned, 2 bytes per sample, format. It should support 12, 14, and 16-bits per sample. If 8-bits per sample is desired, functionality will need to be added to this class.

AlazarTech will produce the following experimental data:

Heading Type Meaning
trace (channel,record,sample) array of uint16 the trace data recorded on the oscilloscope

Note

PLACE will add the instrument class name to the heading. For example, trace will be recorded as ATS9440-trace when using the ATS9440 oscilloscope card. The reason for this is because NumPy will not check for duplicate heading names, so prepending the class name greatly reduces the likelihood of data loss.

Example code for reading AlazarTech data from a PLACE .npy file:

import numpy as np
data = np.load('scan_data.npy')
heading = 'ATS660-trace'
row = 0  # corresponds to the 'update' number
alazartech_data = data[heading][row]
channel = 0
record = 0
sample = 9
sample10 = alazartech_data[channel][record][sample]

In this example, we are looking at the data in a file named data_000.npy. This file is created after the first update in a PLACE experiment and contains one row of data. The AlazarTech data is therefore located in the column named 'ATS660-trace' and row 0. From there, we can examine the data as desired.

If the experiment has completed normally, all the rows will be stored in a single file, named data.npy. In this case, the code above is the same, but you would need to specify the row value desired.

config(metadata, total_updates)[source]

Configure the AlazarTech oscilliscope card.

This method is responsible for reading configuration date from self._config and using this data to configure the oscilloscope card for data acquisition. We mirror the steps suggested by the SDK Guide:

Before acquiring data from a board system, an application must configure the timebase, analog inputs, and trigger system settings for each board in the board system.

—ATS SDK Guide

After configuring the board, this method also performs the first data acquisition steps by setting the record size and the record count.

Parameters:
  • metadata (dict) – PLACE maintains metadata for each experiment in a dictionary object. During the configuration phase, this dictionary is passed to each instrument through this function so that relevant instrument data can be recorded into it. Instruments should record information that is relevant to the entire experiment, but is also specific to the instrument. For example, if an instrument is using one of many filters during this experiment, it would be appropriate to record the filter into the experiment metadata.
  • total_updates (int) – This value will always be used to inform each instrument of the number of updates (or steps) that will be perfomed during this experiment. Instruments should use this value to determine when to perform specific tasks during the experiment. For example, some instruments may want to perform a task at the midpoint of an experiment and can therefore use this value to determine which update will represent the midpoint.
update(update_number, progress)[source]

Record a trace using the current configuration.

Parameters:
  • update_number (int) – This will be the current update number (starting with 0) of the experiment. Instruments could certainly count the number of updates themselves, but this is provided as a convenience.
  • progress (dict) – A blank dictionary for sending data back to the frontend
Returns:

a multi-dimensional array containing the channel, record, and sample data.

Return type:

numpy.array dtype=’(number_channels, number_records, number_samples)uint16’

cleanup(abort=False)[source]

Nothing to cleanup

Parameters:abort (bool) – indicates the experiment has been stopped rather than having finished normally
class place.plugins.alazartech.alazartech.AnalogInput(channel, coupling, input_range, impedance)[source]

Class describing a specific input (channel) on the AlazarTech card.

Each AlazarTech card can have many input channels. Instead of maintaining configuration data for all inputs, we dynamically create configuration objects containing the data for just one input. This data is provided as a list of configurations in the AlazarTech configuration data.

AnalogInput requires the following configuration data (found in self._config['analog_inputs'] and passed to the constructor):

Key Type Meaning
input_channel string the channel associated with this input (must name a constant from the ATS driver file)
input_coupling string AC or DC coupling (must name a constant from the ATS driver file)
input_range string the voltage input range (must name a constant from the ATS driver file)
input_impedance string the selected impedance for the input (must name a constant from the ATS driver file)
class place.plugins.alazartech.alazartech.ATS660(config, plotter)[source]

Subclass for ATS660

class place.plugins.alazartech.alazartech.ATS9440(config, plotter)[source]

Subclass for ATS9440