microcalorimetry.measurements.rfsweep

This module contains functions for running and executing RF sweeps on the microcalorimeter.

Functions

run(output_dir, repeats, configs, settings, ...[, ...])

Run a microcalorimetry RF Sweep experiment.

parse(→ tuple[dict[rmellipse.uobjects.RMEMeas], ...)

Parse a microccalorimeter run to produce data with uncertainties.

view(→ tuple[matplotlib.pyplot.Figure])

View an ongoing rfsweep experiment.

generate_settled_runlist(metadata[, analysis_config, ...])

Generate a run list with settled source powers.

runlist_from_loss(, level_to, DUT_power_max_dBm, ...)

Generate a runlist from the approximate RF Loss of measurement signals.

Package Contents

microcalorimetry.measurements.rfsweep.run(output_dir: str, repeats: int, configs: list[pathlib.Path], settings: list[pathlib.Path], sensor_master_list: run.configs, name: str = 'rf_sweep', no_confirm: bool = False, dry_run: bool = False)[source]

Run a microcalorimetry RF Sweep experiment.

Parameters:
output_directoryPath, optional

Directory to output from. The default is None.

repeatsint, optional

Number of repeats to perform on all settings files. The default is None.

configslist[Path], optional

Config files for experiment settings / instruments. The default is None.

settingslist[Path], optional

Run settings files, looped over for experiment. The default is None. Each index i of a configs file corresponds to a index i of the configs file.

sensor_master_listconfigs.RFSensorMasterList,

Master list of sensors and resitance/sensitivity values to use for sanity checking config files.

namestr, optional

Name of measurement. The default is None.

no_confirmbool, optional

If True, skips any confirmations that may be asked when starting the run.

dry_runbool, optional

If true, will try to load the configurations without actually running anything to do a dry-check - can be used to validate some basic type validation of the configuration.

microcalorimetry.measurements.rfsweep.parse(metadata: list[pathlib.Path], analysis_config: microcalorimetry.configs.RFSweepParserConfig = None, verbose: bool = False, make_plots: bool = False, plot_segments_analysis: list[int] = [0, -1], plot_all_segments_analysis: bool = False, dataframe_results: pathlib.Path = None, format_matlab: pathlib.Path = None) tuple[dict[rmellipse.uobjects.RMEMeas], list[matplotlib.pyplot.Figure]][source]

Parse a microccalorimeter run to produce data with uncertainties.

Parameters:
metadatalist[Path]

Path to metadata file for experient. Can be multiples.

analysis_configRFSweepParserConfig, optional

Path to sensor configuration file, overrides any sensor configuration in the metadata if provided.

verbosebool, optional

If True, prints info about the analysis. Default is True

make_plotsbool, optional

Makes plots if True.

plot_segments_analysislist[int]

What segment of each run to plot.

plot_all_segments_analysisbool

If True, when making plots plot every segments analysis.

dataframe_resultsPath, optional

If provided, saves a csv of intermediate calculated values.

format_matlabPath, optional

If provided, saves a matlab version of the output results.

Returns:
parsed_rfdict[RMEMeas]

Dictionairy of RFSweep datasets in a parsed RF sweep configuration.

figureslist[plt.Figure]

Dictionairy of RFSweep datasets in a parsed RF sweep configuration.

microcalorimetry.measurements.rfsweep.view(metadata: pathlib.Path, signal_config: microcalorimetry.configs.RFSweepSignalConfig = None, time_window: list[float] = None, plot_p_est: bool = True, plot_sensor_raw: bool = True, down_sample_n: int = 1, power_units: str = 'W', time_units: str = 'hrs') tuple[matplotlib.pyplot.Figure][source]

View an ongoing rfsweep experiment.

Parameters:
metadataPath

Path to the metadata file of an active experiment

signal_configRFSweepSignalConfig, optional

Path to a signal configuration of the measurement. Will attempt to read the signal config from the measurement files if not provided, if provided will overide what is in the metadata files.

time_windowlist[float], optional

Time window to look at (in units of time_units), as [min, max]. If not provided will plot entire time series. by default None

plot_p_estbool, optional

Plots the estimate of each power signal, by default True

plot_sensor_rawbool, optional

Plots the raw data that composes each signal, by default True

down_sample_nint, optional

Down sample time series by n, by default 1

power_unitsstr, optional

Plot units for power, by default ‘W’

time_unitsstr, optional

Plot units for time, by default ‘hrs’

Returns:
figurestuple[Figure]

Tuple of output figures.

microcalorimetry.measurements.rfsweep.generate_settled_runlist(metadata: pathlib.Path, analysis_config: microcalorimetry.configs.RFSweepParserConfig = None, output_dir: pathlib.Path = Path('.'), output_name: str = None, n_samples: int = 7)[source]

Generate a run list with settled source powers.

Copies the run settings (frequency list, target power, initial source power, and source limit) and replaces the initial source power with the settled value from the provided run.

This function does NOT check if the source was actually settled, it just assumes it was right before power was turned off. Check that your self by inspecting the dashboard.

Unfinshed runs can be provided, but they may provide bad settings for the final points if the experiment never actually settled, and the frequency list may be incomplete.

Parameters:
metadataPath

Metadata file of output.

output_dirPath, optional

Folder to output new file in. The default is the current directory.

output_namestr, optional

What to name new file. The default is the provided metadata name + ‘_settled_runlist.csv’

n_samplesint, optiona;

Number of samples to average for final source value.

microcalorimetry.measurements.rfsweep.runlist_from_loss(metadata: pathlib.Path, output_dir: pathlib.Path = Path('.'), level_to: str = 'DUT_power', DUT_power_max_dBm: float = 10, monitor_power_max_dBm: float = 0, max_source_dBm: float = 15, output_name: str = 'runlist.csv', n_samples: int = 1, frequencies: numpy.ndarray[float] = None, segment_size: int = 10, off_step_length: int = 2, safety_backoff_dBm: float = 3) list[matplotlib.pyplot.Figure][source]

Generate a runlist from the approximate RF Loss of measurement signals.

Parameters:
metadataPath

Path to measurement metadata.

output_dirPath, optional

Directory to output runfiles. The default is Path(‘.’).

level_tostr, optional

Which signal to level to. The default is ‘DUT_power’.

DUT_power_max_dBmfloat, optional

Maximum DUT power in dBm. The default is 10.

monitor_power_max_dBmfloat, optional

Maxmium monitor power in dBm. The default is 0.

max_source_dBmfloat, optional

Maxmimum allowed source value in dBm . The default is None.

output_namestr, optional

Name to output the file as The default is ‘runlist.csv’.

n_samplesint, optional

Number of samples to average over for calculations. The default is 1.

frequenciesnp.ndarray[float], optional

Frequency list to interpolate the RF loss values too and produce the runlist. If None, uses the frequencies in the provided measurement. The default is None.

segment_sizeint, optional

Number of frequencie points per segment. The default is 5.

off_step_lengthint, optional

How many steps each off period should be. Typically 2, the default it 2.

safety_backoff_dBmfloat, optional

Back off the start value by this amount to avoid over sourcing. The levelling feature will converge to the correct value during a measurement. The default is 3.0.

Returns:
figureslist[plt.Figure]

List of generated figures.