microcalorimetry.measurements.rfsweep

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

Functions

run(output_dir, configs, settings, sensor_master_list)

Run a microcalorimetry RF Sweep experiment.

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

Parse a microccalorimeter run to produce data with uncertainties.

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

Generate a run list with settled source powers.

runlist_from_loss(/, segment_size, off_step_length, ...)

Make a runlist from a parsed measurement.

reduce_initial_power(runlist, reduce_by_dB[, ...])

Reduce a runlist's initial power setting.

reorder_runlist(runlist[, output_path, segment_size, ...])

Reorder a runlist.

review_runlist(→ list[matplotlib.pyplot.Figure])

Review a runlist for an rf sweep measurement.

Package Contents

microcalorimetry.measurements.rfsweep.run(output_dir: str, 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, validate: bool = True)[source]

Run a microcalorimetry RF Sweep experiment.

Parameters:
output_directoryPath

Directory to output from. 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.

validatebool, optional

If true, attempts to validate configuration files. The default is True.

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

Parse a microccalorimeter run to produce data with uncertainties.

This parses the initial version of the DC sweep experiment.

Parameters:
metadatalist[Path]

Path(s) to metadata files or directories containing rfsweep runs.

verbosebool, optional

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

make_plotsbool, optional

Makes review plots if True. The default is True.

plot_segments_indexeslist[int]

What segment of each run to plot. Each interger represents the index of every segment for every run in order of runs. For example, index 0 is the first segment of the first run Index -1 is the last segment of the last run. The default is [0, -1].

plot_all_segments_analysisbool

If True, plot every single segment’s review charts and ignore plot_segment_indexes.

dataframe_resultsPath, optional

If provided, saves a csv of intermediate calculated values to the specified path.

include_time_stdbool, optional

It True, includes standard deviation of stable samples used to calculate the value of a particular column as an uncertainty mechanism. The default is True.

analysis_configRFSweepParserConfig, optional

Supply a .yml or .csv file with “analysis_config” or “signal_config” fields. These will overwrite the signal_config present in each runs saved signal_config definition.

DUT_power_analysisdict, optional

Set the analysis settings for the DUT. Format —— { instr_timing_tolerance : float

Max expected misalignment of instrument’s time column to determine when RF is turned off. Default is 5.

stats_window_overridefloat

Override the defined stats window to change the window of samples averaged over to determine off/on values. The default is None.

fast_off_analysisbool

Whether or not to use fast analysis. Only matters for thermoelectric sensors power sensors (which may or may not use the fast off analysis). The default is False.

coeffsPath

Provided a path to thermoelectric fit coefficients you want to use. Must be provided for thermoelectric power sensors.

V_off_delayfloat

Relative time from RF being turned off to on to use for the V off measurement. Only relevant if fast analysis is being used.

V_off_functionstr

What V Off fit function to use, only required if doing a fast fit. Options Format ————– { lin_plus_exp

Fit fast off measurements to a line + an exponential.

linear

Fit fast off measurements to a line.

single_sample

Treat all fast off measurements in window as realizations of the same measurement and average over them.

}

V_off_fit_time_windowlist[float]

Relative time window from RF being turned on to fit to. For example, [1, 2] would fit between 1 and 2 seconds after RF power is turned off.

}

monitor_power_analysisdict, optional

Set the analysis settings for the monitor. Format —— { instr_timing_tolerance : float

Max expected misalignment of instrument’s time column to determine when RF is turned off. Default is 5.

stats_window_overridefloat

Override the defined stats window to change the window of samples averaged over to determine off/on values. The default is None.

fast_off_analysisbool

Whether or not to use fast analysis. Only matters for thermoelectric sensors power sensors (which may or may not use the fast off analysis). The default is False.

coeffsPath

Provided a path to thermoelectric fit coefficients you want to use. Must be provided for thermoelectric power sensors.

V_off_delayfloat

Relative time from RF being turned off to on to use for the V off measurement. Only relevant if fast analysis is being used.

V_off_functionstr

What V Off fit function to use, only required if doing a fast fit. Options Format ————– { lin_plus_exp

Fit fast off measurements to a line + an exponential.

linear

Fit fast off measurements to a line.

single_sample

Treat all fast off measurements in window as realizations of the same measurement and average over them.

}

V_off_fit_time_windowlist[float]

Relative time window from RF being turned on to fit to. For example, [1, 2] would fit between 1 and 2 seconds after RF power is turned off.

}

calorimeter_power_analysisdict, optional

Set the analysis settings for the calorimeter. Format —— { instr_timing_tolerance : float

Max expected misalignment of instrument’s time column to determine when RF is turned off. Default is 5.

stats_window_overridefloat

Override the defined stats window to change the window of samples averaged over to determine off/on values. The default is None.

coeffsPath

Provided a path to thermoelectric fit coefficients you want to use. Must be provided for thermoelectric power sensors.

}

