edges.cal.receiver_cal¶
Functions to perform reciever calibration given a CalibrationObservation.
- edges.cal.receiver_cal.get_noise_wave_calibration_iterative(calobs: CalibrationObservation, *, cterms: int = 5, wterms: int = 7, apply_loss_to_true_temp: bool = True, smooth_scale_offset_within_loop: bool = False, cable_delay_sweep: ndarray = array([0]), ncal_iter: int = 4, fit_method: str = 'lstsq', scale_offset_poly_spacing: float = 1.0, t_load_guess: Quantity, PhysicalType('temperature')]=<Quantity 400. K>, t_load_ns_guess: Quantity, PhysicalType('temperature')]=<Quantity 300. K>) Calibrator[source]¶
Determine noise-wave calibration coefficients iteratively.
This is the algorithm used for Bowman+2018 to determine the calibration coefficients from lab-based observations of the receiver.
- Parameters:
cterms – The number of parameters in the models for the overall scale and offset temperatures.
wterms – The number of parameters in the models for the noise-wave temperatures.
apply_loss_to_true_temp – Whether to apply losses to the true “known” temperature, or inversely to the spectra under calibration. Bowman+2018 sets this to False.
smooth_scale_offset_within_loop – Whether to smooth the scale and offset temperatures within the iterative loop, or only after the loop has converged.
cable_delay_sweep – The delays to search to determine the delay of the long cable (used for two of the calibration loads).
ncal_iter – The number of iterations to use in the main loop.
fit_method – The alogirhtm to use in the linear fit.
scale_offset_poly_spacing – Sets the indices in the scale/offset polynomial models. Bowman+2018 uses 0.5.
t_load_guess – An initial guess for t_load. In principle, this parameter is completely ineffective, but it’s possible that a good choice makes the iterations more stable.
t_load_ns_guess – The same as t_load_guess but for the load+noise-source temperature.
- Returns:
calibrator – A calibrator object with all the coefficients.
- edges.cal.receiver_cal.perform_term_sweep(calobs: CalibrationObservation, delta_rms_thresh: float = 0, min_cterms: int = 4, min_wterms: int = 4, max_cterms: int = 15, max_wterms: int = 15, **kwargs) CalibrationObservation[source]¶
For a given calibration definition, perform a sweep over number of terms.
- Parameters:
calobs (
CalibrationObservationinstance) – The definition calibration class. The cterms and wterms in this instance should define the lowest values of the parameters to sweep over.delta_rms_thresh (float) – The threshold in change in RMS between one set of parameters and the next that will define where to cut off. If zero, will run all sets of parameters up to the maximum terms specified.
max_cterms (int) – The maximum number of cterms to trial.
max_wterms (int) – The maximum number of wterms to trial.