lezargus.library.data module#
Data file functions.
This file deals with the loading in and saving of data files which are in the /data/ directory of Lezargus. Moreover, the contents of the data are accessed using attributes of this module.
Also, custom functions are provided to make things which are similarly contained in the data directory. You can find all of these functions under the custom_* namespace.
- lezargus.library.data._zero_buffer_custom_filters(wavelength: ndarray, transmission: ndarray) tuple[ndarray, ndarray] [source]#
Create a zero transmission buffer on either side of the filter.
This function is a convenience function for creating tail ends of created custom filter profiles with zero transmission, as expected.
- Parameters:
wavelength (ndarray) – The original wavelength of the filter.
transmission (ndarray) – The original transmission wavelength of the filter.
- Returns:
zero_wavelength (ndarray) – The wavelength, with added points for the zero section.
zero_transmission (ndarray) – The transmission, with added points for the zero section, of zero.
- lezargus.library.data.add_data_object(name: str, data: object, force: bool = False) None [source]#
Add a data variable to the library data module.
If the addition of a new data object with the same name as one already present, we raise an error as these values are technically constants.
- Parameters:
name (str) – The name of the data object to be added, it will be coerced to be all capitalized as it ought to be effectively a constant.
data (object) – The data object to be added to the data module.
force (bool) – Force the loading of the data object regardless of any critical errors.
- lezargus.library.data.custom_rectangular_filter(lower_limit: float, upper_limit: float) LezargusSpectra [source]#
Make a custom rectangular filter profile.
- Parameters:
lower_limit (float) – The lower limit of the rectangular filter. This value is typically a wavelength.
upper_limit (float) – The upper limit of the rectangular filter. This value is typically a wavelength.
- Returns:
rectangular_filter – The filter, as defined.
- Return type: