3.3.2.1. qupulse.hardware.dacs.alazar

Functions

_windows_to_samples(begins, lengths, sample_rate)

gcd_set(data)

Classes

AcquisitionProgram(_sample_rate, _masks)

AlazarCard(card[, config])

AlazarProgram(_sample_rate, _masks, ...)

AvoidSingleBufferAcquisition(wrapped_strategy)

BufferStrategy()

This class defines the strategy how the buffer size is chosen.

ForceBufferSize(target_size)

param aimed_size

Try to use that length

OneBufferPerWindow()

Choose the greatest common divisor of all window periods (diff(begin)) as buffer size.

class qupulse.hardware.dacs.alazar.AcquisitionProgram(_sample_rate: Optional[qupulse.utils.types.TimeType] = None, _masks: dict = <factory>)[source]

Bases: object

clear_masks()[source]
property sample_rate: Optional[qupulse.utils.types.TimeType]
set_measurement_mask(mask_name: str, sample_rate: qupulse.utils.types.TimeType, begins: numpy.ndarray, lengths: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray][source]

Raise error if sample factor has changed

class qupulse.hardware.dacs.alazar.AlazarCard(card, config: Optional[atsaverage.config.ScanlineConfiguration] = None)[source]

Bases: qupulse.hardware.dacs.dac_base.DAC

arm_program(program_name: str) None[source]

Prepare the device for measuring the given program and wait for a trigger event.

property buffer_strategy: qupulse.hardware.dacs.alazar.BufferStrategy
property card: Any
clear() None[source]

Clears all registered programs.

property config
property current_config
delete_program(program_name: str) None[source]

Delete program from internal memory.

property mask_prototypes: Dict[str, Tuple[int, str]]
measure_program(channels: Iterable[str]) Dict[str, numpy.ndarray][source]

Get all measurements at once and write them in a dictionary.

property record_size_factor: int

The total record size of each measurement gets extended to be a multiple of this. None means that the minimal value supported by the card is taken.

register_mask_for_channel(mask_id: str, hw_channel: int, mask_type='auto') None[source]
Parameters
  • mask_id – Identifier of the measurement windows

  • hw_channel – Associated hardware channel (0, 1, 2, 3)

  • mask_type – Either ‘auto’ or ‘periodical

register_measurement_windows(program_name: str, windows: Dict[str, Tuple[numpy.ndarray, numpy.ndarray]]) None[source]

Register measurement windows for a given program. Overwrites previously defined measurement windows for this program.

Parameters
  • program_name – Name of the program

  • windows – Measurement windows by name. First array are the start points of measurement windows in nanoseconds. Second array are the corresponding measurement window’s lengths in nanoseconds.

register_operations(program_name: str, operations) None[source]

Register operations that are to be applied to the measurement results.

Parameters
  • program_name – Name of the program

  • operations – DAC specific instructions what to do with the data recorded by the device.

set_measurement_mask(program_name, mask_name, begins, lengths) Tuple[numpy.ndarray, numpy.ndarray][source]

Set/overwrite a single the measurement mask for a program. Begins and lengths are in nanoseconds.

Parameters
  • program_name – Name of the program

  • mask_name – Name of the mask/measurement windows

  • begins – Staring points in nanoseconds

  • lengths – Lengths in nanoseconds

Returns

Measurement windows in DAC samples (begins, lengths)

class qupulse.hardware.dacs.alazar.AlazarProgram(_sample_rate: Optional[qupulse.utils.types.TimeType] = None, _masks: dict = <factory>, operations: Sequence = <factory>, _total_length: Optional[int] = None, _auto_rearm_count: int = 1, buffer_strategy: Optional = None)[source]

Bases: qupulse.hardware.dacs.alazar.AcquisitionProgram

property auto_rearm_count: int

This is passed to AlazarCard.startAcquisition. The card will (re-)arm automatically for this many times.

buffer_strategy: Optional = None
iter(mask_maker)[source]
masks(mask_maker: Callable[[str, numpy.ndarray, numpy.ndarray], atsaverage.masks.Mask]) List[atsaverage.masks.Mask][source]
operations: Sequence
property total_length: int
class qupulse.hardware.dacs.alazar.AvoidSingleBufferAcquisition(wrapped_strategy: qupulse.hardware.dacs.alazar.BufferStrategy)[source]

Bases: qupulse.hardware.dacs.alazar.BufferStrategy

calculate_acquisition_properties(masks: Sequence[atsaverage.masks.CrossBufferMask], buffer_length_divisor: int) Tuple[int, int][source]
Parameters
  • windows – Measurement windows in samples

  • buffer_length_divisor – Necessary divisor of the buffer length

Returns

A tuple (buffer_length, total_acquisition_length)

class qupulse.hardware.dacs.alazar.BufferStrategy[source]

Bases: object

This class defines the strategy how the buffer size is chosen. Buffers might impact the signal due to hardware imperfections. The aim of this class is to allow the user to work around that.

abstract calculate_acquisition_properties(masks: Sequence[atsaverage.masks.CrossBufferMask], buffer_length_divisor: int) Tuple[int, int][source]
Parameters
  • windows – Measurement windows in samples

  • buffer_length_divisor – Necessary divisor of the buffer length

Returns

A tuple (buffer_length, total_acquisition_length)

static minimum_total_length(masks: Sequence[atsaverage.masks.CrossBufferMask]) int[source]
class qupulse.hardware.dacs.alazar.ForceBufferSize(target_size: int)[source]

Bases: qupulse.hardware.dacs.alazar.BufferStrategy

Parameters

aimed_size – Try to use that length

__init__(target_size: int)[source]
Parameters

aimed_size – Try to use that length

calculate_acquisition_properties(masks: Sequence[atsaverage.masks.CrossBufferMask], buffer_length_divisor: int) Tuple[int, int][source]
Parameters
  • windows – Measurement windows in samples

  • buffer_length_divisor – Necessary divisor of the buffer length

Returns

A tuple (buffer_length, total_acquisition_length)

class qupulse.hardware.dacs.alazar.OneBufferPerWindow[source]

Bases: qupulse.hardware.dacs.alazar.BufferStrategy

Choose the greatest common divisor of all window periods (diff(begin)) as buffer size. Aim is to only have an integer number of buffers in a measurement window.

calculate_acquisition_properties(masks: Sequence[atsaverage.masks.CrossBufferMask], buffer_length_divisor: int) Tuple[int, int][source]
Parameters
  • windows – Measurement windows in samples

  • buffer_length_divisor – Necessary divisor of the buffer length

Returns

A tuple (buffer_length, total_acquisition_length)

qupulse.hardware.dacs.alazar.gcd_set(data)[source]