hippke / tls

Transit Least Squares: An optimized transit-fitting algorithm to search for periodic transits of small planets
MIT License
48 stars 25 forks source link

why do we multiply by 2? #72

Closed MilevaE closed 5 years ago

MilevaE commented 5 years ago

Is an existing functionality incorrectly or not sufficiently described in the documentation? In the tutorials, there is one multiplication which I do not understand. In fact, I noticed that is always done when call the function transit_mask. Here an example:

from transitleastsquares import transit_mask, cleaned_array
intransit = transit_mask(t, results.period, 2*results.duration, results.T0)
y_second_run = y_filt[~intransit]
t_second_run = t[~intransit]
t_second_run, y_second_run = cleaned_array(t_second_run, y_second_run)

So, what I mean is the 2*results.duration part.

Why is needed?

Thanks in advance and my apologies if is obvious!

hippke commented 5 years ago

As with any measured quantity, there is uncertainty in the true value of the transit duration. Taking twice the measured value should clear the in-transit points completely. Downside is, you loose some out of transit points as well. You can use a smaller value if that works for your purpose.

MilevaE commented 5 years ago

thanks a lot!