calibration Package¶
astro_calibration_source Module¶
Created on Aug 20, 2015
author: cchang
Models taken from: Baars 1997, Hafez 2008, Benz 2009 All numbers divided by 2 to account for the fact that our data is single polarization.
-
seek.calibration.astro_calibration_source.barrs77_power_law(freq, a, b, c)[source]¶ Power law model from Baars 1997.
Parameters: - freq – frequency in Hz
- a – model parameter
- b – model parameter
- c – model parameter
Returns: model spectra
-
seek.calibration.astro_calibration_source.benz_sun(freq)[source]¶ Model of Solar spectra based on Benz 2009.
Parameters: freq – frequency in Hz Returns: model spectra
fitting Module¶
Created on Aug 18, 2015
author: cchang
flux_calibration_transit Module¶
Created on Feb 4, 2016
author: cchang
-
class
seek.calibration.flux_calibration_transit.CalibrationSource(date, azimut, elevation, target)¶ Bases:
tuple-
azimut¶ Alias for field number 1
-
date¶ Alias for field number 0
-
elevation¶ Alias for field number 2
-
target¶ Alias for field number 3
-
-
class
seek.calibration.flux_calibration_transit.GaussFitResult(gauss_A, gauss_x0, gauss_sigma, sky1, sky2, gauss_A_err, gauss_x0_err, gauss_sigma_err, sky1_err, sky2_err, rsquared)¶ Bases:
tuple-
gauss_A¶ Alias for field number 0
-
gauss_A_err¶ Alias for field number 5
-
gauss_sigma¶ Alias for field number 2
-
gauss_sigma_err¶ Alias for field number 7
-
gauss_x0¶ Alias for field number 1
-
gauss_x0_err¶ Alias for field number 6
-
rsquared¶ Alias for field number 10
-
sky1¶ Alias for field number 3
-
sky1_err¶ Alias for field number 8
-
sky2¶ Alias for field number 4
-
sky2_err¶ Alias for field number 9
-
-
seek.calibration.flux_calibration_transit.calibrate(ctx, plot=False)[source]¶ Main function that performs the calibration, including the following steps:
loop through the calibration sources
– find the corresponding list of files
—RFI removal
– for each frequency fit 1D Gaussian to data
—divide amplitude by reference spectra
– store the final pseudo-gain value
take median pseudo-gain over all calibration sources
fit this final spectra with a template derived from Sun
store this final fit to memory
Parameters: ctx – context that contains all parameters for RFI removal and file paths Returns: 2D array with first column frequency and second gain factor
-
seek.calibration.flux_calibration_transit.fit_gaussian_source(data, time_axis, rfi_mask, source_dec, ctx)[source]¶ Given a chunck of 2D data, fit a 1D Gaussian to each frequency. Here only return the amplitude.
Parameters: - data – data
- time_axis – time axis
- rfi_mask – mask
- source_dec – declination coordinate of source
- ctx – context
Returns: amplitude of Gaussian fit
-
seek.calibration.flux_calibration_transit.fit_gaussian_source_full(data, time_axis, rfi_mask, source_dec, params)[source]¶ Given a chunck of 2D data, fit a 1D Gaussian to each frequency. Here return all fitted parameters.
Parameters: - data – data
- time_axis – time axis
- rfi_mask – mask
- source_dec – declination coordinate of source
- params – context parameters
Returns: all Gaussian fit parameters
-
seek.calibration.flux_calibration_transit.fit_sun_to_gain(gauss_amp, freq, params)[source]¶ Takes the array of Gaussian fit parameters and fits the sun template to it. Then calculate the actual gain that converts the map ADU to K.
-
seek.calibration.flux_calibration_transit.process_calibration_transits(calibration_paths, ctx)[source]¶ Derive gain as a function of frequency for each transit measurement.
Parameters: - calibration_paths – path for calibration files
- ctx – context
Returns: gain as a function of frequency
-
seek.calibration.flux_calibration_transit.process_source(source, file_paths, gain_template, sm_kwargs, di_kwargs, ctx)[source]¶ Process a single transit measurement.
Parameters: - source – name of source
- file_paths – file path
- gain_template – template derived from the Sun
- sm_kwargs – SumThreshold parameters
- di_kwargs – SumThreshold parameters
- ctx – context
Returns: parameters for Gaussian fit