Skip to content

striqt.sensor.calibration

Y-factor calibration corrections and their lookup by capture settings.

compute_y_factor_corrections

compute_y_factor_corrections(
    dataset: Dataset, enr_dB: float, Tref: float = 290.0
) -> Dataset

return the Y-factor noise figure and power correction of each grid point.

The variables of dataset are channel_power_time_series (dB, rms and peak detectors over time_elapsed), analysis_bandwidth (Hz), and backend_sample_rate (S/s). The rms detector is averaged in linear power over time_elapsed before the Y-factor is formed. An infinite analysis_bandwidth counts as the backend sample rate.

Parameters:

  • dataset (Dataset) –

    the collected captures, with the calibration fields and noise_diode_enabled as dimensions

  • enr_dB (float) –

    the excess noise ratio (dB) of the noise diode

  • Tref (float, default: 290.0 ) –

    the reference temperature (K) of the ENR and the noise figure

Returns:

  • Dataset –

    a dataset over the calibration fields with noise_figure (dB),

  • Dataset –

    temperature (K), power_correction (mW per full-scale power unit), the

  • Dataset –

    linear powers p_on and p_off, and the diagnostics papr_on and papr_off

  • Dataset –

    (dB)

lookup_power_correction

lookup_power_correction(
    cal_data: str | Path | None,
    capture: SoapyCapture,
    master_clock_rate: float,
    format_path: PathFormatter | None = None,
    *,
    xp=None,
)

return the power correction (mW per full-scale power unit) of each port of capture.

The correction is the factor that scales the squared magnitude of full-scale IQ to mW, interpolated in center frequency from the calibration rows at the port, gain, LO shift, backend sample rate, and analysis bandwidth of capture.

Parameters:

  • cal_data (str | Path | None) –

    the path of the calibration corrections file, or None for no calibration

  • capture (SoapyCapture) –

    the capture that selects the calibration row, one row per port

  • master_clock_rate (float) –

    the SDR master clock rate (S/s), which sets the backend sample rate of the row

  • format_path (PathFormatter | None, default: None ) –

    the formatter of the {field} templates in cal_data, or None

  • xp –

    the array namespace of the result, or None for numpy

Returns:

  • –

    a 1-D float32 array in the namespace xp with one value per port, or

  • –

    None when cal_data is None

Raises:

  • TypeError –

    if cal_data is neither a path nor None

  • KeyError –

    if the port, gain, LO shift, backend sample rate, or analysis bandwidth of a port is not in the calibration grid

  • ValueError –

    if the center frequency of a port is outside the calibrated range, or no calibrated row remains for the port

lookup_system_noise_power

lookup_system_noise_power(
    cal_data: Path | str | None,
    capture: SoapyCapture,
    master_clock_rate: float,
    format_path: PathFormatter | None = None,
    *,
    T=290.0,
    B=1.0,
    xp=None,
)

return the system noise power (dBm in B) of each port referred to the input.

The power is k * T * B * F, the noise power that the sensor measures with the input terminated at temperature T. F is the linear noise figure interpolated in center frequency from the calibration rows at the port, gain, LO shift, backend sample rate, and analysis bandwidth of capture.

Parameters:

  • cal_data (Path | str | None) –

    the path of the calibration corrections file, or None for no calibration

  • capture (SoapyCapture) –

    the capture that selects the calibration row, one row per port

  • master_clock_rate (float) –

    the SDR master clock rate (S/s), which sets the backend sample rate of the row

  • format_path (PathFormatter | None, default: None ) –

    the formatter of the {field} templates in cal_data, or None

  • T –

    the temperature (K) of the input termination

  • B –

    the noise bandwidth (Hz), or 1 for a power spectral density

  • xp –

    the array namespace of the result, or None for numpy

Returns:

  • –

    a DataArray on the capture dimension with one value per port. The

  • –

    units attr is 'dBm/Hz' when B is 1, and 'dBm' with a

  • –

    noise_bandwidth attr equal to B otherwise. The reference_temperature

  • –

    attr is T. None when cal_data is None or the file has no corrections.

Raises:

  • TypeError –

    if cal_data is neither a path nor None

  • KeyError –

    if the port, gain, LO shift, backend sample rate, or analysis bandwidth of a port is not in the calibration grid

  • ValueError –

    if the center frequency of a port is outside the calibrated range, or no calibrated row remains for the port

summarize_calibration

summarize_calibration(
    corrections: Dataset, **sel: Any
) -> DataFrame

tabulate the noise figure and power correction of corrections at the maximum gain.

Parameters:

  • corrections (Dataset) –

    the calibration dataset read by read_calibration, with the noise_figure (dB) and power_correction (mW/FS) variables on the calibration grid

  • **sel (Any, default: {} ) –

    coordinate values that each select one entry on a dimension of the grid (port=0), passed to Dataset.sel

Returns:

  • DataFrame –

    a DataFrame with the columns 'NF (dB)' and 'Power Corr (dB)', which

  • DataFrame –

    hold the noise_figure and power_correction values as stored, indexed by

  • DataFrame –

    the remaining grid coordinates as a condition MultiIndex; a row that is

  • DataFrame –

    nan in the noise figure is dropped

Raises:

  • KeyError –

    if a value in sel is not on the grid