mzechmeister / serval

calculate radial velocities from stellar spectra
MIT License
36 stars 9 forks source link

Relaxed double masking after coadding #50

Closed mzechmeister closed 2 years ago

mzechmeister commented 2 years ago

Bad template regions need a masking, too; that's clear. And it is currently done (see also #19). However, the telluric regions are kept masked in the template, albeit tellurics were partly removed after coadding. It is no a serious bug, but more a short coming, since a bit too much is masked. Yet, the double masking for RV computed can be relaxed a bit. The nmap computed in https://github.com/mzechmeister/serval/blob/fe67f54b275d50a1dda44215c691e09e043d9dc4/src/serval.py#L1699 should be useful to update the masking.

Additional note: It should be check how this was handle before restructure into a loop (a5ec780ea0cadc8cfa137dfb94ff45715785ed7a, #7).

mzechmeister commented 2 years ago

An illustration of the issue

serval test autolis/J00570+450.lis -inst CARM_VIS -safemode 2 -targ G_172-030 -look -brvref MH -moonsep 0 -look 25 -lookp 25 -nset 4:

Zero iteration: image The initial template has telluric contamination, which is masked as bad template (magenta residuals, flag: 256 badT). First iteration: image The good template is still masked as bad template (magenta residuals).

mzechmeister commented 2 years ago

So it looks after the fix:

image Note, the initial template is now masked over a larger region, since the masked region should be broadened over the scanned velocity range. The formal uncertainty is somewhat larger in this example (9.24 ms/ vs. 9.36 m/s).

image The template after the first iteration is not masked anymore in cleaned regions. The formal uncertainty decreases somewhat (7.14 ms/ vs. 7.08 m/s).

mzechmeister commented 2 years ago

The motivation to compute the fraction of good data points for each knot: image nmap (nko) varies across the orders due sampling and dispersion changes. With proper normalisation by Nko computed in https://github.com/mzechmeister/serval/blob/a348b4ca77e57b0e9e626f8c9fb147f080cc2418/src/serval.py#L1733 the envelope is flat (blue curve).

mzechmeister commented 4 months ago

The double masking seems to have an issue (https://github.com/mzechmeister/serval/issues/63#issuecomment-1974176214).