RF_source_power_analysisdict, optional

Set the analysis settings for the RF Source. Format —— { instr_timing_tolerance : float

Max expected misalignment of instrument’s time column to determine when RF is turned off. Default is 5.

stats_window_overridefloat

Override the defined stats window to change the window of samples averaged over to determine off/on values. The default is None.

V_off_delayfloat

Relative time from RF being turned off to use as the off measurement for a fast off. Only relevant if fast analysis is being used.

V_off_functionstr

What off fit function to use, only required if doing a fast fit. Options Format ————– { lin_plus_exp

Fit fast off measurements to a line + an exponential.

linear

Fit fast off measurements to a line.

single_sample

Treat all fast off measurements in window as realizations of the same measurement and average over them.

}

V_off_fit_time_windowlist[float]

Relative time window from RF being turned on to fit to. For example, [1, 2] would fit between 1 and 2 seconds after RF power is turned off.

}

Returns:
parsed_rfdict[RMEMeas]

Dictionary of RFSweep datasets in a parsed RF sweep configuration.

figureslist[plt.Figure]

Dictionary of RFSweep datasets in a parsed RF sweep configuration.

microcalorimetry.measurements.rfsweep.generate_settled_runlist(metadata: pathlib.Path, analysis_config: microcalorimetry.configs.RFSweepParserConfig = None, output_dir: microcalorimetry._tkquick.dtypes.Folder = 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.

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

Path to the metadatafile of a measurement.

output_dirFolder, 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, optional

Number of samples to average for final source value.

microcalorimetry.measurements.rfsweep.runlist_from_loss(parsed_rf: microcalorimetry.configs.ParsedRFSweep, DUT_power: float, output_path: pathlib.Path = Path('.') / 'runlist.csv', segment_size: int = 10, off_step_length: int = 2, safety_backoff_dBm: float = 3, source_hard_limit_buffer_dBm: float = 1, interleave: bool = True) list[matplotlib.pyplot.Figure][source]

Make a runlist from a parsed measurement.

Estimates the approximate loss from the source to the DUT and makes a new runlist that attempts to level the source to the DUT_power as the initial power.

Parameters:
parsed_rfconfigs.ParsedRFSweep

A parsed rfsweep measurement.

DUT_powerfloat

DUT power in dBm to try and level the source to.

output_pathPath, optional

Path to output the generate runfile. The default is ‘runlist.csv’.

segment_sizeint, optional

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

off_step_lengthint, optional

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

safety_backoff_dBmfloat, optional

Back off the inintial source value by this amount to avoid starting the source at too high of a level. The default is 3.0.

source_hard_limit_buffer_dBmfloat, optional

Add this amount of power to the estimated required power and set it as the source limit per frequency point. The default is 1 dBm.

interleavebool, optional

Interleave frequency points. The default is True.

Returns:
figureslist[plt.Figure]

List of generated figures.

microcalorimetry.measurements.rfsweep.reduce_initial_power(runlist: pathlib.Path, reduce_by_dB: float, output_path: pathlib.Path = None, decimals: int = 4)[source]

Reduce a runlist’s initial power setting.

Parameters:
runlistPath

Path to runlist to modify.

reduce_by_dBfloat

How much to reduce the initial power by. Negative values will increase the initial power.

output_pathPath, optional

If None, uses the same name as input file with ‘_min{num}dB.csv’

decimalsint, optional

Number of decimals to use for frequency points. Default is 4.

microcalorimetry.measurements.rfsweep.reorder_runlist(runlist: pathlib.Path, output_path: pathlib.Path = None, segment_size: int = 10, off_step_length: int = 2, freq_ordering: str = 'interleave', make_plots: bool = True)[source]

Reorder a runlist.

Can modify the number of and size of segments, and reorder frequencies.

Parameters:
runlistPath

Frequency list to reorder.

output_pathPath, optional

Directory to output runfile. The default is the same path as the input file with ‘_reordered’ appended to the name.

segment_sizeint, optional

Number of steps per segment (maximum). The default is 10.

off_step_lengthint, optional

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

freq_orderingstr, optional

Determines how frequencies are sorted before being split into segments. Options Format ————– { monotonic_increasing

Sort frequencies monitonically increasing (e.g. 1,2,3,5,6).

interleave_increasing

Sort frequencies into 2 monitonically increasing, interleaved lists. For example: 1,2,3,4,5,6 becomes 1,3,5,2,4,6.

}

make_plotsbool, optional

Generate review plots of runlist. The default is True.

microcalorimetry.measurements.rfsweep.review_runlist(runlist: pathlib.Path) list[matplotlib.pyplot.Figure][source]

Review a runlist for an rf sweep measurement.

Parameters:
runlistPath

Path to runlist.

Returns:
plotslist[plt.Figures]

List of review charts.