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 f(t)_{offset} from calc_freq_offset, f(t)_{dr} from calc_f_sky_recon. Computes a polynomial fit \hat{f}(t)_{offset} of F-test specified order to sigma-clipped frequency offset. Final sky frequency \hat{f}(t)_{sky} is calculated by summing the polynomial fit \hat{f}(t)_{offset} with the reconstructed sky frequency f(t)_{dr}.
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(t)_{dr}
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 \chi^2) such that \chi^2 = \frac{1}{N-m}
\sum((\hat{f}(t)_{offset}-f(t)_{offset})
/\hat{f}(t)_{offset})^2 for N data and m 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:

  1. ring or planetary occultation in region prevents accurate estimation of the offset frequency
  2. offset frequencies fall more than 5-sigma beyond the median offset frequency
  3. offset frequencies vary by more than 0.25 Hz relative to neighboring offset frequencies
  4. 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 occultation
f_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 occultation
f_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 \chi^2) such that \chi^2 = \frac{1}{N-m}
\sum((\hat{f}(t)_{offset}-f(t)_{offset})
/\hat{f}(t)_{offset})^2 for N data and m 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 occultation
f_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