SBART.template_creation.telluric_templates.Telluric_Template#
Classes
BaseClass of a telluric template, with all the necessary functionalities. |
- class TelluricTemplate#
Bases:
BaseTemplate
BaseClass of a telluric template, with all the necessary functionalities.
Inherits from the BaseTemplate, similarly to the stellar templates. The telluric template does not have the same shape as the S2D spectra. As we only need the wavelength regions in which it has detected a feature, we can preserve the original shape of the transmittance spectra.
User parameters:
Parameter name
Mandatory
Default Value
Valid Values
Comment
continuum_percentage_drop
False
1
Inside [0, 100]
[1]
force_download
False
False
boolean
[2]
[1]: Minimum drop (in relation to continuum level) needed to flag a point as a telluric feature
[2]: Force the download of all necessary data products, even if not necessary
Note: Also check the User parameters of the parent classes for further customization options of SBART
- template_type = 'Telluric'#
- method_name = 'Base'#
- __init__(subInst, user_configs=None, extension_mode='lines', application_mode='removal', loaded=False)#
- Parameters:
extension_mode (str, optional) – How to handle with Earth motion during the year. If ‘lines’, compute the template in each possible location for the available observations and only remove the. If “window”, each telluric feature will be extended by a region equal to the maximum BERV. By default: ‘lines’
- property spectra#
- get_data_from_spectral_order(order, include_invalid=False)#
Retrieve a single order from the S2D matrix
- Parameters:
order (int) – Order to retrive
include_invalid (bool) – If False, raise exception when attempting to access data from bad order
- Returns:
np.ndarray – wavelengths
np.ndarray – flux
np.ndarray – uncertainties
np.ndarray – Binary mask of the pixels
- get_data_from_full_spectrum()#
Retrieve the entire spectra. If we are working with S2D data: send the [N_orders, N_pixels] matrix If we are working with S1D data: send a single N_pixels 1-D array with the relevant information
- Returns:
np.ndarray – wavelengths
np.ndarray – Spectra
np.ndarray – Uncertainties
np.ndarray – Spectral mask, a binary mask which is set to one on the pixels to be discarded and zero otherwise.
- load_information_from_DataClass(dataClass)#
- Load the necessary information from the dataClass to generate the models. Loads:
BERV information (for the telluric removal)
Generates the model information (i.e. populates priors and bounds of self._fitModel
- Parameters:
dataClass –
- Return type:
None
- create_telluric_template(dataClass, custom_frameID=None)#
- Return type:
None
- create_binary_template(continuum_level)#
Transform the transmittance spectra into a binary template, based on percentage deviations from the continuum level.
- Parameters:
continuum_level (np.ndarray()) – Continuum level that is estimated by the children classes
- Return type:
None
- property contaminated_regions: list#
- Return type:
list
- property storage_name: str#
- Return type:
str
- property for_feature_removal: bool#
- Return type:
bool
- property for_feature_correction: bool#
- Return type:
bool
- store_metrics()#
- trigger_data_storage(*args, **kwargs)#
Check for validity of the template and, afterwards, trigger the data storage routine
- Parameters:
clobber – If True, delete old disk files before attempting to store the new ones.
- Raises:
FailedStorage – If the template was either loaded or not created
- Return type:
NoReturn
- store_template(clobber)#
Handle deletion of old disk files + apply checks to see if we want to store data to disk
- Parameters:
clobber (
bool
) –- Raises:
FailedStorage – If we attempt to remove the previous version of the template and it was not found on disk. TODO: is this a good idea? I would bet that it isn’t…..
- Return type:
NoReturn
- load_from_file(root_path, loading_path)#
TODO: save and load the actual flag to disk! :type root_path:
Path
:param root_path: :type loading_path:str
:param loading_path:- Return type:
None