SBART.Base_Models.TemplateFramework#
Classes
Base Class for the Stellar and Telluric Models. |
- class TemplateFramework#
Bases:
BASE
Base Class for the Stellar and Telluric Models. This class is responsible for:
Trigger the creation of individual templates for each sub-Instrument
Trigerring the template’s disk operations (saving and loading)
Delivering the templates that correspond to a given subInstrument
User parameters:
This class introduces no unique parameters
- model_type = 'Base'#
- template_map = {}#
- __init__(mode, root_folder_path, user_configs=None)#
- Parameters:
mode (
str
) – To be deprecatedroot_folder_path (
Union
[str
,Path
]) – Root path to store the data products of sBARTuser_configs (
Optional
[Dict
[str
,Any
]]) – Configurations for this object, following the provided specifications
- request_data(subInstrument)#
Return the template built for a given subInstrument
- Parameters:
subInstrument (
str
) – subInstrument name- Returns:
The desired template
- Return type:
template
- Raises:
BadTemplateError – If the template was not created
InvalidConfiguration – If the subInstrument doesn’t exist
- Generate_Model(dataClass, template_configs, attempt_to_load=False, store_templates=True)#
Generate a model for all subInstruments with data
- Parameters:
dataClass (
DataClass
) – DataClass with the observationstemplate_configs (
dict
) – Dictionary that passes the user-configurations for the templates that will be created (following the specifications of the chosen template). Currently all sub-Instruments have to share the same configurationattempt_to_load (bool) – Before computing the templates, attempt to load them from the disk location in which it will be stored
store_templates (
bool
) – If True, trigger the data storage routines after creating the templates
- Return type:
None
- load_templates_from_disk()#
Load templates from disk.
- store_templates_to_disk(clobber=False)#
Trigger the data storage routine of all templates stored inside the Model
- Parameters:
clobber (bool) – Whether to delete and re-write over previous outputs
- Return type:
None
- is_type(to_check)#
Check if the Model is of a given type (i.e. Stellar or Telluric)
- Parameters:
to_check (
str
) – Type to check the model against- Returns:
Output of the comparison
- Return type:
bool