SBART.Base_Models.Template_Model#
Classes
Base Class for all Templates (both telluric and stellar). |
- class BaseTemplate#
Bases:
Spectrum
Base Class for all Templates (both telluric and stellar). Implements validity checks, base routines for data storage and “outside” interface to request data
User parameters:
This object doesn’t introduce unique user parameters.
Note: Check the User parameters of the parent classes for further customization options of this class
- method_name = 'Base'#
- template_type = 'Base'#
- __init__(subInst, user_configs, loaded=False)#
- Parameters:
subInst (
str
) – sub-Instrument for which the template is going to be createduser_configs (
Optional
[dict
]) – Dictionary with the keys and values of the user parameters that have been described aboveloaded – True if the template was loaded from disk.
- trigger_data_storage(clobber)#
Check for validity of the template and, afterwards, trigger the data storage routine
- Parameters:
clobber (
bool
) – 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:
None
- load_from_file(root_path, loading_path)#
Interface to load a template from disk
TODO: we don’t really need the loading path… the root_path is enough for what we want to do…
- Parameters:
root_path – Root path for the template
loading_path (
str
) – Path to the actual template
- Raises:
NoDataError – If we attempt to load from a path that does not exist
- Return type:
None
- is_type(type_to_test)#
- Parameters:
type_to_test (
str
) – Check if the template is of a given type (i.e. Stellar or Telluric)- Returns:
result – True if the types match.
- Return type:
bool
- mark_as_invalid()#
Change the status of the template into a Failed State. This will make all of the future validity tests fail!
- Return type:
NoReturn
- property was_loaded: bool#
returns: result – True if the template was loaded :rtype: bool
- property sub_instrument#
- property spectrum_information#
- property name: str#
- Return type:
str
- property storage_name: str#
- Return type:
str