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

just two line-fitting rounds and bug fixes #151

Closed moustakas closed 1 year ago

moustakas commented 1 year ago

The test runs with 2.4.0 revealed a computational inconsistency for objects with broad lines that this PR fixes. Briefly, I was originally doing three rounds of emission-line fitting:

The problem with this algorithm is that the final round comes after the broad vs narrow+broad decision has been made so the final numbers don't alway match the numbers used to make the decision. For example, the broad Balmer lines have to be at least 250 km/s, but there are objects that have line-widths less than this threshold because the in the final round the algorithm decides that it likes a narrower line!

So in this PR we only do two rounds of fitting and keep the forbidden and narrow Balmer lines separate in both rounds. Also note that the speed-up is 10%-20% because of the fewer rounds of line-fitting!

I also fixed a few more small bugs and more provenance information is written to the headers such as the name of the emission line and photometry parameter files.

Once tests pass I'm going to tag and regenerate the Fuji VAC.