spectra module¶
Functions to handle loading of spectrum objects
- astrodbkit2.spectra.identify_spex_prism(origin, *args, **kwargs)[source]¶
Confirm this is a SpeX Prism FITS file. See FITS keyword reference at http://irtfweb.ifa.hawaii.edu/~spex/observer/ Notes: GRAT has values of: ShortXD, Prism, LXD_long, LXD_short, SO_long, SO_short
- astrodbkit2.spectra.identify_wcs1d_multispec(origin, *args, **kwargs)[source]¶
Identifier for WCS1D multispec
- astrodbkit2.spectra.load_spectrum(filename: str, spectra_format: str = None, raise_error: bool = False)[source]¶
Attempt to load the filename as a spectrum object
- Parameters:
- filename
Name of the file to read
- spectra_format
Optional file format, passed to Spectrum1D.read. In its absense Spectrum1D.read will attempt to determine the format.
- raise_error
Boolean to control if a failure to read the spectrum should raise an error.
- astrodbkit2.spectra.spex_prism_loader(filename, **kwargs)[source]¶
Open a SpeX Prism file and convert it to a Spectrum1D object
- astrodbkit2.spectra.wcs1d_multispec_loader(file_obj, flux_unit=None, hdu=0, verbose=False, **kwargs)[source]¶
Loader for multiextension spectra as wcs1d. Adapted from wcs1d_fits_loader
- Parameters:
- file_objstr, file-like or HDUList
FITS file name, object (provided from name by Astropy I/O Registry), or HDUList (as resulting from astropy.io.fits.open()).
- flux_unit
Unit
or str, optional Units of the flux for this spectrum. If not given (or None), the unit will be inferred from the BUNIT keyword in the header. Note that this unit will attempt to convert from BUNIT if BUNIT is present.
- hduint
The index of the HDU to load into this spectrum.
- verbosebool
Print extra info.
- **kwargs
Extra keywords for
read_fileobj_or_hdulist()
.
- Returns:
Spectrum1D