desihub / fastspecfit

Fast spectral synthesis and emission-line fitting of DESI spectra.
https://fastspecfit.readthedocs.org
BSD 3-Clause "New" or "Revised" License
13 stars 2 forks source link

EWs are incorrect by a factor of (1+z)^2 #86

Closed moustakas closed 1 year ago

moustakas commented 1 year ago

@araichoor pointed out a terribly embarrassing bug in my EWs: the factor of 1+z should be in the denominator, not the numerator-- https://github.com/desihub/fastspecfit/blob/main/py/fastspecfit/emlines.py#L1554

I thought I had checked these EWs against SDSS, pPXF, and other codes, but somehow this wrong factor slipped through. I'll do some additional checks before making this change, but this will definitely be fixed in the next version of FastSpecFit.

araichoor commented 1 year ago

actually, the credits go to Christophe M. from saclay. he noticed that in desispec.emlinefit.emlines_gaussfit(), which I ll have to also modify, btw.

moustakas commented 1 year ago

Here's a quick comparison with the Portsmouth SDSS catalog-- https://data.sdss.org/datamodel/files/BOSS_GALAXY_REDUX/GALAXY_VERSION/portsmouth_emlinekin_full.html

This definitely shows that I messed up the factor of (1+z). In particular, all measurements are done in the observed frame and there's no factor of 1+z in the integrated flux, but the continuum flux (in the denominator) needs to be multiplied by (1+z) to move it to the rest frame. So my factor here should be

factor = 1 / ((1 + redshift) * result['{}_CONT'.format(linename)]) # --> rest frame
Screen Shot 2022-10-20 at 8 12 13 PM

Edit: my plot says "delta" but it's a ratio of EWs.