noraeisner / LATTE

Lightcurve Analysis Tool for Transiting Exoplanet
GNU Lesser General Public License v3.0
39 stars 10 forks source link

About providing variable transit duration for in/out transit flux difference test. #48

Open priyashmistry opened 2 years ago

priyashmistry commented 2 years ago

I was testing LATTE on some TESS targets, and In/Out Transit Flux Difference test seems to be creating inappropriate results, while rest of the tests gave quite good outputs. I checked the source code of LATTE and here it seems to be the problem,

LATTEutils.py, Line 7692:

intr = abs(T0-t) < 0.25  # create a mask of the in transit times
oot = (abs(T0-t) < 0.5) * (abs(T0-t) < 0.3)  # create a mask of the out of transit times

Why you are assuming constant transit duration for every test, and that is also that huge (0.25 + 0.25 = 0.5 days) ? Most of the targets I studied till now has transit duration less than 0.1 - 0.2 days.

Suggestion: Instead of fixing the transit duration you can define new variable (duration) in the function like this,

def plot_in_out_TPF(tic, indir, X4_list, oot_list, t_list, intr_list, T0_list, tpf_filt_list, args, duration):
        ...
        ...
        ...
        intr = abs(T0-t) < (duration/2 + 0.002)  # create a mask of the in transit times
        oot = (abs(T0-t) < 0.5) * (abs(T0-t) > (duration/2 + 0.002))  # create a mask of the out of transit times
priyashmistry commented 2 years ago

@noraeisner Can you please look into this?

exo-pt commented 1 year ago

I also think it would be useful to have a transit duration parameter. Other reason of having sometimes inconsistent results, is concerned with the "mask of the out of transit times". I believe that it's a typo in the signal: Instead of: oot = (abs(T0-t) < 0.5) * (abs(T0-t) < 0.3) # create a mask of the out of transit times? I think it should be: oot = (abs(T0-t) < 0.5) * (abs(T0-t) > 0.3)

orionlee commented 1 year ago

Similar bugs for OOT mask are in per-pixel plot workflow:

In brew_LATTE_FFI(): https://github.com/noraeisner/LATTE/blob/7ac35c8a51949345bc076fd30a456e74fce70c51/LATTE/LATTEbrew.py#L734

In download_TPF(), used by brew_LATTE(): https://github.com/noraeisner/LATTE/blob/7ac35c8a51949345bc076fd30a456e74fce70c51/LATTE/LATTEutils.py#L5361