mjolnir.helpers#
This module defines some helper functions.
Functions
|
Calculate the time for a linear ramp with an analogue RC filter to settle at thresh. |
|
Computes the rise time of a single-stage RC filter. |
|
Convert a CamelCase name to snake_case. |
|
Return the root source of a parameter. |
|
Recursively find all parameters on instrument except params_to_exclude, those of class param_classes_to_exclude, or those whose physical instrument is in underlying_instruments_to_exclude, up to a nesting level of max_nesting_level. |
Find all parameters in instrument and submodules at most nesting_level deep. |
|
|
Load the station specified in filename, which should be a file living in mjolnir/config. |
|
Modify the dc_constant_V parameter of a QDAC-II channel to block until the voltage has settled at thresh of its designated value. |
|
Revert |
|
Compute the mean and standard error on the mean. |
|
Side effect for bob_filter_RC parameter of QDAC-II channels. |
|
Extract run_id from the database and save to hdf5. |
|
Set up logging (only for calibration module currently). |
|
Start a monitor on parameters of instruments on station. |
|
Adds timing to func and reports it to stdout. |
|
Give QDAC2 channels more meaningful labels. |
- mjolnir.helpers.calculate_ramp_time_with_filter(slew_rate, voltage_swing, RC, thresh)[source]#
Calculate the time for a linear ramp with an analogue RC filter to settle at thresh.
The settling time can be obtained by inverse Laplace-transform of the transfer function
\[C(s) = \frac{1}{s\tau + 1}\times\frac{k}{s^2}\]where \(\tau=RC\) and \(k\) is the slope of the ramp.
- mjolnir.helpers.calculate_rise_time(RC, thresh=0.9)[source]#
Computes the rise time of a single-stage RC filter.
- mjolnir.helpers.find_param_source(param)[source]#
Return the root source of a parameter.
- Parameters:
param (ParameterBase)
- Return type:
- mjolnir.helpers.find_parameters(instrument, *params_to_exclude, instruments_to_exclude=(), underlying_instruments_to_exclude=(), param_classes_to_exclude=(), only_gettable=False, max_nesting_level=0)[source]#
Recursively find all parameters on instrument except params_to_exclude, those of class param_classes_to_exclude, or those whose physical instrument is in underlying_instruments_to_exclude, up to a nesting level of max_nesting_level.
- Parameters:
instrument (MetadatableWithName)
params_to_exclude (Parameter)
instruments_to_exclude (Sequence[InstrumentBase])
underlying_instruments_to_exclude (Sequence[InstrumentBase])
param_classes_to_exclude (tuple[type[Parameter], ...] | type[Parameter])
only_gettable (bool)
max_nesting_level (int)
- Return type:
- mjolnir.helpers.find_parameters_with_nesting_level_below(instrument, nesting_level)[source]#
Find all parameters in instrument and submodules at most nesting_level deep.
- Parameters:
instrument (InstrumentBase)
nesting_level (int)
- Return type:
- mjolnir.helpers.load_station(filename, use_monitor=False, update_snapshot=False)[source]#
Load the station specified in filename, which should be a file living in mjolnir/config.
- mjolnir.helpers.make_dc_constant_V_blocking(channel, thresh=0.99)[source]#
Modify the dc_constant_V parameter of a QDAC-II channel to block until the voltage has settled at thresh of its designated value.
- Parameters:
channel (QDac2Channel)
thresh (float)
- mjolnir.helpers.make_dc_constant_V_nonblocking(channel)[source]#
Revert
make_dc_constant_V_blocking().- Parameters:
channel (QDac2Channel)
- mjolnir.helpers.mean_and_standard_error(data, axis=0, alpha=0.05)[source]#
Compute the mean and standard error on the mean.
References
https://en.wikipedia.org/wiki/Student%27s_t-distribution#Confidence_intervals
- mjolnir.helpers.rise_time_dependent_post_delay(self, _, val, channel, thresh)[source]#
Side effect for bob_filter_RC parameter of QDAC-II channels.
Waits at least as long as a step impulse takes to settle at thresh.
Use together with
py:functools.partial().Todo
Unused as of now.
- Parameters:
_ (float)
val (float)
channel (QDac2Channel)
thresh (float)
- Return type:
None
- mjolnir.helpers.save_to_hdf5(run_id, savepath, *params_to_skip, method='dataset', compress=False)[source]#
Extract run_id from the database and save to hdf5.
- Parameters:
- mjolnir.helpers.setup_logging(levels)[source]#
Set up logging (only for calibration module currently).
Since qcodes controls the root logger, we need to make sure loggers are independent of it.
- mjolnir.helpers.start_monitor(station, *params_to_exclude, instruments_to_exclude=(), underlying_instruments_to_exclude=(), param_classes_to_exclude=(), max_nesting_level=0, update=False, url='localhost', port=3000, show=False, **monitor_kwargs)[source]#
Start a monitor on parameters of instruments on station.
- Parameters:
station (Station) – The qcodes station hosting the instruments.
*params_to_exclude (ParameterBase) – Parameters to exclude from the monitor.
underlying_instruments_to_exclude (Sequence[InstrumentBase]) – Exclude parameters bound to these underlying instruments.
instruments_to_exclude (Sequence[InstrumentBase]) – Exclude parameters bound to these instruments.
param_classes_to_exclude (tuple[type[Parameter], ...] | type[Parameter]) – Exclude parameters of these types.
max_nesting_level (int) – Include parameters of up to this many children.
update (bool) – Update parameter values.
url (str) – The url of the server.
port (int) – The port under which to reach the server.
show (bool) – Open a new webbrowser tab with the monitor.
**monitor_kwargs – Keyword arguments passed to the
Monitorconstructor.
- Returns:
server – The web server running the monitor.
monitor – The
Monitorinstance.
- Return type: