Configurations reference

A number of configuration options are available as attributes of a scan model. These attributes are used to configure the data that is generated by the model. Configurations are available to set when and how datasets are created, configure all aspects of the fit performed by the model including validations of the fitted parameters, and to control the formatting of plots. All of the available attributes that can be used for configuration are listed below.

Additionally, certain features can be disabled/enabled entirely. All available attributes for disabling/enabling features are also listed below.

Note

All attributes listed below can be set dynamically inside a scan experiment on an instance of a ScanModel. This can be useful when use of static attributes or defining attributes as a property via @property do not provide enough flexibility for a particular scan.

Datset configurations

ScanModel.namespace = ''

Dataset key under which all datasets are created

ScanModel.mirror_namespace = 'current_scan'

Dataset key under which all datasets are mirrored – datasets under this key are plotted by the current scan applet

ScanModel.broadcast = False

If True all datasets besides the main fit dataset are broadcast when created

ScanModel.persist = False

If True all datasets besides the main fit dataset are persisted

ScanModel.save = True

If True all datasets besides the main fit dataset are save to the hdf5 file

ScanModel.mirror = True

If False datasets will not be mirrored to the mirror_namespace

Fitting configurations

ScanModel.fit_map = {}

Dictionary of fit param names to dataset name mappings. Fit params are renamed according to this mapping before the fit is saved to the datasets. Keys specify to a fit param name and the corresponding value in the dictionary specifies the dataset name.

ScanModel.fit_function = None

Specifies the fit function that will be used during fitting

ScanModel.fit_use_yerr = True

If set to True a weighted fit will be performed using the calculated error in the measurued value at each scan point (by default this is the standard error of the mean value at each scan point)

ScanModel.guess = {}

Dictionary containing initial guesses for the fit params. Keys specify fit params and the corresponding value gives the numerical guess.

ScanModel.man_bounds = {}

Dictionary containing manual bounds for each fit param. Keys specify fit params and the corresponding value is a list specifying the bounds – see scan_framework.analysis.curvefits.Fit for more details.

ScanModel.man_scale = {}

Dictionary containing manual scales for each fit param. Keys specify fit params and the corresponding value is a float specifying the scale – see scan_framework.analysis.curvefits.Fit for more details.

ScanModel.hold = None

Dictionary containing held values for each fit param. Keys specify fit params and the corresponding value is a float specifying the held fit param value – see scan_framework.analysis.curvefits.Fit for more details, defaults to None

ScanModel.main_fit = None

Dataset name for the main fit param – this name is automatically prefixed by self.namespace to give the full dataset name.

ScanModel.fits_to_save = {}

Any fit param specified in this dictionary will broadcast, persisted, and saved to the datasets. The format of this dictionary is the same as fit_map, with keys specifying fit param names and values specifiying the corresponding dataset name.

Fit validation configurations

ScanModel.validators = None

Dictionary containing definitions all soft fit validations

ScanModel.strong_validators = None

Dictionary containing validation rules of all strong fit validations that will be performed.

ScanModel.pre_validators = None

Dictionary containing validation rules of all all pre-fit validations validations that will be performed

Plotting configurations

ScanModel.x_label = ''

Label of the x-axis for the current scan plot.

ScanModel.y_label = ''

Label of the y-axis for the current scan plot.

ScanModel.x_scale = 1

Scale of the x-axis for the current scan plot.

ScanModel.y_scale = 1

Scale of the y-axis for the current scan plot.

ScanModel.x_units = ''

Unit of the x-axis for the current scan plot.

ScanModel.y_units = ''

Unit of the y-axis for the current scan plot.

ScanModel.plot_title = ''

Title of the current scan plot.

Enabling/disabling features

ScanModel.enable_histograms = True

If True, histogram data is generated for plotting by the current scan histogram applet – this applet displays a histogram of the data collected at each scan point

ScanModel.aggregate_histogram = True

If True, histogram data is generated for plotting by the current scan aggregate histogram applet – this applet displays a histogram of all data collected, aggregated over all scan points

ScanModel.disable_validations = False

If True, no fit validatons will be performed, fits will always be performed and no fit param values will be validated, defaults to False