SpecData¶
- class measure_extinction.stardata.SpecData(type)[source]¶
Bases:
object
Spectroscopic data (used by StarData)
Attributes:
- wavesarray of floats
wavelengths
- fluxesarray of floats
fluxes
- uncsarray of floats
uncertainties on the fluxes
- nptsarray of floats
number of measurements contributing to the flux points
- n_wavesint
number of wavelengths
- wmin, wmaxfloats
wavelength min and max
- Parameters:
- type: string
descriptive string of type of data (e.g., IUE, FUSE, IRS)
Methods Summary
read_fuse
(line[, path])Read in FUSE spectra
read_irs
(line[, path, use_corfac, corfac])Read in Spitzer/IRS spectra
read_iue
(line[, path])Read in IUE spectra
read_miri_ifu
(line[, path])Read in Webb/MRS IFU spectra
read_spectra
(line[, path])Read spectra from a FITS file
read_spex
(line[, path, use_corfac, corfac])Read in SpeX spectra
read_stis
(line[, path])Read in STIS spectra
rebin_constres
(waverange, resolution)Rebin the spectrum to a fixed spectral resolution and min/max wavelength range.
Methods Documentation
- read_fuse(line, path='./')[source]¶
Read in FUSE spectra
Converts the wavelengths from Anstroms to microns
- Parameters:
- linestring
formatted line from DAT file example: ‘STIS = hd029647_fuse.fits’
- pathstring, optional
location of the FITS files path
- Returns:
- Updates self.(file, wave_range, waves, flux, uncs, npts, n_waves)
- read_irs(line, path='./', use_corfac=True, corfac=None)[source]¶
Read in Spitzer/IRS spectra
Correct the IRS spectra if the appropriate corfacs are present in the DAT file. Does a multiplicative correction that can include a linear term if corfac_irs_zerowave and corfac_irs_slope factors are present. Otherwise, just apply a multiplicative factor based on corfac_irs.
- Parameters:
- linestring
formatted line from DAT file example: ‘IRS = hd029647_irs.fits’
- pathstring, optional
location of the FITS files path
- corfacdict of key: coefficients
keys identify the spectrum to be corrected and how
- Returns:
- Updates self.(file, wave_range, waves, flux, uncs, npts, n_waves)
- read_iue(line, path='./')[source]¶
Read in IUE spectra
Removes data with wavelengths > 3200 A Converts the wavelengths from Anstroms to microns
- Parameters:
- linestring
formatted line from DAT file example: ‘IUE = hd029647_iue.fits’
- pathstring, optional
location of the FITS files path
- Returns:
- Updates self.(file, wave_range, waves, flux, uncs, npts, n_waves)
- read_miri_ifu(line, path='./')[source]¶
Read in Webb/MRS IFU spectra
- Parameters:
- linestring
formatted line from DAT file example: ‘IRS = hd029647_irs.fits’
- pathstring, optional
location of the FITS files path
- Returns:
- Updates self.(file, wave_range, waves, flux, uncs, npts, n_waves)
- read_spectra(line, path='./')[source]¶
Read spectra from a FITS file
FITS file has a binary table in the 1st extension Header needs to have:
wmin, wmax : min/max of wavelengths in file
Expected columns are:
wave
flux
sigma [uncertainty in flux units]
npts [number of observations include at this wavelength]
- Parameters:
- linestring
formatted line from DAT file example: ‘IUE = hd029647_iue.fits’
- pathstring, optional
location of the FITS files path
- Returns:
- Updates self.(file, wave_range, waves, flux, uncs, npts, n_waves)
- read_spex(line, path='./', use_corfac=True, corfac=None)[source]¶
Read in SpeX spectra
- Parameters:
- linestring
formatted line from DAT file example: ‘SpeX = hd029647_spex.fits’
- pathstring, optional
location of the FITS files path
- corfacdict of key: coefficients
keys identify the spectrum to be corrected and how
- Returns:
- Updates self.(file, wave_range, waves, flux, uncs, npts, n_waves)
- read_stis(line, path='./')[source]¶
Read in STIS spectra
Converts the wavelengths from Anstroms to microns
- Parameters:
- linestring
formatted line from DAT file example: ‘STIS = hd029647_stis.fits’
- pathstring, optional
location of the FITS files path
- Returns:
- Updates self.(file, wave_range, waves, flux, uncs, npts, n_waves)
- rebin_constres(waverange, resolution)[source]¶
Rebin the spectrum to a fixed spectral resolution and min/max wavelength range.
- Parameters:
- waverange2 element array of astropy Quantities
Min/max of wavelength range with units
- resolutionfloat
Spectral resolution of rebinned spectrum
- Returns:
- measure_extinction SpecData
Object with rebinned spectrum