desihub / redrock

Redshift fitting for spectroperfectionism
BSD 3-Clause "New" or "Revised" License
22 stars 13 forks source link

chi2 penalty for negative emission lines #215

Open sbailey opened 2 years ago

sbailey commented 2 years ago

Currently redrock has a chi2 penalty when the PCA fit results in negative [OII], but not for other lines. Explore whether adding chi2 penalties against [OIII], Halpha, and Hbeta would help. Don't penalize these if they are in a redshift range that is unconstrained by the data, and subtract the model continuum first.

RaffaellaCapasso commented 2 years ago

I added a chi2 penalty for negative [OIII], and modified the [OII] one so that it also takes into account the continuum (not necessarily showing a negative flux, but a flux lower than the continuum). See pull request 219).

Here are some examples in which the best-fit result presents a negative [OIII] line (red line), but the second best fit does not (blue line).

Targets in “global/cfs/cdirs/desi/users/sjbailey/redrock/example_failures”:

39628432232943703 39628448234213526 39628448234216020

Fuji targets:

39633428106185042 39633438721969162 39633443914515633 39633436100529745 39633430798930477 39633430803120916 39633430803124467

Below are the same fuji targets as above, after having run redrock with the new penalty. The first plot shows in red the original best-fit result, the remaining 5 plots show the new best (red) and second best (blue) fits, zoomed in around relevant wavelengths.

39633428106185042 39633438721969162 39633443914515633 39633436100529745 39633430798930477 39633430803120916 39633430803124467

So far, over 86 original fuji targets with negative OIII line, only 13 retained this feature in their best-fit template. More runs can be made to increase the statistics.

moustakas commented 5 months ago

I think that with non-negative templates and fitting methods, we're moving away from ad-hoc penalization of negative (and unphysical) emission lines, so I propose we close this ticket unless the work is still ongoing.

@RaffaellaCapasso do you have any more recent updates either here or related to #219?