astra.utils.continuum.sines_and_cosines¶
Continuum-normalization using sines and cosines.
Module Contents¶
Functions¶
normalize(dispersion, flux, ivar, continuum_regions=None, L=1400, order=3, regions=([3000, 10000], [15090, 15822], [15823, 16451], [16452, 16971]), fill_value=1.0, **kwargs) |
Pseudo-continuum-normalize the flux using a defined set of continuum pixels and a sum of sine |
sines_and_cosines(dispersion, flux, ivar, continuum_pixels, L=1400, order=3, regions=None, fill_value=1.0, **kwargs) |
Fit the flux values of pre-defined continuum pixels using a sum of sine and |
_continuum_design_matrix(dispersion, L, order) |
Build a design matrix for the continuum determination, using sines and |
-
astra.utils.continuum.sines_and_cosines.normalize(dispersion, flux, ivar, continuum_regions=None, L=1400, order=3, regions=([3000, 10000], [15090, 15822], [15823, 16451], [16452, 16971]), fill_value=1.0, **kwargs)¶ Pseudo-continuum-normalize the flux using a defined set of continuum pixels and a sum of sine and cosine functions.
Parameters: - dispersion – The dispersion values.
- flux – The flux values for all pixels, as they correspond to the
dispersionarray. - ivar – The inverse variances for all pixels, as they correspond to the
dispersionarray. - continuum_regions – [optional] A list of two-length tuples that describe the start and end of regions that should be treated as continuum.
- L – [optional] The length scale for the sines and cosines.
- order – [optional] The number of sine/cosine functions to use in the fit.
- regions –
[optional] Specify sections of the spectra that should be fitted separately in each star. This may be due to gaps between CCDs, or some other physically- motivated reason. These values should be specified in the same units as the
dispersion, and should be given as a list of[(start, end), ...]values. For example, APOGEE spectra have gaps near the following wavelengths which could be used asregions:>> regions = ([15090, 15822], [15823, 16451], [16452, 16971])
- fill_value – [optional]
The continuum value to use for when no continuum was calculated for that
particular pixel (e.g., the pixel is outside of the
regions). - full_output – [optional] If set as True, then a metadata dictionary will also be returned.
Returns: The continuum values for all pixels, and a dictionary that contains metadata about the fit.
-
astra.utils.continuum.sines_and_cosines.sines_and_cosines(dispersion, flux, ivar, continuum_pixels, L=1400, order=3, regions=None, fill_value=1.0, **kwargs)¶ Fit the flux values of pre-defined continuum pixels using a sum of sine and cosine functions.
Parameters: - dispersion – The dispersion values.
- flux – The flux values for all pixels, as they correspond to the
dispersionarray. - ivar – The inverse variances for all pixels, as they correspond to the
dispersionarray. - continuum_pixels – A mask that selects pixels that should be considered as ‘continuum’.
- L – [optional] The length scale for the sines and cosines.
- order – [optional] The number of sine/cosine functions to use in the fit.
- regions –
[optional] Specify sections of the spectra that should be fitted separately in each star. This may be due to gaps between CCDs, or some other physically- motivated reason. These values should be specified in the same units as the
dispersion, and should be given as a list of[(start, end), ...]values. For example, APOGEE spectra have gaps near the following wavelengths which could be used asregions:>> regions = ([15090, 15822], [15823, 16451], [16452, 16971])
- fill_value – [optional]
The continuum value to use for when no continuum was calculated for that
particular pixel (e.g., the pixel is outside of the
regions). - full_output – [optional] If set as True, then a metadata dictionary will also be returned.
Returns: The continuum values for all pixels, and a dictionary that contains metadata about the fit.
-
astra.utils.continuum.sines_and_cosines._continuum_design_matrix(dispersion, L, order)¶ Build a design matrix for the continuum determination, using sines and cosines.
Parameters: - dispersion – An array of dispersion points.
- L – The length-scale for the sine and cosine functions.
- order – The number of sines and cosines to use in the fit.