command module

cryo_card

smurf_atca_monitor

Defines the SmurfAtcaMonitorMixin class.

class pysmurf.client.command.smurf_atca_monitor.SmurfAtcaMonitorMixin(log=None, epics_root=None, offline=False, pub_root=None, script_id=None, **kwargs)[source]

Mixin providing interface with the atca_monitor server.

This Mixin provides the pysmurf interface to the atca_monitor registers. The atca_monitor server is a Rogue application which uses IPMI to monitor information from the ATCA system 1. The atca_monitor server must be running or all queries will timeout and return None.

References

1

https://github.com/slaclab/smurf-atca-monitor

get_amc_sn(bay, slot_number=None, atca_epics_root=None, shelf_manager=None, use_shell=False, **kwargs)[source]

Returns the SMuRF AMC base board serial number.

The AMC serial number is the combination of its ‘Product Version’ and ‘Product Asset Tag’ from its FRU data. An example (the production AMCs built for Simons Observatory) is ‘Product Version’=C03 and ‘Product Asset Tag’=A01-11’, which combine to make the full AMC serial number C03-A01-11.

C03 refers to the hardware revision of the AMC base board. The A## refers to the specific AMC baseboard loading. The two most common SMuRF AMC base board loadings are A01 and A02 corresponding to low band (4-6 GHz) and high band (6-8 GHz) AMCs. The final number in the full serial number is the unique id assigned to each AMC base board which shares the same hardware revision and loading.

By default, will try to get the serial number by querying the ATCA monitor EPICS server. If you’re not running the ATCA monitor, you can still get the AMC serial number more slowly via the shell by providing use_shell=True.

Typical SMuRF AMC assemblies are composed of two connected boards, an AMC base board and an AMC RF daughter board. The serial number of an AMC RF daughter card in an AMC assembly cannot be obtained remotely; you must either know which card your AMC was assembled with (or you can ask SLAC which maintains a database with this information) or it should be labeled on the frontpanel of your AMC assembly.

Parameters
  • bay (int) – Which AMC bay (0 or 1).

  • slot_number (int or None, optional, default None) – The crate slot number of the carrier that the AMC is installed into. If None, defaults to the SmurfControl class attribute slot_number.

  • atca_epics_root (str or None, optional, default None) – ATCA monitor server application EPICS root. If None, defaults to the SmurfControl class attribute shelf_manager. For typical systems, atca_epics_root is the name of the shelf manager which for default systems is ‘shm-smrf-sp01’.

  • use_shell (bool, optional, default False) – If False, polls the ATCA monitor EPICs server ; if True, runs slower shell command to poll this attribute. This will be slower but provides an alternative if user is not running the ATCA monitor as part of their workflow, or if the ATCA monitor is down.

  • shelf_manager (str or None, optional, default None) – Only used if use_shell=True. If None, defaults to the SmurfControl class attribute shelf_manager. For typical systems the default name of the shelf manager is ‘shm-smrf-sp01’.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

AMC serial number for the requested bay e.g. ‘C03-A01-01’. If None, either the EPICS query timed out or the atca_monitor server isn’t running, or if running with use_shell=True, the shell command failed. Also returns None if there’s no AMC in the requested bay if use_shell=True or if use_shell=True and the shell command used to poll the AMC FRU fails.

Return type

str or None

get_board_temp_amc(bay, slot_number=None, atca_epics_root=None, **kwargs)[source]

Returns the AMC board temperature.

Parameters
  • bay (int) – Which AMC bay (0 or 1).

  • slot_number (int or None, optional, default None) – The crate slot number that the AMC is installed into. If None, defaults to the SmurfControl class attribute slot_number.

  • atca_epics_root (str or None, optional, default None) – ATCA monitor server application EPICS root. If None, defaults to the SmurfControl class attribute shelf_manager. For typical systems, atca_epics_root is the name of the shelf manager which for default systems is ‘shm-smrf-sp01’.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

AMC board temperature in Celsius. If None, either the EPICS query timed out or the atca_monitor server isn’t running.

Return type

float or None

get_board_temp_fpga(slot_number=None, atca_epics_root=None, **kwargs)[source]

Returns the AMC carrier board temperature.

Parameters
  • slot_number (int or None, optional, default None) – The crate slot number that the AMC carrier is installed into. If None, defaults to the SmurfControl class attribute slot_number.

  • atca_epics_root (str or None, optional, default None) – ATCA monitor server application EPICS root. If None, defaults to the SmurfControl class attribute shelf_manager. For typical systems, atca_epics_root is the name of the shelf manager which for default systems is ‘shm-smrf-sp01’.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

AMC carrier board temperature in Celsius. If None, either the EPICS query timed out or the atca_monitor server isn’t running.

Return type

float or None

get_board_temp_rtm(slot_number=None, atca_epics_root=None, **kwargs)[source]

Returns the RTM board temperature.

Parameters
  • slot_number (int or None, optional, default None) – The crate slot number that the RTM is installed into. If None, defaults to the SmurfControl class attribute slot_number.

  • atca_epics_root (str or None, optional, default None) – ATCA monitor server application EPICS root. If None, defaults to the SmurfControl class attribute shelf_manager. For typical systems, atca_epics_root is the name of the shelf manager which for default systems is ‘shm-smrf-sp01’.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

RTM board temperature in Celsius. If None, either the EPICS query timed out or the atca_monitor server isn’t running.

Return type

float or None

get_carrier_sn(slot_number=None, atca_epics_root=None, shelf_manager=None, use_shell=False, **kwargs)[source]

Returns the SMuRF carrier serial number.

The carrier serial number is the combination of its ‘Product Version’ and ‘Product Asset Tag’ from its FRU data. An example (the production carriers built for Simons Observatory) is ‘Product Version’=C03 and ‘Product Asset Tag’=A04-50’, which combine to make the full AMC serial number C03-A04-50.

C03 refers to the hardware revision of the carrier board. The A## refers to the specific carrier board loading. The final number in the full serial number is the unique id assigned to each carrier board which shares the same hardware revision and loading.

By default, will try to get the serial number by querying the ATCA monitor EPICS server. If you’re not running the ATCA monitor, can still get the carrier serial number more slowly via the shell by providing use_shell=True.

Parameters
  • slot_number (int or None, optional, default None) – The crate slot number that the carrier is installed into. If None, defaults to the SmurfControl class attribute slot_number.

  • atca_epics_root (str or None, optional, default None) – ATCA monitor server application EPICS root. If None, defaults to the SmurfControl class attribute shelf_manager. For typical systems, atca_epics_root is the name of the shelf manager which for default systems is ‘shm-smrf-sp01’.

  • use_shell (bool, optional, default False) – If False, polls the ATCA monitor EPICs server ; if True, runs slower shell command to poll this attribute. This will be slower but provides an alternative if user is not running the ATCA monitor as part of their workflow, or if the ATCA monitor is down.

  • shelf_manager (str or None, optional, default None) – Only used if use_shell=True. If None, defaults to the SmurfControl class attribute shelf_manager. For typical systems the default name of the shelf manager is ‘shm-smrf-sp01’.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

Carrier serial number e.g. ‘C03-A04-50’. If None, either the EPICS query timed out or the atca_monitor server isn’t running, or if running with use_shell=True, the shell command failed. Also returns None if there’s no carrier in the requested slot if use_shell=True or if use_shell=True and the shell command used to poll the carrier FRU fails.

Return type

str or None

get_junction_temp_fpga(slot_number=None, atca_epics_root=None, **kwargs)[source]

Returns FPGA junction temperature.

FPGA die temperature - probably from a sensor on the FPGA. If you are looking at this, you probably should be looking at get_fpga_temp() instead, which we think is more reliable.

Parameters
  • slot_number (int or None, optional, default None) – The crate slot number that the FPGA carrier is installed into. If None, defaults to the SmurfControl class attribute slot_number.

  • atca_epics_root (str or None, optional, default None) – ATCA monitor server application EPICS root. If None, defaults to the SmurfControl class attribute shelf_manager. For typical systems, atca_epics_root is the name of the shelf manager which for default systems is ‘shm-smrf-sp01’.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

FPGA junction temperature in Celsius. If None, either the EPICS query timed out or the atca_monitor server isn’t running.

Return type

float or None

get_rtm_sn(slot_number=None, atca_epics_root=None, shelf_manager=None, use_shell=False, **kwargs)[source]

Returns the SMuRF carrier serial number.

The RTM serial number is the combination of its ‘Product Version’ and ‘Product Asset Tag’ from its FRU data. An example (the production RTM built for Simons Observatory) is ‘Product Version’=C01 and ‘Product Asset Tag’=A01-02’, which combine to make the full RTM serial number C01-A01-02.

C01 refers to the hardware revision of the RTM board. The A## refers to the specific RTM board loading. The final number in the full serial number is the unique id assigned to each RTM board which shares the same hardware revision and loading.

By default, will try to get the serial number by querying the ATCA monitor EPICS server. If you’re not running the ATCA monitor, can still get the RTM serial number more slowly via the shell by providing use_shell=True.

Parameters
  • slot_number (int or None, optional, default None) – The crate slot number that the RTM is installed into. If None, defaults to the SmurfControl class attribute slot_number.

  • atca_epics_root (str or None, optional, default None) – ATCA monitor server application EPICS root. If None, defaults to the SmurfControl class attribute shelf_manager. For typical systems, atca_epics_root is the name of the shelf manager which for default systems is ‘shm-smrf-sp01’.

  • use_shell (bool, optional, default False) – If False, polls the ATCA monitor EPICs server ; if True, runs slower shell command to poll this attribute. This will be slower but provides an alternative if user is not running the ATCA monitor as part of their workflow, or if the ATCA monitor is down.

  • shelf_manager (str or None, optional, default None) – Only used if use_shell=True. If None, defaults to the SmurfControl class attribute shelf_manager. For typical systems the default name of the shelf manager is ‘shm-smrf-sp01’.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

RTM serial number e.g. ‘C01-A01-02’. If None, either the EPICS query timed out or the atca_monitor server isn’t running, or if running with use_shell=True, the shell command failed. Also returns None if there’s no RTM in the requested slot if use_shell=True or if use_shell=True and the shell command used to poll the RTM FRU fails.

Return type

str or None

write_atca_monitor_state(val, **kwargs)[source]

Writes atca_monitor state to yml file.

Writes all current ATCA monitor values to a yml file.

Parameters

val (str) – The path (including file name) to write the yml file to.

smurf_cmd

pysmurf.client.command.smurf_cmd.acq_n_frames(S, n_frames)[source]

Sends the amount of data requested by the user in units of n_frames.

Parameters
  • S (SmurfControl) – The SmurfControl object used to issue commands

  • n_frames (int) – The number of frames to keep data streaming on.

pysmurf.client.command.smurf_cmd.cfg_filename = '/usr/local/src/pysmurf/cfg_files/stanford/experiment_fp31_cc03-02_lbOnlyBay0.cfg'

A function that mimics mce_cmd. This allows the user to run specific pysmurf commands from the command line.

pysmurf.client.command.smurf_cmd.get_port(S, slot)[source]

Get the port number for streaming

Parameters
  • S (SmurfControl) – The SmurfControl object used to issue commands

  • slot (int) – The number of SMuRF slot

Returns

port – The port number associated with slot to stream data.

Return type

int

pysmurf.client.command.smurf_cmd.make_runfile(output_dir, row_len=60, num_rows=60, data_rate=60, num_rows_reported=60)[source]

Make the runfile

pysmurf.client.command.smurf_cmd.set_port(S, slot, port)[source]

Define a port/slot pair.

Parameters
  • S (SmurfControl) – The SmurfControl object used to issue commands

  • slot (int) – The number of SMuRF slot

pysmurf.client.command.smurf_cmd.start_acq(S)[source]

Start an acquisition

Parameters

S (SmurfControl) – The SmurfControl object used to issue commands

