edges_cal.cal_coefficients.CalibrationObservation

class edges_cal.cal_coefficients.CalibrationObservation(loads: dict[str, edges_cal.cal_coefficients.Load], receiver: Receiver, *, cterms: int = 5, wterms: int = 7, metadata: dict[str, Any] = _Nothing.NOTHING)[source]

A composite object representing a full Calibration Observation.

This includes spectra of all calibrators, and methods to find the calibration parameters. It strictly follows Monsalve et al. (2017) in its formalism. While by default the class uses the calibrator sources (“ambient”, “hot_load”, “open”, “short”), it can be modified to take other sources by setting CalibrationObservation._sources to a new tuple of strings.

Parameters:
  • loads (dict[str, edges_cal.cal_coefficients.Load]) – dictionary of load names to Loads

  • receiver (edges_cal.s11.Receiver) – The object defining the reflection coefficient of the receiver.

  • cterms (int) – The number of polynomial terms used for the scaling/offset functions

  • wterms (int) – The number of polynomial terms used for the noise-wave parameters.

  • metadata – Metadata associated with the data.

Methods

C1([f])

Scaling calibration parameter.

C2([f])

Offset calibration parameter.

Tcos([f])

Cosine noise-wave parameter.

Tsin([f])

Sine noise-wave parameter.

Tunc([f])

Uncorrelated noise-wave parameter.

__init__(loads, receiver, *[, cterms, ...])

Method generated by attrs for class CalibrationObservation.

calibrate(load[, q, temp])

Calibrate the temperature of a given load.

clone(**kwargs)

Clone the instance, updating some parameters.

decalibrate(temp, load[, freq])

Decalibrate a temperature spectrum, yielding uncalibrated T*.

from_io(io_obj, *[, semi_rigid_path, ...])

Create the object from an edges-io observation.

from_yaml(config[, obs_path])

Create the calibration observation from a YAML configuration.

get_K([freq])

Get the source-S11-dependent factors of Monsalve (2017) Eq.

get_linear_coefficients(load)

Calibration coefficients a,b such that T = aT* + b (derived from Eq.

get_load_residuals()

Get residuals of the calibrated temperature for a each load.

get_rms([smooth])

Return a dict of RMS values for each source.

inject([lna_s11, source_s11s, c1, c2, ...])

Make a new CalibrationObservation based on this, with injections.

new_load(load_name, io_obj[, ...])

Create a new load with the given load name.

plot_calibrated_temp(load[, bins, fig, ax, ...])

Make a plot of calibrated temperature for a given source.

plot_calibrated_temps([bins, fig, ax])

Plot all calibrated temperatures in a single figure.

plot_coefficients([fig, ax])

Make a plot of the calibration models, C1, C2, Tunc, Tcos and Tsin.

plot_raw_spectra([fig, ax])

Plot raw uncalibrated spectra for all calibrator sources.

plot_s11_models(**kwargs)

Plot residuals of S11 models for all sources.

to_calibrator()

Directly create a Calibrator object without writing to file.

with_load_calkit(calkit[, loads])

Return a new observation with loads having given calkit.

write(filename)

Write all information required to calibrate a new spectrum to file.

Attributes

C1_poly

np.poly1d object describing the Scaling calibration coefficient C1.

C2_poly

np.poly1d object describing the offset calibration coefficient C2.

Tcos_poly

np.poly1d object describing the cosine noise-wave parameter, Tcos.

Tsin_poly

np.poly1d object describing the sine noise-wave parameter, Tsin.

Tunc_poly

np.poly1d object describing the uncorrelated noise-wave parameter, Tunc.

freq

The frequencies at which spectra were measured.

internal_switch

load_names

metadata

Metadata associated with the object.

receiver_s11

The corrected S11 of the LNA evaluated at the data frequencies.

s11_correction_models

Dictionary of S11 correction models, one for each source.

source_thermistor_temps

Dictionary of input source thermistor temperatures.

t_load

t_load_ns

loads

receiver

cterms

wterms