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

bug: if one component of a doublet is dropped, the second one isn't (necessarily) #172

Closed moustakas closed 1 day ago

moustakas commented 3 months ago

@jdbuhler has pointed out that when one component of a doublet (e.g., [OII] 3726) is dropped during optimization, the companion member of the doublet (e.g., [OII] 3729) isn't dropped.

Specifically, something like

lineamps[doubletindx] *= lineamps[doubletpair]

should be added here, right after the tied constraints are applied: https://github.com/desihub/fastspecfit/blob/main/py/fastspecfit/emlines.py#L972-L975

It looks like this bug impacts roughly 17,000 (out of 18M) [OII] measurements in Iron (<0.1%), and just ~700 objects (out of 1.4M) in Fuji.

moustakas commented 1 day ago

Fixed in #177.