pysmurf.client.command.smurf_cmd.stop_acq(S)[source]

Stop the acquisition

Parameters

S (SmurfControl) – The SmurfControl object used to issue commands

smurf_command

class pysmurf.client.command.smurf_command.SmurfCommandMixin(log=None, epics_root=None, offline=False, pub_root=None, script_id=None, **kwargs)[source]
band_to_bay(b)[source]

Returns the bay index for the band. Assumes LB is plugged into bay 0, corresponding to bands [0,1,2,3] and that HB is plugged into bay 1, corresponding to bands [4,5,6,7].

Parameters

b (int) – Band number.

clear_unwrapping_and_averages(epics_poll=True, **kwargs)[source]

Resets unwrapping and averaging for all channels, in all bands.

close_data_file(**kwargs)[source]

Close the data file.

cpld_toggle(**kwargs)[source]

Toggles the cpld reset bit.

flux_ramp_off(**kwargs)[source]

Turns off the flux ramp - a useful wrapper for set_cfg_reg_ena_bit

flux_ramp_on(**kwargs)[source]

Turns on the flux ramp - a useful wrapper for set_cfg_reg_ena_bit

get_amp_drain_current(amp)[source]

Guess the current going out of the given amp by measuring the another voltage on the cryocard, for example 50K2_I. This function has high jitter, 1 mA at least. There is no set_amp_drain_current.

get_amp_drain_current_dict()[source]

Return dictionary of all drain currents. This will return two drain currents if working on the C02, and four drain currents if working on the C04.

get_amp_drain_enable(amp)[source]

Don’t use directly, use get_amp_drain_voltage. Get if power supply are enabled for this cryocard amplifier. The drain will output voltage even if the power register is zero (ESCRYODET-851).

get_amp_drain_voltage(amp)[source]

C04 only.

Parameters

amp (str) – Choose ‘50k’ or ‘hemt’ for the C00, C01, C02, and ‘50k1’, ‘50k2’, ‘hemt1’, ‘hemt2’ for the C04.

get_amplifier_biases()[source]

For the C00, C01 and C02, return dictionary of all gate voltages, drain currents, and drain power supply states. For the C04, also return all drain voltages.

get_amplitude_scale_array(band, **kwargs)[source]

Gets the array of amplitudes

Parameters

band (int) – The band to search.

Returns

amplitudes – The tone amplitudes.

Return type

array

get_amplitude_scale_channel(band, channel, **kwargs)[source]
get_amplitude_scales(band, **kwargs)[source]
get_analysis_scale(band, **kwargs)[source]
get_att_dc(b, **kwargs)[source]

Get the down-converter attenuator value

Parameters

b (int) – The band number.

get_att_uc(b, **kwargs)[source]

Get the upconverter attenuator value

Parameters

b (int) – The band number.

get_band_center_mhz(band, **kwargs)[source]

Returns the center frequency of the band in MHz

get_band_delay_us(band, **kwargs)[source]

Get band delay compensation, microseconds. Corrects for total system delay (cable, DSP, etc.).

get_build_dsp_g(**kwargs)[source]

BUILD_DSP_G encodes which bands the fw being used was built for. E.g. 0xFF means Base[0…7], 0xF is Base[0…3], etc.

get_center_frequency_array(band, **kwargs)[source]
get_center_frequency_mhz_channel(band, channel, **kwargs)[source]
get_cfg_reg_ena_bit(**kwargs)[source]
get_channel_frequency_mhz(band=None, **kwargs)[source]

Returns the channel frequency in MHz. The channel frequency is the rate at which channels are processed.

Parameters

band (int or None, optional, default None) – Which band. If None, assumes all bands have the same channel frequency, and pulls the channel frequency from the first band in the list of bands specified in the experiment.cfg.

Returns

The rate at which channels in this band are processed.

Return type

float

get_channel_mask(**kwargs)[source]

Gets the smuf processor channel mask.

Returns

mask – The channel mask.

Return type

list

get_configuring_in_progress(**kwargs)[source]

Whether or not configuration process in progress.

Set to True when the rogue setDefaults command is called (usually by a call to set_defaults_pv()), and then set to False when the rogue setDefaults method exits.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

Boolean flag indicating whether or not the configuration process is in progress. Returns True if the configuration process is in progress, otherwise returns False. If the underlying PV can not be read, this function returns None.

Return type

bool or None

See also

set_defaults_pv()

Loads the default configuration.

get_system_configured()

Returns final state of configuration process.

get_cpld_reset(**kwargs)[source]
get_crate_id(**kwargs)[source]

Gets the crate id.

Returns

val – The crate id.

Return type

int

get_crossbar_output_config(index, **kwargs)[source]

This is the timing crossbar, which determins how the SMuRF carrier receives its timing signal, and how the backplane receives its timing signal.

get_cryo_card_ac_dc_mode()[source]

Get the operation mode, AC or DC, based on the readback of the relays.

Returns

mode – String describing the operation mode. If the relays readback don’t match, then the string ‘ERROR’ is returned.

Return type

str

get_cryo_card_cycle_count(enable_poll=False, disable_poll=False)[source]

No description

Returns

cycle_count – The cycle count.

Return type

float

get_cryo_card_ps_en()[source]

Read the cryo card power supply enable signals

Returns

enables – 2-bit number with status of the power supplies enables

Bit 0 for HEMT supply Bit 1 for 50K supply Bit == 1 means enabled Bit == 0 means disabled

therefore: 0 = all off 1 = 50K on, HEMT off 2 = HEMT on, 50K off 3 = both on

Return type

int

get_cryo_card_relays(enable_poll=False, disable_poll=False)[source]

No description

Returns

relays – The cryo card relays value.

Return type

hex

get_cryo_card_temp(enable_poll=False, disable_poll=False)[source]

Get the self-reported temperature of the cryocard. This value is typically around 20 Celcius. Anything higher than 30 would indicate a problem. Anything below 0 C indicates the board is not connected.

Returns

temp – Temperature of the cryostat card in Celsius.

Return type

float

get_dac_axil_addr(reg, **kwargs)[source]

