FIREFLY Spectra

This class is dedicated to handling the observed / input spectra to be fed in the FIREFLY code.

General purpose:

The class GalaxySpectrumFIREFLY is dedicated to handling spectra to be fed to FIREFLY for fitting its stellar population

Imports:

import numpy as np
import astropy.io.fits as pyfits
import glob
from firefly_dust import get_dust_radec
class GalaxySpectrumFIREFLY.GalaxySpectrumFIREFLY(path_to_spectrum, milky_way_reddening=True, hpf_mode='on', N_angstrom_masked=20.0)[source]

Loads the environnement to transform observed spectra into the input for FIREFLY.

Currently SDSS spectra, speclite format is handled as well as stacks from the VVDS and the DEEP2 galaxy surveys.

Parameters:
  • path_to_spectrum – path to the spectrum
  • milky_way_reddening – True if you want to correct from the Milky way redenning using the Schlegel 98 dust maps.
  • hpf_mode – models the dust attenuation observed in the spectrum using high pass filter.
  • survey – name of the survey
  • N_angstrom_masked – number ofangstrom masked around emission lines to look only at the continuum spectrum
In this aims, it stores the following data in the object :
  • hdu list from the spec lite
  • SED data : wavelength (in angstrom), flux, error on the flux (in 10^{-17} erg/cm2/s/Angstrom, like the SDSS spectra)
  • Metadata :
    • ra : in degrees J2000
    • dec : in degrees J2000
    • redshift : best fit
    • vdisp : velocity dispersion in km/s
    • r_instrument : resolution of the instrument at each wavelength observed
    • trust_flag : 1 or True if trusted
    • bad_flags : ones as long as the wavelength array, filters the pixels with bad data
    • objid : object id optional : set to 0
measure_SNR_SDSS_spectrum(survey='sdssMain')[source]

It reads an SDSS spectrum and computes median SNR values in the three bands related to each library.

The dr12 sky mask lists observed-frame wavelengths (A) where the variance of the co-added sky-subtracted sky fibers is significantly higher than from the surrounding sky continuum. To use the mask, veto any pixels whose observed lambda satisfies

It is a SDSS/BOSS/eBOSS Ly alpha product.

The reference describing it is Lee, Khee-Gan et al. 2012 http://adsabs.harvard.edu/abs/2013AJ….145…69L

for each lambda of the spectrum A margin of 1 corresponds to one co-added pixel. Use margin = 2 to add an extra pixel of padding. A recommended margin is 1.5. margin = 1.5 selection = abs(10000.*np.log10(lambda/maskLambda)) <= margin

openGAMAsimulatedSpectrum(error_multiplicative_factor=1.0)[source]

Opens the smulated data set filename = os.path.join(os.environ[‘DATA_DIR’], “spm”, “GAMAmock/gal_0000_GAMA_M10_z0.15.dat”)

openILLUSTRISsimulatedSpectrum(fractional_error=0.1)[source]

Reads the simulated spectra and converts it to the inputs needed by firefly.

openObservedDEEP2pectrum(catalog_entry, survey='deep2')[source]

It reads a VVDS spectrum and provides the input for the firefly fitting routine.

openObservedMANGASpectrum(data_release, path_to_logcube, path_to_drpall, bin_number, plate_number, ifu_number)[source]

Loads an observed MaNGA spectrum in. :param data_release: Must specify which data release of MaNGA you are using, as file structure has changed. :param data_release: Must specify the path to logcube (if using MPL5 or higher). Set to 0 otherwise.

openObservedMuseSpectrum(catalog)[source]

Loads an observed MUSE spectrum in counts. :param catalog: name of the catalog with redshifts.

openObservedSDSSSpectrum(survey='sdssMain')[source]

It reads an SDSS spectrum and provides the input for the firefly fitting routine.

In this aims, it stores the following data in the object : * hdu list from the spec lite * SED data : wavelength (in angstrom), flux, error on the flux (in 10^{-17} erg/cm2/s/Angstrom, like the SDSS spectra) * Metadata :

  • ra : in degrees J2000
  • dec : in degrees J2000
  • redshift : best fit
  • vdisp : velocity dispersion in km/s
  • r_instrument : resolution of the instrument at each wavelength observed
  • trust_flag : 1 or True if trusted
  • bad_flags : ones as long as the wavelength array, filters the pixels with bad data
  • objid : object id optional : set to 0
openObservedStack(fluxKeyword='medianWeightedStack')[source]

It reads an Stack spectrum from the LF analysis and provides the input for the firefly fitting routine. :param fluxKeyword: parameter to choose the mean or the median stack ‘meanWeightedStack’, ‘medianWeightedStack’

openObservedStackTutorial()[source]

It reads an Stack spectrum from the LF analysis and provides the input for the firefly fitting routine. :param path_to_spectrum: :param sdss_dir: directory with the observed spectra :param milky_way_reddening: True or False if you want to correct the redenning of the Milky way. :param hpf_mode: ‘on’ high pass filters the data to correct from dust in the galaxy.

In this aims, it stores the following data in the object : * hdu list from the spec lite * SED data : wavelength (in angstrom), flux, error on the flux (in 10^{-17} erg/cm2/s/Angstrom, like the SDSS spectra) * Metadata :

  • ra : in degrees J2000
  • dec : in degrees J2000
  • redshift : best fit
  • vdisp : velocity dispersion in km/s
  • r_instrument : resolution of the instrument at each wavelength observed
  • trust_flag : 1 or True if trusted
  • bad_flags : ones as long as the wavelength array, filters the pixels with bad data
  • objid : object id optional : set to 0
openObservedVIPERSpectrum(catalog_entry, survey='vipers')[source]

It reads a VVDS spectrum and provides the input for the firefly fitting routine.

openObservedVVDSpectrum(catalog_entry, survey='vvds')[source]

It reads a VVDS spectrum and provides the input for the firefly fitting routine.

remove_power_law(A_pl, lambda_pl, alpha_pl, A_bc, B_TE, tau_be, lambda_be)[source]

Computes the power law for the given wet of parameters output by QSFIT

http://adsabs.harvard.edu/abs/2017MNRAS.472.4051C

A is the luminosity density at 3000 A in 10e42 erg s-1 A-1 B lambda (Te ) is the blackbody function at the electron temperature T e, tau BE is the optical depth at the Balmer edge and lambda BE is the edge wavelength (3645 A).