remingtonsexton / BADASS3

Bayesian AGN Decomposition Analysis for SDSS Spectra
MIT License
45 stars 7 forks source link

Strange behavior when fitting with masked regions #10

Closed rremigio closed 1 year ago

rremigio commented 2 years ago

Hello, I have come across some weird behavior when trying to fit spectra when I mask emission lines, in which the fit seems to arrive at a much worse solution if I mask out emission lines.

Here is an example of a "normal" fit to [OIII] and Hbeta newplot (4)

However, if I apply a user mask to the [OIII] doublet and also comment out the appropriate sections from the user_lines dictionary, I end up with a noticeably worse fit: newplot (5)

Lastly, I tried another fit where the same region is masked out, but I did not uncomment the [OIII] lines from my dictionary. The fit inside the masked region is not great, but for some reason the fit to everywhere else is well behaved: newplot (6)

Is there something I can do to get the correct behavior, in which the masked region has zero weight on the fitting? I would expect that for the second trial (second plot), since I am not fitting to [OIII] and that region is masked, the fits outside of that region would be fine (e.g. Hbeta, Fe II, and the stellar template would still be well-constrained).

remingtonsexton commented 2 years ago

@rremigio I know it has been awhile. If this issue is still not resolve please link or post your options and line list and I can try to figure out what went wrong.