Gets the DacAxilAddr[#] registers.

get_dac_enable(bay, dac, **kwargs)[source]

Gets enable status of DAC

Parameters
  • bay (int) – Which bay [0 or 1].

  • dac (int) – Which DAC no. [0 or 1].

get_dac_reset(bay, dac, **kwargs)[source]

Reads the physical reset DAC register. Will be either 0 or 1.

Parameters
  • bay (int) – Which bay [0 or 1].

  • dac (int) – Which DAC no. [0 or 1].

get_dac_temp(bay, dac, **kwargs)[source]

Get temperature of the DAC in celsius

Parameters
  • bay (int) – Which bay [0 or 1].

  • dac (int) – Which DAC no. [0 or 1].

get_data_buffer_size(bay, **kwargs)[source]

Gets the data buffer size for the DAQs

get_data_file_name(**kwargs)[source]

Set the data file name.

Returns

The file name.

Return type

str

get_data_out_mux(bay, b, **kwargs)[source]
get_dbg_enable(bay, **kwargs)[source]

Whether or not write access is enabled for DBG registers.

If disabled (=False), user cannot write to any of the DBG registers.

Parameters
  • bay (int) – Which bay [0 or 1].

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

True for enabled, False for disabled.

Return type

bool

get_debounce_width(**kwargs)[source]
get_debug_select(bay, **kwargs)[source]
get_decimation(band, **kwargs)[source]
get_digitizer_frequency_mhz(band=None, **kwargs)[source]

Returns the digitizer frequency in MHz.

Parameters

band (int or None, optional, default None) – Which band. If None, assumes all bands have the same channel frequency, and pulls the channel frequency from the first band in the list of bands specified in the experiment.cfg.

Returns

The digitizer frequency for this band in MHz.

Return type

float

get_downsample_external_bitmask()[source]

Get the downsampler external bitmask. This bitmask is only used when get_downsample_mode is external. For example, 0 means never trigger, 1 means trigger on the first bit, 2 will trigger on the second bit, 4 will trigger on the third bit. By bit, we mean when the bit flips in one direction, because the bit will flip back on the next incoming data stream.

Ref. https://confluence.slac.stanford.edu/display/SMuRF/SMuRF+Processor

get_downsample_factor(**kwargs)[source]

Get the smurf processor down-sampling factor. This is only used when the downsampling mode is internal. When the downsampling mode is internal, the server will receive frames, place them through SmurfProcessor.cpp, but it will not release any data to be saved until it has counted up to this factor.

Returns

The down-sampling factor.

Return type

int

get_downsample_mode()[source]

Get the downsampler mode. 0 is internal, 1 is external.

Ref. SmurfHeader.h, SmurfHeader.cpp, _SmurfProcessor.py Ref. https://confluence.slac.stanford.edu/display/SMuRF/SMuRF+Processor

get_dsp_enable(band, **kwargs)[source]
get_enable(**kwargs)[source]

No description

Returns

The status of the global poll bit epics_root:AMCc:enable. If False, pyrogue is not currently polling the server. PVs will not be updating.

Return type

str

get_enable_ramp_trigger(**kwargs)[source]
get_enabled_bays(**kwargs)[source]

Returns list of enabled AMC bays.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

bays – Which bays were enabled on pysmurf server startup.

Return type

list of int

get_eta_mag_array(band, **kwargs)[source]
get_eta_mag_scaled_channel(band, channel, **kwargs)[source]
get_eta_phase_array(band, **kwargs)[source]
get_eta_phase_degree_channel(band, channel, **kwargs)[source]
get_eta_scan_amplitude(band, **kwargs)[source]

Gets the amplitude of the eta scan.

Parameters

band (int) – The band to set.

Returns

amp – The eta scan amplitude.

Return type

int

get_eta_scan_averages(band, **kwargs)[source]

Gets the number of frequency error averages taken at each point of the etaScan.

Parameters

band (int) – The band to set.

Returns

The number of frequency error averages taken at each point of the etaScan.

Return type

int

get_eta_scan_channel(band, **kwargs)[source]

Gets the channel to eta scan.

Parameters

band (int) – The band to set.

Returns

chan – The channel that is being eta scanned.

Return type

int

get_eta_scan_del_f(band, **kwargs)[source]

Gets offset frequency for serial eta scan estimation.

The rogue serial eta scan routine (run using run_serial_eta_scan()) estimates the eta parameter for each tone with nonzero amplitude in the provided band by sampling the frequency error at the tone frequency +/- this offset frequency. Units are Hz.

Parameters

band (int) – Which band.

Returns

val – Offset frequency in Hz about each resonator’s central frequency at which to sample the frequency error in order to estimate the eta parameters of each resonator in the rogue serial eta scan routine.

Return type

int

See also

run_serial_eta_scan()

Runs rogue serial eta scan, which uses this parameter.

set_eta_scan_del_f()

Sets the value of this parameter in rogue.

get_eta_scan_dwell(band, **kwargs)[source]

Gets how long to dwell

Parameters

band (int) – The band being eta scanned.

Returns

dwell – The time to dwell during an eta scan.

Return type

int

get_eta_scan_freq(band, **kwargs)[source]

No description

Parameters

band (int) – The band to count.

Returns

freq – The frequency of the scan.

Return type

int

get_eta_scan_in_progress(band, **kwargs)[source]
get_eta_scan_results_imag(band, count, **kwargs)[source]

Gets the imaginary component of the eta scan.

Parameters
  • band (int) – The to get eta scans.

  • count (int) – The number of samples to read.

Returns

resp – The imaginary component of the most recent eta scan.

Return type

float array

get_eta_scan_results_real(band, count, **kwargs)[source]

Gets the real component of the eta scan.

Parameters
  • band (int) – The to get eta scans.

  • count (int) – The number of samples to read.

Returns

resp – The real component of the most recent eta scan.

Return type

float array

get_evr_channel_reg_count(chan, **kwargs)[source]
get_evr_channel_reg_enable(chan, **kwargs)[source]

Get trigger channel enable.

The triggering firmware is broken into two parts: (1) the event selection logic “Channel”, and (2) the trigger pulse generation “Trigger”. Trigger pulse generation has several required inputs including which “Channel” to listen to. This “Enable” register controls whether or not the event selection logic for the requested channel is on.

Parameters
  • chan (int) – Which trigger event selection logic channel to enable or disable.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

1 if trigger channel is enabled, 0 if disabled.

Return type

int

See also

set_evr_channel_reg_enable()

Get trigger channel enable.

get_evr_trigger_dest_type(chan, **kwargs)[source]

Get trigger channel destination type.

The triggering firmware is broken into two parts: (1) the event selection logic “Channel”, and (2) the trigger pulse generation “Trigger”. Trigger pulse generation has several required inputs including which “Channel” to listen to. The channel destination type, or DestType, is an optional logic selection (logical AND of) on the presence of a beam where this logic is also used for LCLS-2 on the accelerator. For SMuRF we always use destination 0 (=”All” if you’re looking at the SMuRF Rogue gui) which tells the trigger channel logic to ignore all beam logic (a better name for “All” would be “DontCare”.

Parameters
  • chan (int) – Which trigger event selection logic channel’s destination type to get.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

Channel destination type of the requested channel. Although valid options are 0, 1, 2, and 3, SMuRF should always use 0 corresponding to “All” in the Rogue gui which instructs the channel to ignore any selection on the presence of beam for LCLS-2.

Return type

int

See also

set_evr_trigger_dest_type()

Set trigger channel destination type.

get_fast_slow_rst_value(**kwargs)[source]
get_fast_slow_step_size(**kwargs)[source]
get_feedback_enable(band, **kwargs)[source]
get_feedback_enable_array(band, **kwargs)[source]

Gets the array of feedbacks enables

Parameters

band (int) – The band to search.

Returns

fb_on – An array of whether the feedback is on or off.

Return type

bool array

get_feedback_enable_channel(band, channel, **kwargs)[source]

Get the feedback for a single channel

get_feedback_end(band, **kwargs)[source]

The flux ramp DAC value at which to stop applying feedback in each flux ramp cycle. In 2.4 MHz ticks.

Parameters

band (int) – Which band.

get_feedback_gain(band, **kwargs)[source]
get_feedback_limit(band, **kwargs)[source]

freq = centerFreq + feedbackFreq abs(freq) < centerFreq + feedbackLimit

get_feedback_polarity(band, **kwargs)[source]
get_feedback_start(band, **kwargs)[source]

The flux ramp DAC value at which to start applying feedback in each flux ramp cycle. In 2.4 MHz ticks.

Parameters

band (int) – Which band.

get_filter_a(**kwargs)[source]

Gets the smurf processor filter A coefficients.

Returns

coef – The filter A coefficients.

Return type

list

get_filter_alpha(band, **kwargs)[source]

Coefficient for single pole low pass fitler before readout (when channels are multiplexed, decimated) y[n] = alpha*x[n] + (1 - alpha)*y[n-1] matlab to visualize h = fvtool([alpha], [1 -(1-alpha)]); h.Fs = 2.4e6;

get_filter_b(**kwargs)[source]

Get the smurf processor filter B coefficients.

Returns

coef – The filter B coefficients.

Return type

list

get_filter_disable(**kwargs)[source]

If Disable is set to True, then the downsampling filter is off.

Returns

The status of the Disable bit.

Return type

bool

get_filter_gain(**kwargs)[source]

Get the smurf processor filter gain.

Returns

The filter gain.

Return type

float

get_filter_order(**kwargs)[source]

Get the smurf processor filter order.

Parameters

int – The filter order.

get_flux_ramp_dac(**kwargs)[source]
get_flux_ramp_freq(**kwargs)[source]

Returns flux ramp reset rate in kHz.

Returns the current flux ramp reset rate. In units of kHz.

The flux ramp reset rate is determined by polling the trigger repetition rate (the RampMaxCnt register in RtmCryoDet). RampMaxCnt is a 32-bit counter where each count represents a 307.2 MHz tick.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

Currently programmed flux ramp reset rate, in kHz.

Return type

float

See also

set_flux_ramp_freq

Sets the flux ramp reset rate.

get_ramp_max_cnt

Gets the flux ramp trigger repetition rate.

get_fpga_build_stamp(**kwargs)[source]

Get the FPGA build stamp.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

The FPGA build stamp.

Return type

str

get_fpga_git_hash(**kwargs)[source]

Get the full FPGA firmware SHA-1 git hash.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

The full git SHA-1 hash of the FPGA firmware.

Return type

str

get_fpga_git_hash_short(**kwargs)[source]

Get the short FPGA firmware SHA-1 git hash.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

The short git SHA-1 hash of the FPGA firmware.

Return type

str

get_fpga_temp(**kwargs)[source]

Gets the temperature of the UltraScale+ FPGA. Returns float32, the temperature in degrees Celsius.

Returns

val – The UltraScale+ FPGA temperature in degrees Celsius.

Return type

float

get_fpga_uptime(**kwargs)[source]

No description

Returns

uptime – The FPGA uptime.

Return type

float

get_fpga_vccaux(**kwargs)[source]

No description

Returns

val – The UltraScale+ FPGA VccAux in Volts.

Return type

float

get_fpga_vccbram(**kwargs)[source]

No description

Returns

val – The UltraScale+ FPGA VccBram in Volts.

Return type

float

get_fpga_vccint(**kwargs)[source]

No description

Returns

val – The UltraScale+ FPGA VccInt in Volts.

Return type

float

get_fpga_version(**kwargs)[source]

No description

Returns

version – The FPGA version.

Return type

str

get_frame_count(**kwargs)[source]

Gets the frame count going into the SmurfProcessor. This must be incrementing if you are attempting to stream data.

Returns

The frame count number

Return type

int

get_frame_loss_cnt(**kwargs)[source]

The number of frames that did not make it to the smurf processor

get_frame_out_order_count(**kwargs)[source]
get_frame_size(**kwargs)[source]

Gets the size of the frame going into the smurf processor.

Returns

The size of the data frame into the smurf processor.

Return type

int

get_frequency_error_array(band, **kwargs)[source]
get_frequency_error_mhz(band, channel, **kwargs)[source]
get_fru_info(board, bay=None, slot_number=None, shelf_manager=None)[source]

Returns FRU information for SMuRF board.

Wrapper for dumping the FRU information for SMuRF boards using shell commands.

Parameters
  • board (str) – Which board to return FRU informationf for. Valid options include ‘amc’, ‘carrier’, or ‘rtm’. If ‘amc’, must also provide the bay argument.

  • bay (int, optional, default None) – Which bay to return the AMC FRU information for. Used only if board=’amc’.

  • slot_number (int or None, optional, default None) – The crate slot number that the AMC is installed into. If None, defaults to the SmurfControl class attribute slot_number.

  • shelf_manager (str or None, optional, default None) – Shelf manager ip address. If None, defaults to the SmurfControl class attribute shelf_manager. For typical systems the default name of the shelf manager is ‘shm-smrf-sp01’.

Returns

fru_info_dict – Dictionary of requested FRU information. Returns None if board not a valid option, board not present in slot, slot not present in shelf, or if no AMC is up in the requested bay.

Return type

dict

get_gradient_descent_averages(band, **kwargs)[source]
get_gradient_descent_beta(band, **kwargs)[source]
get_gradient_descent_converge_hz(band, **kwargs)[source]
get_gradient_descent_gain(band, **kwargs)[source]
get_gradient_descent_max_iters(band, **kwargs)[source]
get_gradient_descent_momentum(band, **kwargs)[source]
get_gradient_descent_step_hz(band, **kwargs)[source]
get_high_cycle(val, **kwargs)[source]

CPLD’s clock: high cycle duration (zero inclusive). Along with LowCycle, sets the frequency of the clock going to the RTM.

get_input_mux_sel(bay, lane, **kwargs)[source]
get_iq_stream_enable(band, **kwargs)[source]
get_iq_swap_in(band, **kwargs)[source]

Swaps I&Q into DSP (from ADC). Tones being output by the system will flip about the band center (e.g. 4.25GHz, 5.25GHz etc.)

get_iq_swap_out(band, **kwargs)[source]

Swaps I&Q out of DSP (to DAC). Swapping I&Q flips spectrum around band center.

Disables jesd link

get_jesd_status(**kwargs)[source]

Gets the status of the Rogue AppTop.JesdHealth method.

Returns the status of a call to the AppTop.JesdHealth method. States are:

  • “Unlocked” : The AppTop.JesdHealth command has been run and has reported that the JESD were unlocked (that’s bad!).

  • “Locked” : The AppTop.JesdHealth command has been run and has reported that the JESD were locked (that’s good!).

  • “Checking” : The AppTop.JesdHealth command is in progress.

  • “Not found” : The Rogue ZIP file currently in use does not contain the AppTop.JesdHealth method.

  • None : The SmurfApplication:JesdStatus register is not implemented in pysmurf core code versions <4.1.0.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to all _caget calls.

Returns

status – The status of the Rogue AppTop.JesdHealth method. Returns None for pysmurf core code versions <4.1.0 where the SmurfApplication:JesdStatus register is not implemented.

Return type

str or None

See also

set_check_jesd()

Gets the status of the Rogue AppTop.JesdHealth method.

get_k_relay(**kwargs)[source]
get_lmk_enable(bay, **kwargs)[source]

Set the LMK:Enable bit.

Parameters
  • bay (int) – 0 or 1.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the epics.caget call.

get_lmk_reg(bay, reg, **kwargs)[source]

Can call like this hex(get_lmk_reg(bay=0,reg=0x147)) to see only hex as in gui.

get_lms_delay(band, **kwargs)[source]

Match system latency for LMS feedback (2.4MHz ticks)

get_lms_dly_fine(band, **kwargs)[source]

fine delay control (38.4MHz ticks)

get_lms_enable1(band, **kwargs)[source]

Enable 1st harmonic tracking

get_lms_enable2(band, **kwargs)[source]

Enable 2nd harmonic tracking

get_lms_enable3(band, **kwargs)[source]

Enable 3rd harmonic tracking

get_lms_freq(band, **kwargs)[source]

LMS frequency = flux ramp freq * nPhi0

get_lms_freq_hz(band, **kwargs)[source]

LMS frequency = flux ramp freq * nPhi0

get_lms_gain(band, **kwargs)[source]

LMS gain, powers of 2

get_lms_rst_dly(band, **kwargs)[source]

Disable feedback after reset (2.4MHz ticks)

get_load_tune_file(band, **kwargs)[source]
get_loop_filter_output_array(band, **kwargs)[source]
get_low_cycle(val, **kwargs)[source]

CPLD’s clock: low cycle duration (zero inclusive). Along with HighCycle, sets the frequency of the clock going to the RTM.

get_max_file_size(**kwargs)[source]

Get maximum file size for streamed data.

If nonzero, when streaming data to disk, will split data over files of this size, in bytes. Files have the usual name but with an incrementing integer appended at the end, e.g. .dat.1, .dat.2, etc..

Returns

Maximum file size for streamed data in bytes. Returns zero if there’s no limit in place.

Return type

int

See also

set_max_file_size()

Get maximum file size for streamed data.

get_mode_control(**kwargs)[source]
get_noise_select(band, **kwargs)[source]
get_number_channels(band=None, **kwargs)[source]

Returns the number of channels in a band.

Parameters

band (int or None, optional, default None) – Which band. If None, assumes all bands have the same number of channels, and pulls the number of channels from the first band in the list of bands specified in the experiment.cfg.

Returns

The number of channels in the band.

Return type

int

get_number_processed_channels(band=None, **kwargs)[source]

Returns the number of processed channels in a band.

Parameters

band (int or None, optional, default None) – Which band. If None, assumes all bands have the same number of channels, and pulls the number of channels from the first band in the list of bands specified in the experiment.cfg.

Returns

n_processed_channels – The number of processed channels in the band.

Return type

int

get_number_sub_bands(band=None, **kwargs)[source]

Returns the number of subbands in a band. To do - possibly hide this function.

Parameters

band (int or None, optional, default None) – Which band. If None, assumes all bands have the same number of sub bands, and pulls the number of sub bands from the first band in the list of bands specified in the experiment.cfg.

Returns

The number of subbands in the band.

Return type

int

get_payload_size(**kwargs)[source]

The payload size defines the number of available channels to write to disk/stream. Payload size must be larger than the number of channels going into the channel mapper

Returns

The number of channels written to disk. This is independent of the number of active channels.

Return type

int

get_postdata_emulator_amplitude(**kwargs)[source]
get_postdata_emulator_enable(**kwargs)[source]
get_postdata_emulator_offset(**kwargs)[source]
get_postdata_emulator_period(**kwargs)[source]

No description

Returns

period – Number of frames that make up a period.

Return type

int

get_postdata_emulator_type(**kwargs)[source]

Gets the postdata emulator type.

Returns

type – 0 - Zeros, 1 - ChannelNumber, 2 - Random, 3 - Square, 4 - Sawtooth, 5 - Triangle, 6 - Sine, 7 - DropFrame

Return type

int

get_predata_emulator_amplitude(**kwargs)[source]
get_predata_emulator_disable(**kwargs)[source]

Gets the predata emulator disable status.

Returns

type

Return type

bool

get_predata_emulator_enable(**kwargs)[source]

Gets the enable bit for predata emulator.

get_predata_emulator_offset(**kwargs)[source]
get_predata_emulator_period(**kwargs)[source]

Expressed as the number of incoming frames. It must be greater that 2. This period will be expressed in term of the period of the received frames, which in turn is related to the flux ramp period.

Returns

period – Number of frames that make up a period

Return type

int

get_predata_emulator_type(**kwargs)[source]

Gets the predata emulator type.

Returns

type – 0 - Zeros, 1 - ChannelNumber, 2 - Random, 3 - Square, 4 - Sawtooth, 5 - Triangle, 6 - Sine, 7 - DropFrame

Return type

int

get_pulse_width(**kwargs)[source]

Select Ramp to the CPLD 0x1 = Fast flux Ramp 0x0 = Slow flux ramp

get_pysmurf_directory(**kwargs)[source]

Returns path to the pysmurf python files.

Path to the files from which the pysmurf module was loaded. Alias for pysmurf__file__.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

Path to pysmurf files.

Return type

str

get_pysmurf_version(**kwargs)[source]

Returns the pysmurf version.

Alias for pysmurf.__version__.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

pysmurf version.

Return type

str

get_ramp_max_cnt(**kwargs)[source]

Internal Ramp’s maximum count. Sets the trigger repetition rate. This is effectively the flux ramp frequency.

RampMaxCnt = 307199 means flux ramp is 1kHz (307.2e6/(RampMaxCnt+1))

get_ramp_rate(**kwargs)[source]

flux ramp sawtooth reset rate in kHz

get_ramp_slope(**kwargs)[source]
get_ramp_start_mode(**kwargs)[source]

Select Ramp to the CPLD 0x2 = trigger from external system 0x1 = trigger from timing system 0x0 = trigger from internal system

get_readout_channel_select(band, **kwargs)[source]
get_ref_phase_delay(band, **kwargs)[source]

Deprecated. Use get_band_delay_us instead.

get_ref_phase_delay_fine(band, **kwargs)[source]

Deprecated. Use get_band_delay_us instead.

get_regulator_iout(**kwargs)[source]

No description

Returns

value – Regulator current in amperes.

Return type

float

get_regulator_temp1(**kwargs)[source]

No description

Returns

value – Regulator PT temperature in C.

Return type

float

get_regulator_temp2(**kwargs)[source]

No description

Returns

value – A regulator CTRL temperature in C.

Return type

float

get_rf_enable(band, **kwargs)[source]

0x0 output all 0s to DAC 0x1 enable output to DAC (from DSP or waveform table)

get_rf_iq_stream_enable(band, **kwargs)[source]

gets the bit that turns on RF IQ streaming for take_debug_data

Parameters
  • band (int) – The 500 MHz band

  • Ret

  • ---

  • rf_iq_stream_bit (int) – The bit that sets the RF streaming

get_rogue_version(**kwargs)[source]

Get rogue version

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

The rogue version

Return type

str

get_rtm_arb_waveform_busy(**kwargs)[source]

=1 if waveform if Continuous=1 and the RTM arbitrary waveform is being continously generated. Can be toggled low again by setting Continuous=0.

get_rtm_arb_waveform_continuous(**kwargs)[source]

If =1, RTM arbitrary waveform generation is continuous and repeats, otherwise if =0, waveform in LUT tables is only broadcast once on software trigger.

get_rtm_arb_waveform_enable(**kwargs)[source]

Enable for generation of arbitrary waveforms on the RTM slow DACs.

EnableCh = 0x0 is disable 0x1 is Addr[0] 0x2 is Addr[1] 0x3 is Addr[0] and Addr[1]

get_rtm_arb_waveform_lut_table(reg, **kwargs)[source]

Gets the table currently loaded into the LUT table indexed by reg.

get_rtm_arb_waveform_max_addr(**kwargs)[source]

Slow RTM DACs will play the sequence [0…MaxAddr] of points out of the loaded LUT tables before stopping or repeating on software trigger (if in continuous mode). MaxAddr is an 11-bit number (must be in [0,2048), because that’s the maximum length of the LUT tables that store the waveforms.

get_rtm_arb_waveform_timer_size(**kwargs)[source]

Arbitrary waveforms are written to the slow RTM DACs with time between samples TimerSize*6.4ns.

get_rtm_arb_waveform_trig_cnt(**kwargs)[source]

Counts the number of RTM arbitrary waveform software triggers since boot up or the last CntRst.

get_rtm_slow_dac_data(dac, **kwargs)[source]

Gets the value in the data register for the requested DAC, which sets the output voltage of the DAC.

Parameters

dac (int) – Which DAC to command. 1-indexed. If a DAC index outside of the valid range is provided (must be within [1,32]), will assert.

Returns

The data register setting for the requested DAC, in DAC units. The data register sets the output voltage of the DAC.

Return type

int

get_rtm_slow_dac_data_array(**kwargs)[source]

Gets the value in the data register, in DAC units, for all 32 DACs. The value in these registers set the output voltages of the DACs.

Returns

array – Size (32,) array of DAC values, in DAC units. The value of these registers set the output voltages of the DACs.

Return type

int array

get_rtm_slow_dac_enable(dac, **kwargs)[source]

Returns the DacCtrlReg for this DAC, which specifies the AD5790 analog output configuration for the requested DAC number. Should be set to 0x2 in normal operation.

Parameters

dac (int) – Which DAC to query. 1-indexed. If a DAC index outside of the valid range is provided (must be within [1,32]), will assert.

Returns

val – The DacCtrlReg setting for the requested DAC.

Return type

int

get_rtm_slow_dac_enable_array(**kwargs)[source]

Returns the current DacCtrlReg setting for all of the DACs at once (a 32 element integer array). DacCtrlReg configures the AD5790 analog outputs. If set to 0x2, then the DAC is configured for normal operation, which only needs to be done once for each DAC in a boot session. Reading the values as an array should be much faster than reading them for each DAC individually using the get_rtm_slow_dac_enable function (single versus multiple transactions).

Returns

val – An array containing the DacCtrlReg settings for all of the slow RTM DACs.

Return type

int array

get_rtm_slow_dac_volt(dac, **kwargs)[source]

Gets the current output voltage for the requested DAC.

Parameters

dac (int) – Which DAC to query. 1-indexed. If a DAC index outside of the valid range is provided (must be within [1,32]), will assert.

Returns

The DAC voltage in volts.

Return type

float

get_rtm_slow_dac_volt_array(**kwargs)[source]

Returns the output voltage for all 32 DACs at once, in volts. Reading the values as an array should be much faster than reading them for each DAC individually using the get_rtm_slow_dac_volt function (single versus multiple transactions).

Returns

volt_array – Size (32,) array of DAC values in volts.

Return type

float array

get_run_eta_scan(band, **kwargs)[source]

Gets the status of eta scan.

Parameters

band (int) – The band that is being checked.

Returns

status – Whether the band is eta scanning.

Return type

int

get_select_ramp(**kwargs)[source]

Select Ramp to the CPLD 0x1 = Fast flux Ramp 0x0 = Slow flux ramp

get_single_channel_readout(band, **kwargs)[source]
get_single_channel_readout_opt2(band, **kwargs)[source]
get_slot_number(**kwargs)[source]

Gets the slot number of the crate that the carrier is installed into.

Returns

val – The slot number of the crate that the carrier is installed into.

Return type

int

get_smurf_processor_num_channels(**kwargs)[source]

This is the number of channels that smurf_processor (the thing that does the downsampling, filtering, etc and then swrites to disk/streams data to the DAQ) thinks are on.

This value is read only.

get_smurf_startup_args(**kwargs)[source]

Returns pysmurf server startup arguments.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

pysmurf server startup arguments.

Return type

str

get_smurf_startup_script(**kwargs)[source]

Returns path to the pysmurf server startup script.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

Path to pysmurf server startup script.

Return type

str

get_stream_data_source_enable(**kwargs)[source]
get_stream_data_source_period(**kwargs)[source]

Gets the data source period.

get_stream_enable(**kwargs)[source]

Enable/disable streaming data, for all bands.

get_streamdatawriter_close(**kwargs)[source]
get_streamdatawriter_datafile(as_str=True, **kwargs)[source]

Gets output path for the StreamDataWriter.

This is what is used for take_debug_data.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

The full path for the output.

Return type

str

get_streamdatawriter_open(**kwargs)[source]
get_streaming_datafile(as_string=True, **kwargs)[source]

Gets the datafile that streaming data is written to.

Parameters

as_string (bool, optional, default True) – The output data returns as a string. If False, the input data must be a length 300 character int.

Returns

datafile – The name of the datafile.

Return type

str or length 300 int array

get_streaming_file_open(**kwargs)[source]

Gets the streaming file status. 1 is streaming, 0 is not.

Returns

val – The streaming status.

Return type

int

get_synthesis_scale(band, **kwargs)[source]
get_system_configured(**kwargs)[source]

Returns final state of the configuration process.

If the configuration was loaded without errors by the rogue setDefaults command (usually by a call to set_defaults_pv()) and all tests pass, this flag is set to True when the rogue setDefaults method exits.

Warning

The register used to check if the system has been configured, AMCc:SmurfApplication:SystemConfigured, is a software register, and does not persist if the Rogue server is restarted. So this function will only tell you if the system has been successfully configured at any point during the current Rogue server session.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

Boolean flag indicating the final state of the configuration process. If the configuration was loaded without errors and all tests passed, then this flag is set to True. Otherwise it is set to False. If the underlying PV can not be read, this function returns None.

Return type

bool or None

See also

set_defaults_pv()

Loads the default configuration.

get_configuring_in_progress()

Whether or not configuration process in progress.

get_timing_crc_err_cnt(**kwargs)[source]

Gets CRC error counter for received timing frames.

This counter increments every time a cyclical redundancy check (=CRC) fails for a received timing packet. The content of timing frames has a CRC on it which is a running sum for each packet. Data transmitted on the timing link includes a lot of idle characters - unlike the counters returned by get_timing_rx_dec_err_cnt() and get_timing_rx_dsp_err_cnt() which increment for any errors detected for any received timing data, the CRC is only performed on actual timing frames.

Common causes of timing system error counter increments include bad network connections between the external timing system and the SMuRF system) and providing the wrong frequency or amplitude 122.88 MHz clock reference signal to the timing system.

Timing data is transmitted and received at a total data rate of 2.45 Gbps (requiring 10G SFPs and compatible fiber links between the external timing system and the SMuRF system(s)), and timing frames are transmitted and received at 480 kHz. The protocol used for communcation between the external timing and SMuRF system(s) is a serial 8B/10B encoding using the K-character symbols for byte and frame alignment. The encoding/decoding and byte alignment is supporte by common Xilinx IP.

Warning

An increment in any of the timing system error counters (obtainable through get_timing_crc_err_cnt(), get_timing_rx_dec_err_cnt(), and get_timing_rx_dsp_err_cnt()) will cause a SMuRF timing firmware reset, resulting in a ~msec dropout of received timing data, including external triggers. The get_timing_rx_rst_cnt() returns the value of the counter that increments everytime there is a reset. In streamed data triggering on external timing, this will look like jumps in time without corresponding dropped frames.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

32-bit counter which increments every time the cyclical redundancy check fails for a received timing packet.

Return type

int

See also

get_timing_rx_dec_err_cnt()

Gets decode error counter for received timing characters.

get_timing_rx_dsp_err_cnt()

Gets disparity error counter for received timing characters.

get_timing_rx_rst_cnt()

Gets timing data link reset counter.

Return external timing link status.

Return the value of RxLinkUp. This tells you if the FPGA recovered clock is receiving timing from somewhere, either the backplane or fiber. This doesn’t directly tell you anything about the AMCs, JESDs, or LMKs.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

1 if link is up, 0 if link is down.

Return type

int

get_timing_rx_dec_err_cnt(**kwargs)[source]

Gets decode error counter for received timing characters.

This counter increments every time the SMuRF carrier firmware tries to decode a 10-bit timing word but fails, implying the data must have gotten corrupted after transmission by the timing system.

Common causes of timing system error counter increments include bad network connections between the external timing system and the SMuRF system) and providing the wrong frequency or amplitude 122.88 MHz clock reference signal to the timing system.

Timing data is transmitted and received at a total data rate of 2.45 Gbps (requiring 10G SFPs and compatible fiber links between the external timing system and the SMuRF system(s)), and timing frames are transmitted and received at 480 kHz. The protocol used for communcation between the external timing and SMuRF system(s) is a serial 8B/10B encoding using the K-character symbols for byte and frame alignment. The encoding/decoding and byte alignment is supporte by common Xilinx IP.

Warning

An increment in any of the timing system error counters (obtainable through get_timing_crc_err_cnt(), get_timing_rx_dec_err_cnt(), and get_timing_rx_dsp_err_cnt()) will cause a SMuRF timing firmware reset, resulting in a ~msec dropout of received timing data, including external triggers. The get_timing_rx_rst_cnt() returns the value of the counter that increments everytime there is a reset. In streamed data triggering on external timing, this will look like jumps in time without corresponding dropped frames.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

32-bit counter which increments every time the SMuRF carrier firmware fails to decode a 10-bit timing system word.

Return type

int

See also

get_timing_crc_err_cnt()

Gets CRC error counter for received timing frames.

get_timing_rx_dsp_err_cnt()

Gets disparity error counter for received timing characters.

get_timing_rx_rst_cnt()

Gets timing data link reset counter.

get_timing_rx_dsp_err_cnt(**kwargs)[source]

Gets disparity error counter for received timing characters.

When the timing system sends out a character it has the choice of two to send ; each valid character has a dedicated on/off bit. The timing system toggles this on/off bit every other character. The SMuRF carrier then keeps a running sum of how many on vs off bits it receives from the timing system. This disparity error counter increments every time the SMuRF carrier firmware detects too many “on” or “off” bits, registering that a timing character transmitted by the timing system must have gotten dropped.

Common causes of timing system error counter increments include bad network connections between the external timing system and the SMuRF system) and providing the wrong frequency or amplitude 122.88 MHz clock reference signal to the timing system.

