pypeit.spectrographs.util module

Spectrograph utility methods.

pypeit.spectrographs.util.load_spectrograph(spec)[source]

Instantiate a spectrograph from the available subclasses of Spectrograph.

Parameters:

spec (str, Spectrograph) – The spectrograph to instantiate. If the input object is None or has Spectrograph as a base class, the instance is simply returned. If it is a string, the string is used to instantiate the relevant spectrograph instance.

Returns:

The spectrograph used to obtain the data to be reduced.

Return type:

Spectrograph

Raises:

PypeItError – Raised if the input is a string that does not select a recognized PypeIt spectrograph.