semi_cr.core.lab.utils.post_processing_tools package

Submodules

semi_cr.core.lab.utils.post_processing_tools.base module

class semi_cr.core.lab.utils.post_processing_tools.base.BaseAnalyzer[source]

Bases: object

Base class for analysis of datasets.

load()[source]

Load the dataset given its UUID.

analyze()[source]

_summary_ This method should be implemented by subclasses to perform specific analysis on the dataset.

semi_cr.core.lab.utils.post_processing_tools.dataqruiser_analysis module

class semi_cr.core.lab.utils.post_processing_tools.dataqruiser_analysis.CoulombPeakAnalyzer(uuid, file_name: str | None = None, value_var='I_NOR', x_coord='V_NP', y_coord='V_NOL')[source]

Bases: BaseAnalyzer

Analysis class for 2D sweep datasets (e.g. Coulomb peak searches): loads data by UUID, takes the absolute value of the measured current, and converts it to log scale for plotting / saving.

load()[source]

Load the dataset given its UUID.

analyze()[source]

Compute log10(abs(data)).

get_measurement_data_as_numpy(uuid: str) tuple[ndarray, ndarray, ndarray][source]

Fetch the 2D sweep data by UUID as numpy arrays (x coord, y coord, abs(value)).

get_log_abs_data(eps: float = 1e-15) ndarray[source]

log10(abs(data)); eps avoids -inf for exact-zero readings.

plot(figsize=(10, 5))[source]
save_to_dataqruiser(raw_dataset, file_name: str, gate_snapshot: dict | None = None)[source]

Save log10(abs(data)) back to a dataqruiser raw dataset as a new xarray dataset.

semi_cr.core.lab.utils.post_processing_tools.dataqruiser_utils module

semi_cr.core.lab.utils.post_processing_tools.dataqruiser_utils.get_dataset_by_uuid(uuid: str) dataset[source]

semi_cr.core.lab.utils.post_processing_tools.resistanceMatrixAnalyzer module

class semi_cr.core.lab.utils.post_processing_tools.resistanceMatrixAnalyzer.ResistanceMatrixAnalyzer(uuid)[source]

Bases: BaseAnalyzer

Class for analyzing resistance matrix datasets.

load()[source]

Load the dataset given its UUID.

analyze()[source]

Perform analysis on the resistance matrix dataset. This method can be extended to include specific analysis logic.

plot_resistance_matrix(vmin, vmax)[source]
get_measurement_data_as_numpy(uuid: str) tuple[ndarray, ndarray, ndarray][source]

Get the resistancemeasurement data from a dataset given its UUID as a format of a numpy array. Also return its coordinates

Parameters:

uuid (str) – The UUID of the dataset.

get_reference_resistance_matrix(station_context: StationContext) DataFrame[source]

_summary_

Get the reference resistance matrix from the station context. This method can be extended to include specific logic for extracting the reference resistance matrix.

Args:

station_context (StationContext): The station context containing connector information.

get_series_resistance_matrix(station_context: StationContext) DataFrame[source]

Get the series resistance matrix from the station context. This method can be extended to include specific logic for extracting the series resistance matrix.

Parameters:

station_context (StationContext) – The station context containing connector information.

get_difference_log(reference_matrix: ndarray, measurement_matrix: ndarray) ndarray[source]

_summary_ Get the log difference between the reference and measurement resistance matrices.

Parameters:
  • reference_matrix (np.ndarray) – reference resistance matrix as a numpy array.

  • measurement_matrix (np.ndarray) – measurement resistance matrix as a numpy array.

Returns:

The log difference between the reference and measurement resistance matrices.

Return type:

np.ndarray

filter_with_significance_log(diff_log: ndarray, threshold: float) ndarray[source]

_summary_ Filter the log difference matrix based on a significance threshold.

Parameters:
  • diff_log (np.ndarray) – The log difference between the reference and measurement resistance matrices.

  • threshold (float) – The significance threshold for filtering.

Returns:

The filtered log difference matrix.

Return type:

np.ndarray

semi_cr.core.lab.utils.post_processing_tools.sParamAnalyzer module

class semi_cr.core.lab.utils.post_processing_tools.sParamAnalyzer.SParamAnalyzer[source]

Bases: BaseAnalyzer

Class for analyzing S-parameters.

load_from_uuid(uuid)[source]

Load the qcodes dataset given its UUID.

align_axis(axis, data, target_axis)[source]

Align the given axis of the data to the target axis.

Parameters:
  • axis – Original axis.

  • data – Original data.

  • target_axis – Target axis to align to.

Returns:

interpolated data aligned to the target axis.

Return type:

target_data

delftacDataset_to_dict(qcodes_dataset: dataset) tuple[dict[str, DataFrame], dict[str, ndarray]][source]

Convert a QCoDeS dataset to a dictionary of pandas DataFrames for S parameters.

Parameters:

qcodes_dataset – The QCoDeS dataset to convert.

Returns:

  • A dictionary where the key represent the connection_info and the value is the corresponding xarray dataset.

  • A dictionary with coordinates as numpy arrays.

Return type:

A tuple containing

sampleboardDataset_to_dict(qcodes_dataset: dataset) tuple[dict[str, DataFrame], dict[str, ndarray]][source]