Timing data is transmitted and received at a total data rate of 2.45 Gbps (requiring 10G SFPs and compatible fiber links between the external timing system and the SMuRF system(s)), and timing frames are transmitted and received at 480 kHz. The protocol used for communcation between the external timing and SMuRF system(s) is a serial 8B/10B encoding using the K-character symbols for byte and frame alignment. The encoding/decoding and byte alignment is supporte by common Xilinx IP.

Warning

An increment in any of the timing system error counters (obtainable through get_timing_crc_err_cnt(), get_timing_rx_dec_err_cnt(), and get_timing_rx_dsp_err_cnt()) will cause a SMuRF timing firmware reset, resulting in a ~msec dropout of received timing data, including external triggers. The get_timing_rx_rst_cnt() returns the value of the counter that increments everytime there is a reset. In streamed data triggering on external timing, this will look like jumps in time without corresponding dropped frames.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

32-bit counter which increments every time the SMuRF system detects a disparity error in the stream of decoded timing characters.

Return type

int

See also

get_timing_crc_err_cnt()

Gets CRC error counter for received timing frames.

get_timing_rx_dec_err_cnt()

Gets decode error counter for received timing characters.

get_timing_rx_rst_cnt()

Gets timing data link reset counter.

get_timing_rx_rst_cnt(**kwargs)[source]

