rss_ringoccs.calibration.freq_offset_fit module¶
- Purpose:
- Compute a fit to the frequency offset using offset frequencies calculated from raw data, sigma-clipping frequencies contaminated by rings, and fitting with a polynomial of order determined by an iterative F-test.
-
class
rss_ringoccs.calibration.freq_offset_fit.
FreqOffsetFit
(rsr_inst, geo_inst, f_uso_x=8427222034.3405, verbose=False, write_file=False)¶ Bases:
object
Purpose: Obtains from calc_freq_offset
, fromcalc_f_sky_recon
. Computes a polynomial fit of F-test specified order to sigma-clipped frequency offset. Final sky frequency is calculated by summing the polynomial fit with the reconstructed sky frequency .- Arguments
rsr_inst (object): object instance of the RSRReader class geo_inst (object): object instance of the Geometry class - Keyword Arguments
f_uso_x (float): frequency in Hz of the X-band ultra-stable oscilator onboard the Cassini spacecraft. Default is 8427222034.3405 Hz. verbose (bool): when True, enables verbose output mode - Attributes:
f_offset_fit (np.ndarray): fit to frequency offset :math:`hat{f}(t)_{offset} f_spm (np.ndarray): SPM at which the offset frequency was sampled f_sky_recon (np.ndarray): reconstructed sky frequency f_offset_fit (np.ndarray): fit to the frequency offset math:hat{f}(t)_{offset} evaluated at f_spm
chi_squared (float): sum of the squared residual difference between the frequency offset and the frequency offset fit normalized by the fit value (Pearson’s ) such that for data and free parameters (i.e., the polynomial order plus one).
-
calc_poly_order
(f_spm_cl, f_offset_cl, verbose=False)¶ Use a variant of the F-test to determine the best order polynomial to use to fit the frequency offset.
- Arguments
f_spm_cl (np.ndarray): SPM sampled by calc_freq_offset
and clipped by the initial boolean mask.f_offset_cl (np.ndarray): carrier frequency offset from center of band
-
create_mask
(f_spm, f_rho, f_offset)¶ Creates a Boolean mask array which excludes data based on the following critera:
- ring or planetary occultation in region prevents accurate estimation of the offset frequency
- offset frequencies fall more than 5-sigma beyond the median offset frequency
- offset frequencies vary by more than 0.25 Hz relative to neighboring offset frequencies
- adjacent data all excluded by previous requirements (excludes noise which by happenstance satisfies the above criteria)
- Arguments
f_spm (np.ndarray): SPM sampled by calc_freq_offset
when calculating the offset frequencies for the occultationf_rho (np.ndarray): ring intercept radius of the spacecraft signal resampled to match f_spm f_offset (np.ndarray): frequency offset - Returns
fsr_mask (np.ndarray): Array of booleons, with True for reliable frequency offset.
-
fit_freq_offset
(f_spm, f_rho, f_offset, verbose=False)¶ Fit a polynomial to frequency offset.
- Arguments
f_spm (np.ndarray): SPM sampled by calc_freq_offset
when calculating the offset frequencies for the occultationf_rho (np.ndarray): ring intercept radius of the spacecraft signal resampled to match f_spm f_offset (np.ndarray): carrier frequency offset from center of band - Keyword Arguments
verbose (bool): If True, print processing steps - Returns
f_offset_fit (np.ndarray): fit to the frequency offset math:hat{f}(t)_{offset} evaluated at f_spm
chi2 (float): sum of the squared residual difference between frequency offset and frequency offset fit normalized by the fit value (Pearson’s ) such that for data and free parameters (i.e., the polynomial order plus one).
-
plotFORFit
(spm, f_offset, fit, mask, spm_min, spm_max, occ_min, occ_max)¶ Plot results of the automated frequency offset fit and save plot to a file. File name will match the .LBL and .TAB nomenclature.
- Arguments
spm (np.ndarray): SPM sampled by calc_freq_offset
when calculating the offset frequencies for the occultationf_offset (np.ndarray): frequency offset fit (np.ndarray): polynomial fit to the frequency offset mask (np.ndarray): boolean array used to mask frequency offset for the polynomial fitting spm_min (float): start of occultation in SPM spm_max (float): end of occultation in SPM