Full API documentation for scans

scans.scan module

class scan_framework.scans.scan.FitGuess(fit_param=None, param_index=None, use_default=True, use=True, i_result=None, *args, **kwargs)[source]
__init__(fit_param=None, param_index=None, use_default=True, use=True, i_result=None, *args, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'scan_framework.scans.scan'
exception scan_framework.scans.scan.Paused[source]

Exception raised on the core device when a scan should either pause and yield to a higher priority experiment or should terminate.

__module__ = 'scan_framework.scans.scan'
__weakref__

list of weak references to the object (if defined)

class scan_framework.scans.scan.Scan(managers_or_parent, *args, **kwargs)[source]

Base class for all scans. Provides a generalized framework for executing a scan. Provides dataset initialization, mutating, fitting, validation of data, pausing/resuming, and plotting of scan data.

Scan Callbacks

Various callbacks are provided that execute at certain moments of a scan’s life cycle. Using callbacks allows code in child classes to execute at predefined stages of the scan. The following callback methods are available, listed in order of execution. (see the ‘Scan Callbacks’ section for additional information)

__get_x_offset()
__init__(managers_or_parent, *args, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

__load_x_offset()
__module__ = 'scan_framework.scans.scan'
_after_scan()[source]

Internal callback called after the scan and any higher priority experiments have completed. - always runs on the host - runs before data is fit - this callback will not be called before yielding to higher priority experiment - this callback will not be called if scan is terminated

_after_scan_point(i_point, point, mean)[source]
Scan extension callback executed during the scan loop after a scan point has completed.
  • executes on the core device

  • executes after all data has been collected, datasets have been mutated, calculations have been performed, and data has been analyzed.

Parameters
  • i_point – point index (integer for 1D scans, a list of two inetegers for 2D scans)

  • point – the scan point (float for 1D scans, a list of two integers for 2D scans)

  • mean – the mean number of counts collected at the scan point over all measurements.

_analyze()[source]

Interface method (optional, has default behavior)

If this method is not overridden, fits will be performed automatically on the mean values calculated for each measurement of the scan.

Calls before_analyze(), checks to see if fits should be performed, and performs a fit using each model that has been registered as performing a fit (i.e. fit=True when calling register_model()). After fits have been performed, after_fit() and report_fit() are called.

_analyze_data(i_point, last_pass, last_point)[source]
_analyzed = False
_attach_models()[source]

Attach a single model to the scan

_attach_to_model(model, i)[source]

Attach the scan to a single model. Allows passing scan variables to the model at runtime

_attach_to_models()[source]

Attach the scan to all models

_before_loop(resume)[source]

Extension callback

Called before the scan loop begins.
  • called after initialize_devices()

  • runs on the host or the core device

_calculate(i_point, point, calculation, entry)[source]

Perform calculations on collected data after each scan point

_calculate_all(i_point, point)[source]
_fit_guesses = {}
_get_fit_guess(fit_function)[source]

Maps GUI arguments to fit guesses.

_hide_arguments = {}
_init_model_datasets(shape, plot_shape, points, x, y, init_local, write_datasets)[source]

Set the contents and handling modes of all datasets in the scan.

_init_simulations()[source]
_init_storage()[source]

initialize memory to record counts on core device

_initialize(resume)[source]

Initialize the scan

_load_points()[source]
_logger_name = None
_loop(resume=False)[source]

Main loop: performs measurement at each scan point and mutates datasets with measured values

_map_arguments()[source]
_mutate_plot(entry, i_point, data, mean)[source]
_name = None
_offset_points(x_offset)[source]
_paused

scan is currently paused

_point_loop(points, warmup_points, i_points, npoints, nwarmup_points, ncalcs, poffset, nrepeats, nmeasurements, measurements, last_pass=False)[source]
_profile(start=False, stop=False)[source]
_repeat_loop(point, i_point, nrepeats, nmeasurements, measurements, poffset, ncalcs, last_point=False, last_pass=False)[source]
_report()[source]
_rewind(num_points)[source]

Rewind the cursor from the current pass and point indices by the specified number of points. The cursor can be rewound into a previous pass. The cursor cannot be rewound past the first point of the first pass.

Parameters

num_points – The current cursor will be moved to this number of scan points before its current value.

_run_scan_core(resume=False)[source]

Helper Method:

Executes the scan on the core device. Calls lab_before_scan_core(), then _loop(), followed by after_scan_core() and lab_after_scan_core()

Parameters

resume – Set to True if the scan is being resumed after being paused and to False if the scan is being started for the first time.

_run_scan_host(resume=False)[source]

Helper Method:

Executes the scan entirely on the host device. The measure() method of the scan must not have the @kernel decorator if this method is called or if self.run_on_core == False Calls _loop()

Parameters

resume – Set to True if the scan is being resumed after being paused and to False if the scan is being started for the first time.

_scan_arguments()[source]
_set_counts(counts)[source]

Interface method (optional)

Runs after a scan point completes. By default, this method sets the counts dataset to the value passed in on the counts parameter of this method. It therefore also updates the count monitor dataset with the average value measured at the current scan point while the scan is running.

Parameters

counts – Average value of all values returned from measure() during the current scan point.

Notes
  • Does not run if self.enable_count_monitor == False

_terminated

scan has been terminated

_timeit(event)[source]
_write_datasets(entry)[source]
_yield()[source]

Interface method (optional)

Yield to scheduled experiments with higher priority

after_analyze()[source]

User callback

Runs on the host after the scan and any higher priority experiments have completed and after analysis (e.g. fitting) has been completed.

Notes
  • always runs on the host

  • runs after data is fit

  • runs regardless of if the fit was successful

  • this callback will not be called before yielding to higher priority experiment

  • this callback will not be called if scan is terminated

after_fit(fit_name, valid, saved, model)[source]

User callback

Runs on the host after each registered fit model (i.e. all models registered with self.register_model(..., fit='<fit name'>) has performed it’s fit.

Notes
  • model.fit is used in this callback to access the Fit object containing the fitted parameters and other useful information about the fit.

  • Always runs on the host.

  • Will not run if fit’s are not performed for any reason

Parameters
  • fit_name – The name of the fit passed in on the fit argument of register_model()

  • valid – False if any fit validation errors were raised during fitting.

  • saved – True if the main_fit fit parameter was saved to the model’s top level namespace. (a.k.a fits were saved)

  • model (ScanModel) – Instance of the registered fit model.

after_measure(point, measurement)[source]

User callback

Runs at each repetition of a scan point immediately after the measure() method is called.

Notes
  • Runs on the host or the core device.

after_scan()[source]

User callback

Runs on the host after the scan and any higher priority experiments have completed.

Notes
  • Always runs on the host.

  • Runs before data is fit.

  • This callback will not be called before yielding to higher priority experiment.

  • This callback will not be called if scan is terminated.

after_scan_core()[source]

User callback

Runs on the core device after the scan and any higher priority experiments have completed.

Notes
  • Always runs on the core device.

  • Runs before data is fit.

  • This callback will not be called before yielding to higher priority experiment.

  • This callback will not be called if the scan is terminated.

after_scan_point(i_point, point)[source]

User callback

Runs during the scan loop after a scan point has completed.

Notes
  • Run on host or core device.

  • Run after all data has been collected, datasets have been mutated, and 2 have run for a scan point.

  • Runs after the before_calculate() callback.

analyze()[source]

Interface method (optional)

Returns

before_analyze()[source]

User callback

Runs on the host before deciding if fits should be performed.

Notes
  • Always runs on the host.

  • Will run even if fits have been disabled or performing a fit has not been selected in the GUI.

before_calculate(i_point, point, calculation)[source]

User callback

Runs during the scan loop after all data has been collected for a scan point but before calculations are performed. Must return True for calculations to be performed.

Notes
  • Always runs on the host.

  • Calculations will always run if this callback is not implemented.

  • Return False to skip calculations for the current scan point.

  • Return True to allow calculations to execute for the current scan point.

  • Runs before the after_scan_point() callback

Parameters
  • i_point – Index of the current scan point.

  • point – Value of the current scan point.

  • calculation – Name of the calculation to perform.

Returns

True: The calculation will be performed. False: The calculation will not be performed.

Return type

Boolean

before_fit(model)[source]

User callback

Runs on the host before a fit is performed by a registered fit model.

Notes
  • Always runs on the host.

  • Will not run if fitting has been disable or has not been selected in the GUI.

Parameters

model (ScanModel) – Instance of the registered fit model.

Returns

False to prevent the fit from being performed.

before_measure(point, measurement)[source]

User callback

Runs at each repetition of a scan point immediately before the measure() method is called.

Notes
  • Runs on the host or the core device.

before_pass(i_pass)[source]

User callback

Runs during the scan loop at the start of each pass.

Notes
  • Does not run when the scan is resumed from being paused unless no scan points have yet executed.

  • Runs on the host or the core device.

before_scan()[source]

User callback

Run during initialization before datsets are initialized.

Notes
  • always runs on the host

  • called after the ‘prepare_scan’ callback

build(**kwargs)[source]

Interface method (optional, has default behavior)

Creates the scheduler and core devices and sets them to the attributes self.scheduler and self.core respectively.

Parameters

kwargs – Optional dictionary of class attributes when using the scan as a sub-component (i.e. the scan does not inherit from EnvExperiment). Each entry will be set as an attribute of the scan.

calculate_dim0(dim1_model)[source]

User callback (runs on host).

Returns a value and its error from the dimension 1 sub-scan. The returned value will be plotted as the y-value in the dimension 0 plot and the returned error will weight the final fit along dimension 0.

Parameters

model (ScanModel) – The model which just performed a fit along the dimension 1 sub-scan. model.fit points to the Fit object from the analysis package.

Returns

The calculated value and the error in the calculated value.

Return type

A two entry tuple where the first entry is the calculated value and the second entry is the error in the calculated value.

cleanup()[source]

User callback

This callback is meant to perform cleanup on the core device after a scan completes. For example, resetting DDS frequencies or DAC values that have changed during the scan back to their appropriate default values. Called after the scan has completed and before data is fit.

Notes
  • Runs on host or core device.

  • Called before the after_scan() and the after_scan_core() callbacks.

  • Always called before yielding to higher priority experiment.

  • This callback will still execute if an exception is thrown during the scan loop.

counts_perc = -1

Set to a value >= 0 to round the ‘/counts’ dataset to the specified number of digits.

create_logger()[source]

Interface method (optional, has default behavior)

Sets self.logger to an instance of a python logging.logger for writing log messages to the log window in the dashboard.

do_fit

Fits are performed after the scan completes. Set automatically by scan framework from the ‘Fit Options’ argument

do_measure(point)[source]

Provides a way for subclasses to override the method signature of the measure method.

enable_auto_tracking = True

Auto center the scan range around the last fitted value.

enable_count_monitor = True

Update the ‘/counts’ dataset with the average of all values returned by ‘measure()’ during a single scan point.

enable_fitting = True

Set to True to perform fits at the end of the scan and show scan arguments needed for fitting.

enable_mutate = True

Mutate mean values and standard errors datasets after each scan point. Used to monitor progress of scan while it is running.

enable_pausing = True

Check pause via self.scheduler.check_pause() and automatically yield/terminate the scan when needed.

enable_profiling = False

Profile the execution of the scan to find bottlenecks.

enable_reporting = True

Print useful information to the Log window before a scan starts (i.e. number of passes, etc.) and when a fit is performed (fitted values, etc.)

enable_timing = False

Enable automatic timing of certain events. Currently only compilation time is timed.

fit_only

Scan is not run and fits are performed on data from the previous scan. Set automatically by scan framework from the ‘Fit Options’ argument

get_scan_points()[source]

Interface method (required - except when inheriting from TimeFreqScan, TimeScan, or FreqScan)

Returns the set of scan points that will be iterated over during the scan. See the _point_loop() method

Returns

The list of scan points to scan over.

Return type

A Python list or an ARTIQ Scannable type.

get_warmup_points()[source]

Interface method (optional, has default behavior)

Returns the set of warm-up points that will be iterated before scanning over the scan points.

Returns

The list of warm-up points.

Return type

A Python list or an ARTIQ Scannable type.

initialize_devices()[source]

User callback

Typically used to initialize devices on the core device before the scan loop begins. Runs after datasets have been initialized but before the scan loop begins.

Notes
  • runs anytime _run_scan_core() or _run_scan_host() is called

  • runs on the host or the core device

  • called after the ‘before_scan’ callback

kernel_invariants = {'do_fit', 'fit_only', 'nbins', 'nmeasurements', 'npasses', 'npoints', 'nrepeats', 'save_fit'}
lab_after_analyze()[source]

User callback

Runs on the host after the scan and any higher priority experiments have completed and after analysis (e.g. fitting) has been completed.

Meant to be implemented in a base class from which all of a lab’s scans inherit.

Notes
  • always runs on the host

  • runs after data is fit

  • runs regardless of if the fit was successful

  • this callback will not be called before yielding to higher priority experiment

  • this callback will not be called if scan is terminated

lab_after_measure(point, measurement)[source]

User callback

Runs at each repetition of a scan point immediately after the measure() method is called.

Meant to be implemented in a base class from which all of a lab’s scans inherit.

Notes
  • Runs on the host or the core device.

lab_after_scan()[source]

User callback

Runs on the host after the scan has completed, fits have been performed, and any higher priority experiments have completed.

Meant to be implemented in a base class from which all of a lab’s scans inherit.

Notes
  • Always runs on the host.

  • Runs after data is fit.

  • This callback will not be called before yielding to higher priority experiment.

  • This callback will not be called if scan is terminated.

lab_after_scan_core()[source]

User callback

Runs on the core device after the scan and any higher priority experiments have completed.

Meant to be implemented in a base class from which all of a lab’s scans inherit.

Notes
  • Always runs on the core device.

  • Runs before data is fit.

  • This callback will not be called before yielding to higher priority experiment.

  • This callback will not be called if the scan is terminated.

lab_before_measure(point, measurement)[source]

User callback

Runs at each repetition of a scan point immediately before the measure() method is called.

Meant to be implemented in a base class from which all of a lab’s scans inherit.

Notes
  • Runs on the host or the core device.

lab_before_scan_core()[source]

User callback

Runs on the core device after datasets have been initialized but before the scan loop begins.

Meant to be implemented in a base class from which all of a lab’s scans inherit.

lab_prepare_scan()[source]

User callback

Runs on the host during initialization after the scan points and warmup points have been loaded but before datasets have been initialized.

Meant to be implemented in a base class from which all of a lab’s scans inherit.

Notes
  • Runs after the prepare_scan() callback.

  • Will be re-run when a scan is resumed after being paused.

  • Always runs on the host.

Returns

None

map_arguments()[source]

Map coarse grained attributes to fine grained options.

measure(point)[source]

Interface method (required)

Performs a single measurement and returns the result of the measurement as an integer.

Parameters

point – Current scan point value

Returns

The result of a single measurement

Return type

Integer

measurement

the current measurement

measurements

List of measurements performed on each scan point

mutate_datasets(i_point, measurement, point, data)[source]

Interface method (optional, has default behavior)

If this method is not overridden, all data collected for the specified measurement during the current scan point is passed to any model that has been registered for the given measurement. The mutate_datasets() and _mutate_plot() methods of these models will be called with data passed as an argument. Thus, the registered models will calculate means and standard errors and plot these statistics to the current scan applet for the current scan point.

Typically, the default implementation of this method is used, though it can be overridden in user scans to manually perform statistic calculation and plotting of measurement data at the end of each scan point.

Notes
  • Always runs on the host device.

Parameters
  • i_point – Index of the current scan point.

  • measurement – Name of the current measurement (For multiple measurements).

  • point – Value of the current scan point.

  • data – List of integers containing the values returned by measure() at each repetition of the current scan point.

nwarmup_points = 0

Number of warm-up points

offset_point(i_point, point)[source]

User callback

Allows scan points to be dynamically modified in a scan. The value returned by this method is used as the current scan point. Runs before measurements are repeated at the current scan point.

Parameters
  • i_point – Index of the current scan point.

  • point – Value of the scan point that will be executed next.

Returns

Possibly modified value of the scan point that will be executed next.

Return type

Same datatype as a single scan point

prepare_scan()[source]

User callback

Runs during initialization after the scan points and warmup points have been loaded but before datasets have been initialized.

Notes
  • Will be re-run when a scan is resumed after being paused.

  • Always runs on the host.

register_model(model_instance, measurement=None, fit=None, calculation=None, init_datasets=True, **kwargs)[source]

Register a model with the scan. Models can be registered as a measurement model, fit model, calculation model, or combinations of these.

When registered as a measurement model, all data collected for the specified measurement is passed to the specified model instance’s mutate_datasets() method via an RPC after it has been collected.

When registered as a fit model, fitting will be performed by the specified model instance after the scan completes. The model instance’s fit_data(), validate_fit(), set_fits(), and save_main_fit() methods will be called.

When registered as a calculation model, the specified model instance’s mutate_datasets_calc() method will be called at the end of each scan point.

Parameters
  • model_instance (scan_framework.models.scan_model.ScanModel) – Instance of the scan model being registered

  • measurement (string or bool) – The name of the measurement for which the model will calculate and save statistics. When only a single measurement is performed by the scan, this can simply be set to True. If not set to a string or to True, statistics will not be generated or saved. If set to a string or True, the registered model’s mutate_datasets() method will be called via an RPC after each scan point completes. The default behavior of this method is to calculate the mean value measured at the scan point, calculate the standard error of this mean, and to mutate the datasets storing these values under the model’s namespace. Additionally, this updates the current scan applet to plot the new mean and error after each scan point completes. The mutate_datasets() method also mutates the ‘counts’ dataset, which stores every value measured and returned by the scan’s ‘measure()’ method, and optionally mutates histogram datasets so that the histogram applets/plots are updated after each scan point completes. Defaults to None

  • fit (string or bool) – The name of the measurement for which the model will perform fits. When only a single measurement is performed by the scan, this can simply be set to True. If not set to a string or to True, fitting will not be performed by the model. If set to a string or True, the registered model’s fit_data() method will be called after the scan completes to perform a fit using the mean values and standard errors stored under the model’s namespace. Typically, a model tthat is registered with the fit argument set is also registered with the measurement set, though this is not strictly necessary if the means and errors have been generated by some other means by the user. Defaults to None

  • calculation (string or bool) – Name of a calculation that this model will perform at each scan point. When set to a string or to True, the model’s mutate_datasets_calc() method is called after each scan point with the calculation name passes in on the calculation argument. The mutate_datasets_calc() method, in turn calls the model’s calculate() method which performs the calculation and returns the calculated value along with its error. The calculated value and its error is then set to the datasets along with the value of the current scan point under the namespace of the registered model. Defaults to None

  • init_datasets (bool) – If True, all datasets relevant to the scan are initialized under the model’s namespace by calling the model’s init_datasets() method, defaults to True

  • validate (bool) – If True, all validation rules defined in the model will be applied to the data to be fit and/or the fit params found by this model during fitting. If False, no validations will be perforemd by the model.

  • set (bool) – If True, all relevant data for a fit will be saved to the datasets by calling the model’s set_fits() method. The set_fits() method is only called if fits have been performed by the model.

  • save – If True, the fit param specified by the model’s ‘main_fit’ attribute will be saved to the datasets when the fitted params pass all strong validation rules defined in the model. If no strong validation rules are defined, the main fit param is always saved as long as the fit was performed. If validations are disabled, the main fit param is always saved.

report(location='both')[source]

Interface method (optional, has default behavior)

Logs details about the scan to the log window. Runs during initialization after the scan points and warmup points have been loaded but before datasets have been initialized.

report_fit(model)[source]

User callback (has default behavior)

If this method is not implemented model.report_fit() will be called, which prints useful information about the fit (i.e. the fitted parameter values) to the Log window in the dashboard.

Runs on the host after each registered fit model (i.e. all models registered with self.register_model(..., fit='<fit name'>) has performed it’s fit.

Notes
  • Always runs on the host.

  • Will not run if fits are not performed for any reason.

Parameters

model (ScanModel) – Instance of the registered fit model.

reset_model_states()[source]
run(resume=False)[source]

Helper method

Initializes the scan, executes the scan, yields to higher priority experiments, and performs fits on completion on the scan.

run_on_core = True

Set to False to run scans entirely on the host and not on the core device.

save_fit

Fitted params are saved to datasets. Set automatically by scan framework from the ‘Fit Options’ argument

scan_arguments(npasses={}, nrepeats={}, nbins={}, fit_options={}, guesses=False)[source]
set_scan_point(i_point, point)[source]

User callback

Callback to set device parameter values (e.g. DDS frequencies) at the start of a scan point before the measure() method is repeated self.nrepeats times at the current scan point. Runs during the scan loop at the start of each scan point.

Notes
  • Runs on the host or the core device.

  • Runs before the ‘before_measure’ callback.

setattr_argument(key, processor=None, group=None, show='auto')[source]

Sets an argument as attribute. The names of the argument and of the attribute are the same.

The key is added to the instance’s kernel invariants.

simulate_measure(point, measurement)[source]
warming_up = False

Used in the measure method to determine when warmup points are being run by the framework.

warmup(point)[source]

Interface method (optional)

Contains experimental code to execute at each warmup point. If this method is not implemented, each warmup point will execute the measure method.

Parameters

point – Current warmup point value

class scan_framework.scans.scan.Scan1D(managers_or_parent, *args, **kwargs)[source]

Extension of the Scan class for 1D scans. All 1D scans should inherit from this class.

__init__(managers_or_parent, *args, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'scan_framework.scans.scan'
_fit(entry, save, use_mirror, dimension, i)[source]

Perform the fit

_load_points()[source]
_mutate_plot(entry, i_point, point, mean)[source]
_offset_points(x_offset)[source]
_write_datasets(entry)[source]
class scan_framework.scans.scan.Scan2D(managers_or_parent, *args, **kwargs)[source]

Extension of the Scan class for 2D scans. All 2D scans should inherit from this class.

__init__(managers_or_parent, *args, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'scan_framework.scans.scan'
_fit(entry, save, use_mirror, dimension, i)[source]

Performs fits on dimension 0 and dimension 1

_load_points()[source]
_mutate_plot(entry, i_point, point, mean)[source]

Mutates datasets for dimension 0 plots and dimension 1 plots

_offset_points(offset)[source]
_write_datasets(entry)[source]
hold_plot = False
scan_framework.scans.scan.delay_mu(duration)[source]

scans.extensions module

class scan_framework.scans.extensions.FreqScan(managers_or_parent, *args, **kwargs)[source]

Scan class for scanning over frequency values.

__module__ = 'scan_framework.scans.extensions'
_freq_center_manual = None
get_scan_points()[source]

Interface method (required - except when inheriting from TimeFreqScan, TimeScan, or FreqScan)

Returns the set of scan points that will be iterated over during the scan. See the _point_loop() method

Returns

The list of scan points to scan over.

Return type

A Python list or an ARTIQ Scannable type.

scan_arguments(frequencies={}, npasses={}, nrepeats={}, nbins={}, fit_options={}, guesses=False)[source]
class scan_framework.scans.extensions.ReloadingScan(managers_or_parent, *args, **kwargs)[source]

Allows detection of lost ion, pausing scan, reloading ion, and resuming scan

__module__ = 'scan_framework.scans.extensions'
_analyze_data(i_point, last_pass, last_point)[source]
_before_loop(resume)[source]

Extension callback

Called before the scan loop begins.
  • called after initialize_devices()

  • runs on the host or the core device

_check_ion(i_point, force_detection_check=False)[source]

Return true if ion is present

_check_ion_data(i_measurement, i_point)[source]

Return true if data collected indicates that the ion is still present

_check_ion_experiment(repeats=1)[source]

Return true if the loading.ion_present experiment indicates that the ion is still present

_initialize(resume)[source]

Initialize the scan

_lost_ion = False

ion has been lost

_map_arguments()[source]

Map coarse grained attributes to fine grained options.

_measure_ion_threshold()[source]

Measure dark rate and set self._ion_threshold to a percentage of the measured rate

_report(location='both')[source]

Print details about the scan

_reset_state(resume)[source]
_scan_arguments()[source]
_schedule_load_ion()[source]
_state_string()[source]
check_for_ion = False
enable_reloading = True

Reload ion when it is lost?

ion_failures = 0
ion_second_threshold = 2.0
ion_threshold = 0.6

default value is always overwritten when background is measured

ion_windows = 2

Number of lost ion signals seen in data before a detection check is performed

loading_pi_threshold = 5
loading_repeats = 100
loading_threshold = 1.0
loading_timeout = 120.0
loading_windows = 2
lose_ion_at = -1
measure_background = True
perc_of_dark = 90

Percentage of dark rate at which background rate is set.

perc_of_dark_second = 150

Percentage of dark rate at which ion present detection threshold is set.

class scan_framework.scans.extensions.TimeFreqScan(managers_or_parent, *args, **kwargs)[source]

Allows a scan experiment to scan over either a set of time values or a set of frequency values.

__bind_models()
__load_frequency_center()
__module__ = 'scan_framework.scans.extensions'
_attach_models()[source]

Attach a single model to the scan

_get_main_fits(model)[source]

Get’s the last fitted frequency and time values

do_measure(point)[source]

Provides a way for subclasses to override the method signature of the measure method.

enable_auto_tracking = True

Auto center the scan range around the last fitted value.

frequency_center = None
get_scan_points()[source]

Interface method (required - except when inheriting from TimeFreqScan, TimeScan, or FreqScan)

Returns the set of scan points that will be iterated over during the scan. See the _point_loop() method

Returns

The list of scan points to scan over.

Return type

A Python list or an ARTIQ Scannable type.

pulse_time = None
report(location='both')[source]

Interface method (optional, has default behavior)

Logs details about the scan to the log window. Runs during initialization after the scan points and warmup points have been loaded but before datasets have been initialized.

scan_arguments(times={}, frequencies={}, frequency_center={}, pulse_time={}, npasses={}, nrepeats={}, nbins={}, fit_options={}, guesses=False)[source]
class scan_framework.scans.extensions.TimeScan(managers_or_parent, *args, **kwargs)[source]

Scan class for scanning over time values.

__module__ = 'scan_framework.scans.extensions'
get_scan_points()[source]

Interface method (required - except when inheriting from TimeFreqScan, TimeScan, or FreqScan)

Returns the set of scan points that will be iterated over during the scan. See the _point_loop() method

Returns

The list of scan points to scan over.

Return type

A Python list or an ARTIQ Scannable type.

scan_arguments(times={}, npasses={}, nrepeats={}, nbins={}, fit_options={}, guesses=False)[source]

scans.loading_interface module

class scan_framework.scans.loading_interface.LoadingInterface(managers_or_parent, *args, **kwargs)[source]
__module__ = 'scan_framework.scans.loading_interface'
build()[source]

Should be implemented by the user to request arguments.

Other initialization steps such as requesting devices may also be performed here.

There are two situations where the requested devices are replaced by DummyDevice() and arguments are set to their defaults (or None) instead: when the repository is scanned to build the list of available experiments and when the dataset browser artiq_browser is used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments in build().

Datasets are read-only in this method.

Leftover positional and keyword arguments from the constructor are forwarded to this method. This is intended for experiments that are only meant to be executed programmatically (not from the GUI).

can_load()[source]
ion_present(repeats, threshold)[source]

Returns true if an ion is present in the trap.

measure_dark_rate()[source]
schedule_load_ion(due_date)[source]
wait()[source]

Scan Architecture

To determine detailed information such as if and when a callback is executed and the major components of a scan and when they are executed, please refer to the scan architecture documented by the flowchart below.

../_images/scan_class_flowchart.svg