Gets timing data link reset counter.

An increment in any of the timing system error counters (obtainable through get_timing_crc_err_cnt(), get_timing_rx_dec_err_cnt(), and get_timing_rx_dsp_err_cnt()) will cause a SMuRF timing firmware reset, resulting in a ~msec dropout of received timing data, including external triggers. This function returns the value of the counter that increments everytime there is a reset. In streamed data triggering on external timing, this will look like jumps in time without corresponding dropped frames.

Common causes of timing system error counter increments which trigger timing data link resets include bad network connections between the external timing system and the SMuRF system) and providing the wrong frequency or amplitude 122.88 MHz clock reference signal to the timing system.

Timing data is transmitted and received at a total data rate of 2.45 Gbps (requiring 10G SFPs and compatible fiber links between the external timing system and the SMuRF system(s)), and timing frames are transmitted and received at 480 kHz. The protocol used for communcation between the external timing and SMuRF system(s) is a serial 8B/10B encoding using the K-character symbols for byte and frame alignment. The encoding/decoding and byte alignment is supporte by common Xilinx IP.

Parameters

**kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

32-bit counter which increments every time there is a timing data link reset.

Return type

int

See also

get_timing_crc_err_cnt()

Gets CRC error counter for received timing frames.

get_timing_rx_dec_err_cnt()

Gets decode error counter for received timing characters.

get_timing_rx_dsp_err_cnt()

Gets disparity error counter for received timing characters.

get_tone_file_path(bay, **kwargs)[source]

Get tone file path.

Returns the tone file path that’s currently being used for this bay.

Parameters
  • bay (int) – Which AMC bay (0 or 1).

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

Full path to tone file.

Return type

str

get_tone_frequency_offset_mhz(band, **kwargs)[source]
get_tone_scale(band, **kwargs)[source]

Scales the sum of 16 tones before synthesizer.

get_trigger_daq(bay, **kwargs)[source]
get_trigger_delay(**kwargs)[source]

The flux ramp trigger offset. Only really useful if you’re using two carriers at once and you’re trying to synchronize them. Mitch thinks it’s in units of 122.88MHz ticks.

get_trigger_enable(chan, **kwargs)[source]

Get trigger pulse generation enable for requested channel.

The triggering firmware is broken into two parts: (1) the event selection logic “Channel”, and (2) the trigger pulse generation “Trigger”. This returns whether or not the “Trigger” component for the requested channel is enabled or disabled.

Parameters
  • chan (int) – Return the enable for this trigger pulse generator channel.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caget call.

Returns

1 if trigger for this channel is enabled, 0 if disabled.

Return type

int

See also

set_trigger_enable()

Set trigger pulse generation

enable

get_trigger_hw_arm(bay, **kwargs)[source]
get_trigger_reset_delay(band, **kwargs)[source]

Trigger reset delay, set such that the ramp resets at the flux ramp glitch. 2.4 MHz ticks.

Parameters

band (int) – Which band.

get_tune_file_path(**kwargs)[source]
get_ultrascale_ot_upper_threshold(**kwargs)[source]

Over-temperature (OT) upper threshold in degC for Ultrascale+ FPGA.

get_user_config0(as_binary=False, **kwargs)[source]
get_waveform_empty(bay, engine, **kwargs)[source]

No description

Parameters
  • bay (int) – Which bay.

  • engine (int) – Which waveform engine.

get_waveform_end_addr(bay, engine, convert=True, **kwargs)[source]

No description

Parameters
  • bay (int) – Which bay.

  • engine (int) – Which waveform engine.

  • convert (bool, optional, default True) – Convert the output from a string of hex values to an int.

Returns

val – Waveform end address (a string of hex values if convert is False, otherwise an integer if convert is True).

Return type

str or int

get_waveform_select(band, **kwargs)[source]

0x0 select DSP -> DAC 0x1 selects waveform table -> DAC (toneFile)

get_waveform_start(band, **kwargs)[source]

0x1 enables waveform table

get_waveform_start_addr(bay, engine, convert=True, **kwargs)[source]

No description

Parameters
  • bay (int) – Which bay.

  • engine (int) – Which waveform engine.

  • convert (bool, optional, default True) – Convert the output from a string of hex values to an int.

get_waveform_wr_addr(bay, engine, convert=True, **kwargs)[source]

No description

Parameters
  • bay (int) – Which bay.

  • engine (int) – Which waveform engine.

  • convert (bool, optional, default True) – Convert the output from a string of hex values to an int.

Returns

val – Waveform end address (a string of hex values if convert is False, otherwise an integer if convert is True).

Return type

str or int

load_tone_file(bay, val=None, **kwargs)[source]

Loads tone file specified in tone_file_path.

