striqt.sensor.calibration¶
Y-factor calibration corrections and their lookup by capture settings.
compute_y_factor_corrections
¶
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_enabledas 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_onandp_off, and the diagnosticspapr_onandpapr_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 incal_data, or None -
xp–the array namespace of the result, or None for numpy
Returns:
-
–
a 1-D
float32array in the namespacexpwith one value per port, or -
–
None when
cal_datais None
Raises:
-
TypeError–if
cal_datais 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 incal_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
DataArrayon thecapturedimension with one value per port. The -
–
unitsattr is'dBm/Hz'whenBis 1, and'dBm'with a -
–
noise_bandwidthattr equal toBotherwise. Thereference_temperature -
–
attr is
T. None whencal_datais None or the file has no corrections.
Raises:
-
TypeError–if
cal_datais 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
¶
tabulate the noise figure and power correction of corrections at the maximum gain.
Parameters:
-
corrections(Dataset) –the calibration dataset read by
read_calibration, with thenoise_figure(dB) andpower_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 toDataset.sel
Returns:
-
DataFrame–a
DataFramewith the columns'NF (dB)'and'Power Corr (dB)', which -
DataFrame–hold the
noise_figureandpower_correctionvalues as stored, indexed by -
DataFrame–the remaining grid coordinates as a
conditionMultiIndex; a row that is -
DataFrame–nanin the noise figure is dropped
Raises:
-
KeyError–if a value in
selis not on the grid