For sample board baseline data: Convert a QCoDeS dataset to a dictionary of pandas DataFrames for S parameters. This function is for load the sample board baseline data, which consists of transmission and crosstalk. This is shown as frequency in Hz vs S amplitude in dB

Parameters:

qcodes_dataset – The QCoDeS dataset to convert.

Returns:

  • A dictionary where the key represent the connection_info and the value is the corresponding xarray dataset.

  • A dictionary with coordinates as numpy arrays.

Return type:

A tuple containing

muxQcodesDataset_to_dict_V2(qcodes_dataset: dataset, filter: dict[str, float | tuple[float, float] | str] | None = None) tuple[dict[str, DataFrame], dict[str, ndarray]][source]

Convert a QCoDeS dataset to a dictionary of pandas DataFrames for S parameters.

Parameters:
  • qcodes_dataset – The QCoDeS dataset to convert.

  • filter – Optional dictionary specifying the filter criteria for the dataset. The keys are the names of the coordinates, and the values are either a single value or a range (tuple) to filter on.

muxQcodesDataset_to_dict(qcodes_dataset, filter=None) tuple[dict[str, DataFrame], dict[str, ndarray]][source]

Convert a QCoDeS dataset to a dictionary of pandas DataFrames for S parameters.

Parameters:
  • qcodes_dataset – The QCoDeS dataset to convert.

  • filter – Optional dictionary specifying the filter criteria for the dataset. The keys are the names of the coordinates, and the values are either a single value or a range (tuple) to filter on.

Returns:

  • A dictionary with S parameters as pandas DataFrames.

  • A dictionary with coordinates as numpy arrays.

Return type:

A tuple containing

logistic(x, y0, A, x0, k)[source]

Logistic function for curve fitting.

extract_rise_time(amps, settling_times)[source]

Extract the 90% rise time from the given amplitude and time data.

Parameters:
  • amps (np.ndarray) – Amplitude data.

  • settling_times (np.ndarray) – Time data.

fit_rise_time(x, y)[source]

Fit a logistic curve and return the 10-90% rise time.

Returns:

popttuple

(y0, A, x0, k)

rise_timefloat

10-90% rise time.

absoluteV_to_dB(absolute_value: float | ndarray | list, reference: float = 0.15) float | ndarray[source]
load_from_vna_csv(file_path) dict[str, DataFrame][source]

Load the S-parameter dataset from a VNA CSV file and return S parameters as a dictionary of pandas DataFrames.

Parameters:

file_path (str) – Path to the VNA CSV file.

load_s2p_db(file_path: str) dict[str, DataFrame][source]

Load an .s2p Touchstone file and return S-parameters in dB.

Parameters:

file_path – Path to the .s2p file.

Returns:

Dictionary with keys ‘s11’, ‘s21’, ‘s12’, ‘s22’. Each value is a DataFrame with columns:

  • Freq_GHz

  • Sxx (dB)

get_dataset_attributes_from_uuid(uuid)[source]

Retrieve dataset attributes from a dataset given its UUID.

Parameters:

uuid (str) – The UUID of the dataset.

get_dataset_attributes_from_yaml(yaml_file_path)[source]

Retrieve dataset attributes from a YAML file.

Parameters:

yaml_file_path (str) – Path to the YAML file.

analyze()[source]

Analyze the S-parameter data and return relevant metrics.

extract_3dB_bandwidth(frequencies: ndarray, insertion_loss: ndarray) float[source]

Extract the 3dB bandwidth from the insertion loss data. This will take the minimal value of the insertion loss as the reference and find the frequencies where the insertion loss is 3dB above that reference.

Parameters:
  • frequencies (np.ndarray) – Frequency data in Hz.

  • insertion_loss (np.ndarray) – Insertion loss data in dB.

extract_3dB_bandwidth_from_transmission(frequencies: ndarray, transmission: ndarray) float[source]

Extract the 3dB bandwidth from the transmission data. This will take the maximal value of the transmission as the reference and find the frequencies where the transmission is 3dB below that reference.

Parameters:
  • frequencies (np.ndarray) – Frequency data in Hz.

  • transmission (np.ndarray) – Transmission data in dB.

extract_slope(frequencies: ndarray, transmission: ndarray) float[source]

Extract the slope from the transmission data.

Parameters:
  • frequencies (np.ndarray) – Frequency data in Hz.

  • transmission (np.ndarray) – Transmission data in dB.

Returns:

The slope of the transmission data.

Return type:

float

find_breakpoints(frequencies: ndarray, insertion_loss: ndarray) tuple[float, float][source]

Find the breakpoints in the insertion loss data where the slope changes significantly.

Parameters:
  • frequencies (np.ndarray) – Frequency data in Hz.

  • insertion_loss (np.ndarray) – Insertion loss data in dB.

load()

Load the dataset given its UUID.

semi_cr.core.lab.utils.post_processing_tools.vna_utils module

semi_cr.core.lab.utils.post_processing_tools.vna_utils.load_vna_csv(file_path: str) DataFrame[source]

Load a VNA CSV and return frequency in GHz and S-parameters.

Parameters:

file_path – Path to the VNA CSV file.

Returns:

A DataFrame containing the frequency (GHz) and S-parameters.

Return type:

pd.DataFrame

Module contents