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

Discrepancy between DN4000_OBS and DN4000(no lines) #131

Closed dirkscholte closed 1 year ago

dirkscholte commented 1 year ago

When plotting DN4000_OBS and DN4000 I found that their values are very different. The plots below are using data from the fuji v2.0, guadalupe v2.0 and iron v1.0 catalogs. The log(Mstar) vs DN4000_OBS plot looks as expected but the DN4000 does not. Selection is BGS galaxies between 0.05<z<0.09.

image
dirkscholte commented 1 year ago

Just adding a few other plots that I had lying around. In case they might be useful. The yellow bands at z ~0.45 and ~0.9 is where the 4000A break passes through the edges of the different cameras.

DN4000_OBS: Looking as expected! image

DN4000: image

moustakas commented 1 year ago

@dirkscholte thank you for this report. This is a clear bug in DN4000 right here: https://github.com/desihub/fastspecfit/blob/2.1.2/py/fastspecfit/emlines.py#L2624

TL;DR: in my call to get_dn4000() I should have explicitly set rest=True; the line-free spectra I'm passing are in the observed frame but even though I'm passing the redshift to move things in the rest-frame, get_dn4000() doesn't use this redshift if rest=True, which is the default for the code, blarg!