3.2.1. qupulse.hardware.awgs¶
- class TaborAWGRepresentation(instr_addr=None, paranoia_level=1, external_trigger=False, reset=False, mirror_addresses=())[source]¶
Bases:
object- Parameters:
instr_addr – Instrument address that is forwarded to tabor_control
paranoia_level – Paranoia level that is forwarded to tabor_control
external_trigger – Not supported yet
reset
mirror_addresses
- property channel_pair_AB: TaborChannelPair¶
- property channel_pair_CD: TaborChannelPair¶
- get_status_table() Dict[str, str | float | int][source]¶
Send a lot of queries to the AWG about its settings. A good way to visualize is using pandas.DataFrame
- Returns:
An ordered dictionary with the results
- property main_instrument: tabor_control.device.TEWXAwg¶
- class TaborChannelPair(tabor_device: TaborAWGRepresentation, channels: Tuple[int, int], identifier: str)[source]¶
Bases:
AWG- CONFIG_MODE_PARANOIA_LEVEL = None¶
- arm(name: str) None[source]¶
Load the program ‘name’ and arm the device for running it. If name is None the awg will “dearm” its current program.
- property device: TaborAWGRepresentation¶
- property logger¶
- property programs: Set[str]¶
The set of program names that can currently be executed on the hardware AWG.
- remove(name: str) None[source]¶
Remove a program from the AWG.
Also discards all waveforms referenced only by the program identified by name.
- Parameters:
name (str) – The name of the program to remove.
- set_marker_state(marker: int, active: bool) None[source]¶
Sets the marker state of this channel pair. According to the manual one cannot turn them off/on separately.
- set_volatile_parameters(program_name: str, parameters: Mapping[str, Number]) None[source]¶
Set the values of parameters which were marked as volatile on program creation. Sets volatile parameters in program memory and device’s (adv.) sequence tables if program is current program.
If set_volatile_parameters needs to run faster, set CONFIG_MODE_PARANOIA_LEVEL to 0 which causes the device to enter the configuration mode with paranoia level 0 (Note: paranoia level 0 does not work for the simulator) and set device._is_coupled.
- Parameters:
program_name – Name of program which should be changed.
parameters – Names of volatile parameters and respective values to which they should be set.
- upload(name: str, program: Loop, channels: Tuple[str | int | None, str | int | None], markers: Tuple[str | int | None, str | int | None], voltage_transformation: Tuple[Callable, Callable], force: bool = False) None[source]¶
Upload a program to the AWG.
The policy is to prefer amending the unknown waveforms to overwriting old ones.
- class TektronixAWG(device: tek_awg.TekAwg, synchronize: str, identifier='Tektronix', logger=None, default_program_repetition_mode='once', idle_waveform_length=250)[source]¶
Bases:
AWGDriver for Tektronix AWG object (5000/7000 series).
- Special characteristics:
Changing the run mode to ‘running’ takes a lot of time (depending on the sequence)
To keep the “arm” time low each program is uploaded to the sequence table! This reduces the number of programs drastically but allows very fast switching with arm IF the awg runs.
Arm starts the awg if it does not run. The first call to arm after uploading new programs is therefore slow. This guarantees that subsequent calls to arm and run_current_program are always fast.
Uploading while the awg runs is VERY slow. The private properties _allow_upload_while_running and _auto_stop_on_upload control the behaviour in this case (stopping the awg or raising an exception). These properties are currently not a stable interface to that functionality hence the privateness.
- This driver implements an interface for changing the program repetition mode consisting of:
the property default_program_repetition_mode
set_program_repetition_mode(program_name, mode)
get_program_repetition_mode(program_name)
Synchronization: The driver relies on the fact that internal variables correspond to the device state: _sequence_entries and _waveforms We do not aim to detect user manipulation but want to make sure invalidate the internal state on upload errors. To do this the attribute _synchronized is set to False. Methods that rely on the synchronization state to correctly modify the awg check that attribute.
All private functions assume that the error queue is empty when called.
TODO: Move logger and repetition mode functionality to AWG interface
- Parameters:
device – Instance of the underlying driver from tek_awg package
synchronize – Either ‘read’ or ‘clear’.
identifier – Some identifier
logger – Logging will happen here (defaults to ‘qupulse.tektronix’ otherwise)
default_program_repetition_mode – ‘once’ or ‘infinite’
idle_waveform_length – length of the idle_waveform in samples
- cleanup()[source]¶
Delete all waveforms not used anymore and rewrite sequence entries if they are fragmented
- clear()[source]¶
Clear all waveforms, the sequence table and program registry and initialize the idle program.
- property default_program_repetition_mode: str¶
repetition mode for newly uploaded programs. Valid values are ‘once’ and ‘infinite’. You can use set_program_repetition_mode to change the repetition mode of an existing program
- property device: tek_awg.TekAwg¶
- get_program_repetition_mode(program_name: str) str[source]¶
This function uses cached data and does not talk to the awg
- initialize_idle_program()[source]¶
Make sure we can arm the idle program which plays the idle waveform(default 0V) on all channels.
- property programs: Set[str]¶
The set of program names that can currently be executed on the hardware AWG.
- remove(name: str)[source]¶
Remove a program from the AWG.
Also discards all waveforms referenced only by the program identified by name.
- Parameters:
name – The name of the program to remove.
- run_current_program(channel_states: Tuple[bool, bool, bool, bool] | None = None)[source]¶
Runs the currentlz armed program
- Parameters:
channel_states – If given the channel states are set to these values
Returns:
- set_volatile_parameters(program_name: str, parameters)[source]¶
Set the values of parameters which were marked as volatile on program creation.
- upload(*args, **kwargs)[source]¶
Upload a program to the AWG.
Physically uploads all waveforms required by the program - excluding those already present - to the device and sets up playback sequences accordingly. This method should be cheap for program already on the device and can therefore be used for syncing. Programs that are uploaded should be fast(~1 sec) to arm.
- Parameters:
name – A name for the program on the AWG.
program – The program (a sequence of instructions) to upload.
channels – Tuple of length num_channels that ChannelIDs of in the program to use. Position in the list corresponds to the AWG channel
markers – List of channels in the program to use. Position in the List in the list corresponds to the AWG channel
voltage_transformation – transformations applied to the waveforms extracted rom the program. Position
channel (in the list corresponds to the AWG)
force – If a different sequence is already present with the same name, it is overwritten if force is set to True. (default = False)
Modules
This module defines the common interface for arbitrary waveform generators. |
|