atomiq.components.sinara.sampler module

class atomiq.components.sinara.sampler.Sampler(sampler_device, default_gain=[0, 0, 0, 0, 0, 0, 0, 0], *args, **kwargs)

Bases: ADC

Sinara Sampler 8 Channel ADC

This class represents the Sinara Sampler with all its 8 channels. It allows to sample all channels at once and to read out the result.

Parameters:
  • sampler_device -- The ARTIQ device for the sampler from the device_db, e.g. @sampler0

  • default_gain (TList(TInt32)) -- List with 8 entries setting the default gain for the 8 channels at startup. (default [0, .. , 0])

A Sampler card with all 8 channels.

Parameters:
  • sampler_device -- ARTIQ sampler device from the device db

  • default_gain (TList(TInt32)) -- (list(int)) default gain (0: 1, ..., 3: 1000) for the 8 channels

kernel_invariants = {'_sampler_device', 'default_gain'}
set_gain(channel, gain=0)
Parameters:
  • channel (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))])))

  • gain (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))])))

measure(samples=1, channel='')

Measures all channels and returns the mean for a given number of subsequent samples.

This method advances the timeline by samples * sampling_time

Parameters:
  • samples (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))]))) -- number of samples to take and average

  • channel (artiq.compiler.types.TMono('str', OrderedDict()))

Return type:

artiq.compiler.types.TMono('array', OrderedDict([('elt', artiq.compiler.types.TMono('float', OrderedDict())), ('num_dims', artiq.compiler.types.TValue(1))]))

class atomiq.components.sinara.sampler.SamplerChannel(default_gain=0, *args, **kwargs)

Bases: ADCChannel

Single ADC Channel of a Sinara Sampler

This class represents a single channel of a Sinara Sampler as an ADCChannel.

Parameters:

default_gain (TInt32) -- Default gain to set for the Sampler channel at startup. (default 0)

A single channel of a (possibly multichannel) ADC

Parameters:
  • adc_device -- The ADC the channel belongs to

  • channel -- The number of the channel

  • default_gain (TInt32)

set_gain(gain)

Set the gain for the Sampler Channel

Parameters:

gain (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))]))) -- Gain in machine units (0: 1, ..., 3: 1000)

kernel_invariants = {'adc_device', 'channel'}
measure(samples=1, cached=False, channel='')
Parameters:
  • samples (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))])))

  • cached (artiq.compiler.types.TMono('bool', OrderedDict()))

  • channel (artiq.compiler.types.TMono('str', OrderedDict()))

Return type:

artiq.compiler.types.TMono('float', OrderedDict())