Parameters
  • bay (int) – Which AMC bay (0 or 1).

  • val (str or None, optional, default None) – Path (including csv file name) to tone file. If none provided, assumes something valid has already been loaded into DacSigGen[#]:CsvFilePath

open_data_file(**kwargs)[source]

Open the data file.

reset_rtm(**kwargs)[source]

Resets the rear transition module (RTM)

run_parallel_eta_scan(band, sync_group=True, **kwargs)[source]

runParallelScan

run_pwr_up_sys_ref(bay, **kwargs)[source]
run_serial_eta_scan(band, sync_group=True, timeout=240, **kwargs)[source]

Does an eta scan serially across the entire band. You must already be tuned close to the resontor dip. Use run_serial_gradient_descent to get it.

Parameters
  • band (int) – The band to eta scan.

  • sync_group (bool, optional, default True) – Whether to use the sync group to monitor the PV.

  • timeout (float, optional, default 240) – The maximum amount of time to wait for the PV.

run_serial_gradient_descent(band, sync_group=True, timeout=240, **kwargs)[source]

Does a gradient descent search for the minimum.

Parameters
  • band (int) – The band to run serial gradient descent on.

  • sync_group (bool, optional, default True) – Whether to use the sync group to monitor the PV.

  • timeout (float, optional, default 240) – The maximum amount of time to wait for the PV.

Does a brute force search for the resonator minima. Starts at the currently set frequency.

Parameters
  • band (int) – The band the min search.

  • sync_group (bool, optional, default True) – Whether to use the sync group to monitor the PV.

  • timeout (float, optional, default 240) – The maximum amount of time to wait for the PV.

save_config(val, **kwargs)[source]

Writes the current (un-masked) PyRogue settings to a yml file.

Parameters

val (str) – The path (including file name) to write the yml file to.

save_state(val, **kwargs)[source]

Dumps all PyRogue state variables to a yml file.

Parameters

val (str) – The path (including file name) to write the yml file to.

sel_ext_ref(bay, **kwargs)[source]

Selects this bay to trigger off of external reference (through front panel)

Parameters

bay (int) – Which bay to set to ext ref. Either 0 or 1.

set_amp_defaults()[source]

The pysmurf cfg file specifies the default power state, default gate voltage for the C02 amplifiers HEMT and 50K. Additionally it specifies the default drain voltage for the C04 hemt1, 50k1, hemt2, 50k2. Read these values, then set them according to if the card is connected or not. See smurf_config.py. This assumes the gate and drain DAC are enabled, and the drain power supplies are disabled. Always set the gate voltage, and always zero the drain DAC voltage, which implies the drain voltage going out the cryocard is zero, and the drain current is zero. Also, send enable, 0x2, to all gate voltages and drain voltages, otherwise they cannot be controlled, even if the current register reports that they are supposedly enabled, 0x2.

set_amp_drain_enable(amp, enable)[source]

Enable the drain power supply. If C04, set_amp_drain_voltage sets this automatically. It is very important that this is on only when you want voltage going out the drain. See bug ESCRYODET-851. There are two drain outputs on the C02, and four drain outputs on the C04.

set_amp_drain_voltage(amp, volt, override=False)[source]

C04 only. Set the drain voltage going out of the given amplifier circuit, either 50k1, 50k2, hemt1, hemt2. The HEMT drain voltage range is different from the 50K voltage range, set the range limits in the SMuRF .cfg file. If given 0 volts, turn turn off the power supply entirely to avoid bug ESCRYODET-851. We cannot set the drain voltage directly, instead we can only set the RTM DAC voltage directly which approximately sets the drain voltage..

set_amp_gate_voltage(amp, voltage, override=False, **kwargs)[source]

Set the voltage out one of the RTM DACs, into the cryocard, such that the voltage out the cryocard is the given voltage. To do this, use the conversion factors “gate_bit_to_volt”. The gate conversion is computed analytically.

The DACs do not respond unless their DAC enable register is 0x2, enabled. The DACs still output voltage even if their enable register is 0xe, disabled.

amp: str

Use ‘50k’ and ‘hemt’ for the C02 amps, and ‘50k1’, ‘50k2’, ‘hemt1’ and ‘hemt2’ for the C04 amps.

voltage: float

The desired voltage going out the cryocard amp.

set_amplitude_scale_array(band, val, **kwargs)[source]
set_amplitude_scale_array_currentchans(band, tone_power, **kwargs)[source]

Set only the currently on channels to a new drive power. Essentially a more convenient wrapper for set_amplitude_scale_array to only change the channels that are on.

Parameters
  • band (int) – The band to change.

  • tone_power (int) – Tone power to change to.

set_amplitude_scale_channel(band, channel, val, **kwargs)[source]
set_amplitude_scales(band, val, **kwargs)[source]
set_analysis_scale(band, val, **kwargs)[source]
set_arm_hw_trigger(bay, val, **kwargs)[source]
set_att_dc(b, val, **kwargs)[source]

Set the down-converter attenuator

Parameters
  • b (int) – The band number.

  • val (int) – The attenuator value

set_att_uc(b, val, **kwargs)[source]

Set the upconverter attenuator

Parameters
  • b (int) – The band number.

  • val (int) – The attenuator value.

set_band_center_mhz(band, val, **kwargs)[source]
set_band_delay_us(band, val, **kwargs)[source]

Set band delay compensation, microseconds. Corrects for total system delay (cable, DSP, etc.). Internally configures both ref_phase_delay and ref_phase_delay_fine

set_center_frequency_array(band, val, **kwargs)[source]

Sets all the center frequencies in a band

set_center_frequency_mhz_channel(band, channel, val, **kwargs)[source]
set_cfg_reg_ena_bit(val, **kwargs)[source]
set_channel_mask(mask, **kwargs)[source]

Set the smurf processor channel mask.

Parameters

mask (list) – The channel mask.

set_check_jesd(max_timeout_sec=60.0, caget_timeout_sec=5.0, **kwargs)[source]

Runs JESD health check and returns status.

Toggles the pysmurf core code SmurfApplication:CheckJesd register, which triggers a call to the AppTop.JesdHealth method. The command will check if the Rogue ZIP file’s AppTop device contains the JesdHealth method, call it if it exists, and return the result.

The SmurfApplication:CheckJesd and SmurfApplication:JesdStatus (see get_jesd_status()) registers are only present in pysmurf core code versions >=4.1.0 ; returns None if pysmurf core code version is <4.1.0. The AppTop.JesdHealth method is only present in Rogue ZIP file versions >=0.3.0 ; also returns None if the AppTop.JesdHealth method is not present in the Rogue ZIP file.

Parameters
  • max_timeout_sec (float, optional, default 60.0) – Seconds to wait for JESD health check to complete before giving up.

  • caget_timeout_sec (float, optional, default 5.0) – Seconds to wait for each poll of the JESD health check status register (see get_jesd_status()).

  • **kwargs – Arbitrary keyword arguments. Passed directly to all _caget calls.

Returns

status – Returns JESD health status (see get_jesd_status() for a description of the possible statuses). Returns None for pysmurf core code versions < 4.1.0 and Rogue ZIP file versions that do not have the AppTop.JesdHealth method.

Return type

str or None

See also

get_jesd_status()

Gets the status of the Rogue AppTop.JesdHealth method.

set_cpld_reset(val, **kwargs)[source]

No description

Parameters

val (int) – Set to 1 for a cpld reset.

set_crossbar_output_config(index, val, **kwargs)[source]
set_cryo_card_delatch_bit(bit, write_log=False, enable_poll=False, disable_poll=False)[source]

Delatches the cryo card for a bit.

Parameters

bit (int) – The bit to temporarily delatch.

set_cryo_card_ps_en(enable=3, write_log=False)[source]

Write the cryo card power supply enables. Can use this to set both power supplies at once rather than setting them individually

Parameters

enables (int, optional, default 3) –

2-bit number with status of the power supplies enables Bit 0 for HEMT supply Bit 1 for 50K supply Bit == 1 means enabled Bit == 0 means disabled

therefore: 0 = all off 1 = 50K on, HEMT off 2 = HEMT on, 50K off 3 = both on

Default (enable=3) turns on both power supplies.

set_cryo_card_relay_bit(bitPosition, oneOrZero)[source]

Sets a single cryo card relay to the value provided

Parameters
  • bitPosition (int) – Which bit to set. Must be in [0-16].

  • oneOrZero (int) – What value to set the bit to. Must be either 0 or 1.

set_cryo_card_relays(relay, write_log=False, enable_poll=False, disable_poll=False)[source]

Sets the cryo card relays

Parameters

relays (hex) – The cryo card relays

set_dac_axil_addr(reg, val, **kwargs)[source]

Sets the DacAxilAddr[#] registers.

set_dac_enable(bay, dac, val, **kwargs)[source]

Enables DAC

Parameters
  • bay (int) – Which bay [0 or 1].

  • dac (int) – Which DAC no. [0 or 1].

  • val (int) – Value to set the DAC enable register to [0 or 1].

set_dac_reset(bay, dac, val, **kwargs)[source]

Toggles the physical reset line to DAC. Set to 1 then 0

Parameters
  • bay (int) – Which bay [0 or 1].

  • dac (int) – Which DAC no. [0 or 1].

set_data_buffer_size(bay, val, **kwargs)[source]

Sets the data buffer size for the DAQx

set_data_file_name(name, **kwargs)[source]

Set the data file name.

Parameters

str – The file name.

set_data_out_mux(bay, b, val, **kwargs)[source]
set_dbg_enable(bay, val, **kwargs)[source]

Enables/disables write access to DBG registers.

Parameters
  • bay (int) – Which bay [0 or 1].

  • val (bool) – True for enable, False for disable.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caput call.

set_debounce_width(val, **kwargs)[source]
set_debug_select(bay, val, **kwargs)[source]
set_decimation(band, val, **kwargs)[source]
set_defaults_pv(wait_after_sec=30.0, max_timeout_sec=400.0, caget_timeout_sec=10.0, **kwargs)[source]

Loads the default configuration.

Calls the rogue setDefaults command, which loads the default software and hardware configuration.

If using pysmurf core code versions >=4.1.0 (as reported by get_pysmurf_version()), returns True if the setDefaults command was successfully executed on the rogue side, or failed. Returns None for older versions.

Parameters
  • wait_after_sec (float or None, optional, default 30.0) – If not None, the number of seconds to wait after triggering the rogue setDefaults command.

  • max_timeout_sec (float, optional, default 400.0) – Seconds to wait for system to configure before giving up. Only used for pysmurf core code versions >= 4.1.0.

  • caget_timeout_sec (float, optional, default 10.0) – Seconds to wait for each poll of the configuration process status registers (see get_configuring_in_progress() and get_system_configured()). Only used for pysmurf core code versions >= 4.1.0.

  • **kwargs – Arbitrary keyword arguments. Passed directly to all _caget calls.

Returns

success – Returns True if the system was successfully configured, otherwise returns False. Configuration checking is only implemented for pysmurf core code versions >= 4.1.0. If configuration validation is not available, returns None.

Return type

bool or None

See also

get_configuring_in_progress()

Whether or not configuration process in progress.

get_system_configured()

Returns final state of configuration process.

set_downsample_external_bitmask(bitmask)[source]

Set the downsampler external bitmask.

Ref. https://confluence.slac.stanford.edu/display/SMuRF/SMuRF+Processor

set_downsample_factor(factor, get_nearby=False, desperation=2, **kwargs)[source]

Set the smurf processor down-sampling factor.

Parameters
  • int – The down-sampling factor.

  • get_nearby (bool) – If True, will try to find a bitmask close to the specified downsample factor if the given factor cannot be expressed

  • desperation (int) – Desparation factor used when finding nearby ds-factors. This limits how far the ds-factor can be from the one requested

set_downsample_mode(mode)[source]

Set the downsampler mode. 0 is internal, 1 is external.

Ref. SmurfHeader.h, SmurfHeader.cpp, _SmurfProcessor.py Ref. https://confluence.slac.stanford.edu/display/SMuRF/SMuRF+Processor

set_dsp_enable(band, val, **kwargs)[source]
set_enable_ramp_trigger(val, **kwargs)[source]
set_eta_mag_array(band, val, **kwargs)[source]
set_eta_mag_scaled_channel(band, channel, val, **kwargs)[source]
set_eta_phase_array(band, val, **kwargs)[source]
set_eta_phase_degree_channel(band, channel, val, **kwargs)[source]
set_eta_scan_amplitude(band, val, **kwargs)[source]

Sets the amplitude of the eta scan.

Parameters
  • band (int) – The band to set.

  • val (int) – The eta scan amplitude. Typical value is 9 to 11.

set_eta_scan_averages(band, val, **kwargs)[source]

Sets the number of frequency error averages to take at each point of the etaScan.

Parameters
  • band (int) – The band to set.

  • val (int) – The channel to set.

set_eta_scan_channel(band, val, **kwargs)[source]

Sets the channel to eta scan.

Parameters
  • band (int) – The band to set.

  • val (int) – The channel to set.

set_eta_scan_del_f(band, val, **kwargs)[source]

Sets offset frequency for serial eta scan estimation.

The rogue serial eta scan routine (run using run_serial_eta_scan()) estimates the eta parameter for each tone with nonzero amplitude in the provided band by sampling the frequency error at the tone frequency +/- this offset frequency. Units are Hz.

Parameters
  • band (int) – Which band.

  • val (int) – Offset frequency in Hz about each resonator’s central frequency at which to sample the frequency error in order to estimate the eta parameters of each resonator in the rogue serial eta scan routine.

See also

run_serial_eta_scan()

Runs rogue serial eta scan, which uses this parameter.

get_eta_scan_del_f()

Gets the current value of this parameter in rogue.

set_eta_scan_dwell(band, val, **kwargs)[source]

Swets how long to dwell while eta scanning.

Parameters
  • band (int) – The band to eta scan.

  • val (int) – The time to dwell.

set_eta_scan_freq(band, val, **kwargs)[source]

Sets the frequency to do the eta scan

Parameters
  • band (int) – The band to count.

  • val (int) – The frequency to scan.

set_evr_channel_reg_enable(chan, val, **kwargs)[source]

Set trigger channel enable.

The triggering firmware is broken into two parts: (1) the event selection logic “Channel”, and (2) the trigger pulse generation “Trigger”. Trigger pulse generation has several required inputs including which “Channel” to listen to. Setting this “Enable” register turns on the event selection logic for the requested channel.

Parameters
  • chan (int) – Which trigger event selection logic channel to enable or disable.

  • val (int) – 1 to enable, 0 to disable.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caput call.

See also

get_evr_channel_reg_enable()

Get trigger channel enable.

set_evr_trigger_channel_reg_dest_sel(chan, val, **kwargs)[source]
set_evr_trigger_dest_type(chan, value, **kwargs)[source]

Set trigger channel destination type.

The triggering firmware is broken into two parts: (1) the event selection logic “Channel”, and (2) the trigger pulse generation “Trigger”. Trigger pulse generation has several required inputs including which “Channel” to listen to. The channel destination type, or DestType, is an optional logic selection (logical AND of) on the presence of a beam where this logic is also used for LCLS-2 on the accelerator. For SMuRF we always use destination 0 (=”All” if you’re looking at the SMuRF Rogue gui) which tells the trigger channel logic to ignore all beam logic (a better name for “All” would be “DontCare”.

Parameters
  • chan (int) – Which trigger event selection logic channel’s destination type to set.

  • val (int) – Destination type to set. Although valid options are 0, 1, 2 or 3, for SMuRF we always use 0 corresponding to “All” in the Rogue gui which instructs the channel to ignore any selection on the presence of beam.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caput call.

See also

get_evr_trigger_dest_type()

Get trigger channel destination type.

set_evr_trigger_reg_enable(chan, val, **kwargs)[source]
set_fast_slow_rst_value(val, **kwargs)[source]
set_fast_slow_step_size(val, **kwargs)[source]
set_feedback_enable(band, val, **kwargs)[source]
set_feedback_enable_array(band, val, **kwargs)[source]
set_feedback_enable_channel(band, channel, val, **kwargs)[source]

Set the feedback for a single channel

set_feedback_end(band, val, **kwargs)[source]

The flux ramp DAC value at which to stop applying feedback in each flux ramp cycle. In 2.4 MHz ticks.

Parameters

band (int) – Which band.

set_feedback_gain(band, val, **kwargs)[source]
set_feedback_limit(band, val, **kwargs)[source]

freq = centerFreq + feedbackFreq abs(freq) < centerFreq + feedbackLimit

set_feedback_polarity(band, val, **kwargs)[source]
set_feedback_start(band, val, **kwargs)[source]

The flux ramp DAC value at which to start applying feedback in each flux ramp cycle. In 2.4 MHz ticks.

Parameters

band (int) – Which band.

set_filter_a(coef, **kwargs)[source]

Set the smurf processor filter A coefficients.

Parameters

coef (list) – The filter A coefficients.

set_filter_alpha(band, val, **kwargs)[source]

Coefficient for single pole low pass fitler before readout (when channels are multiplexed, decimated) y[n] = alpha*x[n] + (1 - alpha)*y[n-1] matlab to visualize h = fvtool([alpha], [1 -(1-alpha)]); h.Fs = 2.4e6;

set_filter_b(coef, **kwargs)[source]

Set the smurf processor filter B coefficients.

Parameters

coef (list) – The filter B coefficients.

set_filter_disable(disable_status, **kwargs)[source]

If Disable is set to True, then the filter is off. Incoming data to SmurfProcessor.cpp may still be downsampled, however, filtering would not be applied.

Parameters

bool – The status of the Disable bit.

set_filter_gain(gain, **kwargs)[source]

Set the smurf processor filter gain.

Parameters

float – The filter gain.

set_filter_order(order, **kwargs)[source]

Set the smurf processor filter order.

Parameters

int – The filter order.

set_filter_reset(**kwargs)[source]

Resets the downsample filter

set_flux_ramp_dac(val, **kwargs)[source]
set_flux_ramp_freq(val, **kwargs)[source]

Sets flux ramp reset rate in kHz.

Sets the flux ramp reset rate. In units of kHz. Wrapper function for set_ramp_max_cnt().

The flux ramp reset rate is specified by setting the trigger repetition rate (the RampMaxCnt register in RtmCryoDet). RampMaxCnt is a 32-bit counter where each count represents a 307.2 MHz tick.

Parameters
  • val (float) – The frequency to set the flux ramp reset rate to in kHz.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caput call.

Note

Because RampMaxCnt is specified in 307.2 MHz ticks, the flux ramp rate must be an integer divisor of 307.2 MHz. For example, for this reason it is not possible to set the flux ramp rate to exactly 7 kHz. set_flux_ramp_freq() rounds the RampMaxCnt computed for the desired flux ramp reset rate to the nearest integer using the built-in round routine, and if the computed RampMaxCnt differs from the rounded value, reports the flux ramp reset rate that will actually be programmed.

Warning

If RampMaxCnt is set too low, then it will invert and produce a train of pulses 1x or 2x 307.2 MHz ticks wide, but it will be mostly high.

See also

get_flux_ramp_freq

Gets the flux ramp reset rate.

set_ramp_max_cnt

Sets the flux ramp trigger repetition rate.

set_frequency_error_array(band, val, **kwargs)[source]
set_gradient_descent_averages(band, val, **kwargs)[source]
set_gradient_descent_beta(band, val, **kwargs)[source]
set_gradient_descent_converge_hz(band, val, **kwargs)[source]
set_gradient_descent_gain(band, val, **kwargs)[source]
set_gradient_descent_max_iters(band, val, **kwargs)[source]
set_gradient_descent_momentum(band, val, **kwargs)[source]

Sets the momentum term of the gradient descent

set_gradient_descent_step_hz(band, val, **kwargs)[source]

Sets the step size of the gradient descent in units of Hz

set_high_cycle(val, **kwargs)[source]

CPLD’s clock: high cycle duration (zero inclusive). Along with LowCycle, sets the frequency of the clock going to the RTM.

set_input_mux_sel(bay, lane, val, **kwargs)[source]
set_iq_stream_enable(band, val, **kwargs)[source]
set_iq_swap_in(band, val, **kwargs)[source]

Swaps I&Q into DSP (from ADC). Tones being output by the system will flip about the band center (e.g. 4.25GHz, 5.25GHz etc.)

set_iq_swap_out(band, val, **kwargs)[source]

Swaps I&Q out of DSP (to DAC). Swapping I&Q flips spectrum around band center.

Disables jesd link

set_jesd_reset_n(bay, dac, val, **kwargs)[source]

Set DAC JesdRstN

Parameters
  • bay (int) – Which bay [0 or 1].

  • dac (int) – Which DAC no. [0 or 1].

  • val (int) – Value to set JesdRstN to [0 or 1].

set_k_relay(val, **kwargs)[source]
set_lmk_enable(bay, val, **kwargs)[source]

Enable the AMC LMK in bay 0. On boot, the LMK is enabled, however once the DACS are reset on SmurfControl.setup the LMK is disabled. If you need to modify LMK values, this value must be 1.

Parameters
  • bay (int) – 0 ot 1.

  • val (int) – 0 or 1.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the epics.caput call.

set_lmk_reg(bay, reg, val, **kwargs)[source]

Can call like this get_lmk_reg(bay=0,reg=0x147,val=0xA) to see only hex as in gui.

set_lms_delay(band, val, **kwargs)[source]

Match system latency for LMS feedback (2.4MHz ticks)

set_lms_dly_fine(band, val, **kwargs)[source]

fine delay control (38.4MHz ticks)

set_lms_enable1(band, val, **kwargs)[source]

Enable 1st harmonic tracking

set_lms_enable2(band, val, **kwargs)[source]

Enable 2nd harmonic tracking

set_lms_enable3(band, val, **kwargs)[source]

Enable 3rd harmonic tracking

set_lms_freq(band, val, **kwargs)[source]

LMS frequency = flux ramp freq * nPhi0

set_lms_freq_hz(band, val, **kwargs)[source]

LMS frequency = flux ramp freq * nPhi0

set_lms_gain(band, val, **kwargs)[source]

LMS gain, powers of 2

set_lms_rst_dly(band, val, **kwargs)[source]

Disable feedback after reset (2.4MHz ticks)

set_load_tune_file(band, val, **kwargs)[source]
set_low_cycle(val, **kwargs)[source]

CPLD’s clock: low cycle duration (zero inclusive). Along with HighCycle, sets the frequency of the clock going to the RTM.

set_max_file_size(size, **kwargs)[source]

Set maximum file size for streamed data.

If nonzero, when streaming data to disk, will split data over files of this size, in bytes. Files have the usual name but with an incrementing integer appended at the end, e.g. .dat.1, .dat.2, etc..

Parameters

size (int) – Number of bytes to limit the size of each file streamed to disk to before rolling over into a new file. If zero, no limit.

See also

get_max_file_size()

Get maximum file size for streamed data.

set_mcetransmit_debug(val, **kwargs)[source]

Sets the mcetransmit debug bit. If 1, the debugger will print to the pyrogue screen.

Parameters

val (int) – 0 or 1 for the debug bit.

set_mode_control(val, **kwargs)[source]
set_noise_select(band, val, **kwargs)[source]
set_payload_size(payload_size, **kwargs)[source]

The payload size defines the number of available channels to write to disk/stream. Payload size must be larger than the number of channels going into the channel mapper

Parameters

int – The number of channels written to disk. This is independent of the number of active channels.

set_postdata_emulator_amplitude(val, **kwargs)[source]
set_postdata_emulator_enable(val, **kwargs)[source]
set_postdata_emulator_offset(val, **kwargs)[source]
set_postdata_emulator_period(val, **kwargs)[source]

Expressed as the number of incoming frames. It must be greater that 2. This period will be expressed in terms of the downsampler periods. Note that this is different from the predata emulator.

Parameters

val (int) – Number of frames that make up a period.

set_postdata_emulator_type(val, **kwargs)[source]

No description

Parameters

val (str) – The data type. Choices are - Zeros, ChannelNumber, Random, Square, Sawtooth, Triangle, Sine, and DropFrame

set_predata_emulator_amplitude(val, **kwargs)[source]
set_predata_emulator_disable(val, **kwargs)[source]

Sets the predata emulator disable status.

Parameters

val (bool) –

set_predata_emulator_enable(val, **kwargs)[source]

Turns on and off the predata emulator.

set_predata_emulator_offset(val, **kwargs)[source]
set_predata_emulator_period(val, **kwargs)[source]

Expressed as the number of incoming frames. It must be greater that 2. This period will be expressed in term of the period of the received frames, which in turn is related to the flux ramp period.

Parameters

val (int) – Number of frames that make up a period.

set_predata_emulator_type(val, **kwargs)[source]

No description

Parameters

val (str) – The data type. Choices are - Zeros, ChannelNumber, Random, Square, Sawtooth, Triangle, Sine, and DropFrame

set_pulse_width(val, **kwargs)[source]

Select Ramp to the CPLD 0x1 = Fast flux Ramp 0x0 = Slow flux ramp

set_ramp_max_cnt(val, **kwargs)[source]

Internal Ramp’s maximum count. Sets the trigger repetition rate. This is effectively the flux ramp frequency.

RampMaxCnt = 307199 means flux ramp is 1kHz (307.2e6/(RampMaxCnt+1))

set_ramp_rate(val, **kwargs)[source]

flux ramp sawtooth reset rate in kHz

If using timing system, the allowed rates are: 1, 2, 3, 4, 5, 6, 8, 10, 12, 15kHz (hardcoded by timing)

set_ramp_slope(val, **kwargs)[source]
set_ramp_start_mode(val, **kwargs)[source]

Select Ramp to the CPLD 0x2 = trigger from external system 0x1 = trigger from timing system 0x0 = trigger from internal system

set_read_all(**kwargs)[source]

ReadAll sends a command to read all register to the pyrogue server Registers must updated in order to PVs to update. This call is necessary to read register with pollIntervale=0.

set_readout_channel_select(band, channel, **kwargs)[source]
set_ref_phase_delay(band, val, **kwargs)[source]

Deprecated. Use set_band_delay_us instead.

set_ref_phase_delay_fine(band, val, **kwargs)[source]

Deprecated. Use set_band_delay_us instead.

set_remap(**kwargs)[source]

This command should probably be renamed to something more descriptive.

set_rf_enable(band, val, **kwargs)[source]

0x0 output all 0s to DAC 0x1 enable output to DAC (from DSP or waveform table)

set_rf_iq_stream_enable(band, val, **kwargs)[source]

Sets the bit that turns on RF IQ streaming for take_debug_data

Parameters
  • band (int) – The 500 Mhz band

  • val (int or bool) – Whether to set the mode to RF IQ.

set_rtm_arb_waveform_continuous(val, **kwargs)[source]

If =1, RTM arbitrary waveform generation is continuous and repeats, otherwise if =0, waveform in LUT tables is only broadcast once on software trigger.

Parameters

val (int) – Whether or not arbitrary waveform generation is continuous on software trigger. Must be in [0,1].

set_rtm_arb_waveform_enable(val, **kwargs)[source]

Sets the enable for generation of arbitrary waveforms on the RTM slow DACs.

Parameters

val (int) – The value to set enable to. EnableCh = 0x0 is disable, 0x1 is Addr[0], 0x2 is Addr[1], and 0x3 is Addr[0] and Addr[1]

set_rtm_arb_waveform_lut_table(reg, arr, pad=0, **kwargs)[source]

Loads provided array into the LUT table indexed by reg. If array is empty, loads zeros into table. If array exceeds maximum length of 2048 entries, array is truncated. If array is less than 2048 entries, the table is padded on the end with the value in the pad argument.

Parameters
  • reg (int) – LUT table index in [0,1].

  • arr (int array) – Array of values to load into LUT table. Each entry must be an integer and in [0,2^20).

  • pad (int, optional, default 0) – Value to pad end of array with if provided array’s length is less than 2048. Default is 0.

set_rtm_arb_waveform_max_addr(val, **kwargs)[source]

Slow RTM DACs will play the sequence [0…MaxAddr] of points out of the loaded LUT tables before stopping or repeating on software trigger (if in continuous mode). MaxAddr is an 11-bit number (must be in [0,2048), because that’s the maximum length of the LUT tables that store the waveforms.

Parameters

val (int) – The value to set MaxAddr to. Must be an integer in [0,2048).

set_rtm_arb_waveform_timer_size(val, **kwargs)[source]

Arbitrary waveforms are written to the slow RTM DACs with time between samples TimerSize*6.4ns.

Parameters

val (int) – The value to set TimerSize to. Must be an integer in [0,2**24).

set_rtm_slow_dac_data(dac, val, **kwargs)[source]

Sets the data register for the requested DAC, which sets the output voltage of the DAC.

Parameters
  • dac (int) – Which DAC to command. 1-indexed. If a DAC index outside of the valid range is provided (must be within [1,32]), will assert.

  • val (int) – The DAC voltage to set in DAC units. Must be in [-2^19,2^19). If requested value is less (greater) than -2^19 (2^19-1), sets DAC to -2^19 (2^19-1).

set_rtm_slow_dac_data_array(val, **kwargs)[source]

Sets the data registers for all 32 DACs, which sets their output voltages. Must provide all 32 values.

Parameters

val (int array) – The DAC voltages to set in DAC units. Each element of the array must Must be in [-2^19,2^19). If a requested value is less (greater) than -2^19 (2^19-1), sets that DAC to -2^19 (2^19-1). (32,) in DAC units. If provided array is not 32 elements long, asserts.

set_rtm_slow_dac_enable(dac, val=2, **kwargs)[source]

Set DacCtrlReg for this DAC, which configures the AD5790 analog output for the requested DAC number. Set to 0x2 to enable for normal operation, which only needs to be done once for each DAC in a boot session.

Parameters
  • dac (int) – Which DAC to command. 1-indexed. If a DAC index outside of the valid range is provided (must be within [1,32]), will assert.

  • val (int) – Value to set the DAC enable to. enabled is 0x2, disabled is 0xE. Power on default is 0xE.

set_rtm_slow_dac_enable_array(val, **kwargs)[source]

Sets DacCtrlReg for all of the DACs at once. DacCtrlReg configures the AD5790 analog outputs. Setting to 0x2 enables normal operation, and only needs to be done once for each DAC in a boot session. Writing the values as an array should be much faster than writing them to each DAC individually using the set_rtm_slow_dac_enable function (single versus multiple transactions).

Parameters

val (int array) – Length 32, addresses the DACs in DAC ordering. If provided array is not length 32, asserts. Power on default is 0xE, enabled is 0x2, disable is 0xE.

set_rtm_slow_dac_volt(dac, val, **kwargs)[source]

Sets the output voltage for the requested DAC.

Parameters
  • dac (int) – Which DAC to command. 1-indexed. If a DAC index outside of the valid range is provided (must be within [1,32]), will assert.

  • val (int) – The DAC voltage to set in volts.

set_rtm_slow_dac_volt_array(val, **kwargs)[source]

Sets the output voltage for all 32 DACs at once. Writing the values as an array should be much faster than writing them to each DAC individually using the set_rtm_slow_dac_volt function (single versus multiple transactions).

Parameters

val (float array) – TES biases to set for each DAC in Volts. Expects an array of size (32,). If provided array is not 32 elements, asserts.

set_run_eta_scan(band, val, **kwargs)[source]

Runs the eta scan. Set the channel using set_eta_scan_channel()

Parameters
  • band (int) – The band to eta scan.

  • val (bool) – Start the eta scan.

set_run_serial_find_freq(band, val, sync_group=True, **kwargs)[source]

Runs the eta scan. Set the channel using set_eta_scan_channel()

Parameters
  • band (int) – The band to eta scan.

  • val (bool) – Start the eta scan.

set_select_ramp(val, **kwargs)[source]

Select Ramp to the CPLD 0x1 = Fast flux Ramp 0x0 = Slow flux ramp

set_single_channel_readout(band, val, **kwargs)[source]

Sets the singleChannelReadout bit.

Parameters

band (int) – The band to set to single channel readout.

set_single_channel_readout_opt2(band, val, **kwargs)[source]

Sets the singleChannelReadout2 bit.

Parameters

band (int) – The band to set to single channel readout.

set_stream_data_source_enable(val, **kwargs)[source]

Sets the data stream enable bit. Must be set to True to stream data.

set_stream_data_source_period(val, **kwargs)[source]

Sets the data source period.

set_stream_enable(val, **kwargs)[source]

Enable/disable streaming data, for all bands.

set_streamdatawriter_close(val, **kwargs)[source]
set_streamdatawriter_datafile(datafile_path, **kwargs)[source]

Sets the output path for the StreamDataWriter. This is what is used for take_debug_data.

Parameters

datafile_path (str) – The full path for the output.

set_streamdatawriter_open(val, **kwargs)[source]
set_streaming_datafile(datafile, as_string=True, **kwargs)[source]

Sets the datafile to write streaming data

Parameters
  • datafile (str or length 300 int array) – The name of the datafile.

  • as_string (bool, optional, default True) – The input data is a string. If False, the input data must be a length 300 character int.

set_streaming_file_open(val, **kwargs)[source]

Sets the streaming file open. 1 for streaming on. 0 for streaming off.

Parameters

val (int) – The streaming status.

set_synthesis_scale(band, val, **kwargs)[source]
set_tone_file_path(bay, val, **kwargs)[source]

Sets the tone file path for this bay.

Parameters
  • bay (int) – Which AMC bay (0 or 1).

  • val (str) – Path (including csv file name) to tone file.

set_tone_frequency_offset_mhz(band, val, **kwargs)[source]
set_tone_scale(band, val, **kwargs)[source]

Scales the sum of 16 tones before synthesizer.

set_trigger_daq(bay, val, **kwargs)[source]
set_trigger_delay(val, **kwargs)[source]

Adds an offset to flux ramp trigger. Only really useful if you’re using two carriers at once and you’re trying to synchronize them. Mitch thinks it’s in units of 122.88MHz ticks.

set_trigger_enable(chan, val, **kwargs)[source]

Set trigger pulse generation enable for requested channel.

The triggering firmware is broken into two parts: (1) the event selection logic “Channel”, and (2) the trigger pulse generation “Trigger”. This enables or disables the “Trigger” component for the requested channel.

Parameters
  • chan (int) – Which trigger pulse generator channel to enable or disable.

  • val (int) – 1 to enable, 0 to disable.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the _caput call.

See also

get_trigger_enable()

Get trigger pulse generation

enable

set_trigger_hw_arm(bay, val, **kwargs)[source]
set_trigger_reset_delay(band, val, **kwargs)[source]

Trigger reset delay, set such that the ramp resets at the flux ramp glitch. 2.4 MHz ticks.

Parameters

band (int) – Which band.

set_trigger_width(chan, val, **kwargs)[source]

Mystery value that seems to make the timing system work

set_tune_file_path(val, **kwargs)[source]
set_ultrascale_ot_upper_threshold(val, **kwargs)[source]

Over-temperature (OT) upper threshold in degC for Ultrascale+ FPGA.

set_unwrapper_reset(**kwargs)[source]

Resets the unwrap filter. There is no get function because it is an executed command.

set_user_config0(val, as_binary=False, **kwargs)[source]
set_waveform_empty(bay, engine, val, **kwargs)[source]

No description

Parameters
  • bay (int) – Which bay.

  • engine (int) – Which waveform engine.

  • val (int) – What val to set.

set_waveform_end_addr(bay, engine, val, convert=True, **kwargs)[source]

No description

Parameters
  • bay (int) – Which bay.

  • engine (int) – Which waveform engine.

  • val (int) – What val to set.

  • convert (bool, optional, default True) – Convert the output from a string of hex values to an int.

set_waveform_select(band, val, **kwargs)[source]

0x0 select DSP -> DAC 0x1 selects waveform table -> DAC (toneFile)

set_waveform_start(band, val, **kwargs)[source]

0x1 enables waveform table

set_waveform_start_addr(bay, engine, val, convert=True, **kwargs)[source]

No description

Parameters
  • bay (int) – Which bay.

  • engine (int) – Which waveform engine.

  • val (int or str) – What value to set.

  • convert (bool, optional, default True) – Convert the input from an integer to a string of hex values before setting.

set_waveform_wr_addr(bay, engine, val, convert=True, **kwargs)[source]

No description

Parameters
  • bay (int) – Which bay.

  • engine (int) – Which waveform engine.

  • val (int) – What val to set.

  • convert (bool, optional, default True) – Convert the output from a string of hex values to an int.

shell_command(cmd, **kwargs)[source]

Runs command on shell and returns code, stdout, & stderr.

Parameters
  • cmd (str) – Command to run on shell.

  • **kwargs – Arbitrary keyword arguments. Passed directly to the subprocess.run call.

Returns

stdout and stderr returned as str

Return type

(stdout, stderr)

trigger_rtm_arb_waveform(continuous=False, **kwargs)[source]

Software trigger for arbitrary waveform generation on the slow RTM DACs. This will cause the RTM to play the LUT tables only once.

Parameters

continuous (bool, optional, default False) – Whether or not to continously broadcast the arbitrary waveform on software trigger.

write_config(val, **kwargs)[source]

Writes the current (un-masked) PyRogue settings to a yml file.

Parameters

val (str) – The path (including file name) to write the yml file to.

write_state(val, **kwargs)[source]

Dumps all PyRogue state variables to a yml file.

Parameters

val (str) – The path (including file name) to write the yml file to.

sync_group