mzechmeister / serval

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

Template masking bug #65

Closed mzechmeister closed 4 months ago

mzechmeister commented 4 months ago

https://github.com/mzechmeister/serval/blob/57b83582d031816b09f4a2b1dfd65d22567e09a2/src/serval.py#L222

It should be self.wk instead of wk, since it might be filtered for finite values in https://github.com/mzechmeister/serval/blob/57b83582d031816b09f4a2b1dfd65d22567e09a2/src/serval.py#L173 or sliced for vsini in https://github.com/mzechmeister/serval/blob/57b83582d031816b09f4a2b1dfd65d22567e09a2/src/serval.py#L191

The effect is only obvious for vsini option.

For regular run, the mask bug did not matter, since there is no broadening and self.wk=wk is ok. Moreover, in the first loop and the spline fitting of spt provided only finite values (ii = full slice): https://github.com/mzechmeister/serval/blob/57b83582d031816b09f4a2b1dfd65d22567e09a2/src/serval.py#L1441 https://github.com/mzechmeister/serval/blob/57b83582d031816b09f4a2b1dfd65d22567e09a2/src/serval.py#L1453

In the second loop another hand there is no badT masking (due to absence of vrange parameter). See also #64. https://github.com/mzechmeister/serval/blob/57b83582d031816b09f4a2b1dfd65d22567e09a2/src/serval.py#L1890

mzechmeister commented 4 months ago

serval test <(head -5 autolis/J18356+329.lis) -inst CARM_VIS -targ LSRJ1835+3259 -safemode 2 -oset 43:52 -snmin 8 -tpl J02530+168 -look -tplvsini 40 With bug (the badT mask (magenta) appears to be shifted to the left, see https://github.com/mzechmeister/serval/issues/63#issuecomment-1983880163 for the unbroadened template): image after fix: image