pypeit.spectrographs.util module
Spectrograph utility methods.
- pypeit.spectrographs.util.load_spectrograph(spec, pypeit_fits=False)[source]
Instantiate a spectrograph from the available subclasses of
Spectrograph.- Parameters:
spec (
str,Spectrograph) – The spectrograph to instantiate. If the input object isNoneor hasSpectrographas a base class, the instance is simply returned. If it is a string, the string is used to instantiate the relevant spectrograph instance.pypeit_fits (
bool, optional) – The spectrograph loader is being called from a post-processing script where the expected input files are PypeIt-written FITS files only. This has the effect of overriding theallowed_extensionsattribute to be[".fits"].
- Returns:
The spectrograph used to obtain the data to be reduced.
- Return type:
- Raises:
PypeItError – Raised if the input is a string that does not select a recognized PypeIt spectrograph.