petitRADTRANS.retrieval.preparing
Useful functions for data reduction.
Module Contents
Functions
|
|
|
|
|
|
|
Remove telluric lines with a polynomial function. |
|
Remove the telluric lines using the weighted arithmetic mean over time. |
|
Remove variable throughput with a polynomial function. |
|
Correct for the variable throughput using the weighted arithmetic mean over wavelength. |
|
Removes the telluric lines and variable throughput of some data. |
- petitRADTRANS.retrieval.preparing.__init_pipeline_outputs(spectrum, reduction_matrix, uncertainties)
- petitRADTRANS.retrieval.preparing.pipeline_validity_test(reduced_true_model, reduced_mock_observations, mock_observations_reduction_matrix=None, mock_noise=None)
- petitRADTRANS.retrieval.preparing.remove_noisy_wavelength_channels(spectrum, reduction_matrix, mean_subtract=False)
- petitRADTRANS.retrieval.preparing.remove_telluric_lines_fit(spectrum, reduction_matrix, airmass, uncertainties=None, mask_threshold=1e-16, polynomial_fit_degree=2, correct_uncertainties=True)
Remove telluric lines with a polynomial function. The telluric transmittance can be written as:
T = exp(-airmass * optical_depth),
- hence the log of the transmittance can be written as a first order polynomial:
log(T) ~ b * airmass + a.
Using a 1st order polynomial might be not enough, as the atmospheric composition can change slowly over time. Using a second order polynomial, as in:
log(T) ~ c * airmass ** 2 + b * airmass + a,
might be safer.
- Args:
spectrum: spectral data to correct reduction_matrix: matrix storing all the operations made to reduce the data airmass: airmass of the data uncertainties: uncertainties on the data mask_threshold: mask wavelengths where the Earth atmospheric transmittance estimate is below this value polynomial_fit_degree: degree of the polynomial fit of the Earth atmospheric transmittance correct_uncertainties:
- Returns:
Corrected spectral data, reduction matrix and uncertainties after correction
- petitRADTRANS.retrieval.preparing.remove_telluric_lines_mean(spectrum, reduction_matrix, uncertainties=None, mask_threshold=1e-16)
Remove the telluric lines using the weighted arithmetic mean over time.
- Args:
spectrum: spectral data to correct reduction_matrix: matrix storing all the operations made to reduce the data uncertainties: uncertainties on the data mask_threshold: mask wavelengths where the Earth atmospheric transmittance estimate is below this value
- Returns:
Corrected spectral data, reduction matrix and uncertainties after correction
- petitRADTRANS.retrieval.preparing.remove_throughput_fit(spectrum, reduction_matrix, wavelengths, uncertainties=None, mask_threshold=1e-16, polynomial_fit_degree=2, correct_uncertainties=True)
Remove variable throughput with a polynomial function.
- Args:
spectrum: spectral data to correct reduction_matrix: matrix storing all the operations made to reduce the data wavelengths: wavelengths of the data uncertainties: uncertainties on the data mask_threshold: mask wavelengths where the Earth atmospheric transmittance estimate is below this value polynomial_fit_degree: degree of the polynomial fit of the Earth atmospheric transmittance correct_uncertainties:
- Returns:
Corrected spectral data, reduction matrix and uncertainties after correction
- petitRADTRANS.retrieval.preparing.remove_throughput_mean(spectrum, reduction_matrix=None, uncertainties=None)
Correct for the variable throughput using the weighted arithmetic mean over wavelength.
- Args:
spectrum: spectral data to correct reduction_matrix: matrix storing all the operations made to reduce the data uncertainties: uncertainties on the data
- Returns:
Corrected spectral data, reduction matrix and uncertainties after correction
- petitRADTRANS.retrieval.preparing.preparing_pipeline(spectrum, uncertainties=None, wavelengths=None, airmass=None, tellurics_mask_threshold=0.1, polynomial_fit_degree=1, apply_throughput_removal=True, apply_telluric_lines_removal=True, correct_uncertainties=True, full=False, **kwargs)
Removes the telluric lines and variable throughput of some data. If airmass is None, the Earth atmospheric transmittance is assumed to be time-independent, so telluric transmittance will be fitted using the weighted arithmetic mean. Otherwise, telluric transmittance are fitted with a polynomial.
- Args:
spectrum: spectral data to correct uncertainties: uncertainties on the data wavelengths: wavelengths of the data airmass: airmass of the data tellurics_mask_threshold: mask wavelengths where the Earth atmospheric transmittance estimate is below this value polynomial_fit_degree: degree of the polynomial fit of the Earth atmospheric transmittance apply_throughput_removal: if True, apply the throughput removal correction apply_telluric_lines_removal: if True, apply the telluric lines removal correction correct_uncertainties: full: if True, return the reduced matrix and reduced uncertainties in addition to the reduced spectrum
- Returns:
Reduced spectral data (and reduction matrix and uncertainties after reduction if full is True)