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

period_max can not exceed the default value? #70

Closed MilevaE closed 5 years ago

MilevaE commented 5 years ago

Hi all,

not sure if this is a bug or I mistook how use the period_max flag. My apologies in advance if I'm doing something wrong.

Describe the bug When I try to increase the period_max , this only can be modify if the new value is lower than the default value.

To Reproduce

url = 'https://archive.stsci.edu/hlsps/tess-data-alerts/hlsp_tess-data-alerts_tess_phot_00259377017-s03_tess_v1_lc.fits'
hdu = fits.open(url)
time = hdu[1].data['TIME']
flux = hdu[1].data['PDCSAP_FLUX']  # values with non-zero quality are nan or zero'ed
time, flux = cleaned_array(time, flux)  # remove invalid values such as nan, inf, non, negative
flux = flux / numpy.median(flux)  #to have the relative flux

TIC_ID = hdu[0].header['TICID']
ab, mass, mass_min, mass_max, radius, radius_min, radius_max = catalog_info(TIC_ID=TIC_ID)
print('Searching with limb-darkening estimates using quadratic LD (a,b)=', ab)

model = transitleastsquares(time, flux)
results = model.power(period_max=15,u=ab)

So, as one can see I set the period_max flag as 15, because I know that the data has a planet which period is ~11.4. The default value is 10.133 days. This is what I obtain when I run:

Searching with limb-darkening estimates using quadratic LD (a,b)= (0.1604, 0.4325) Transit Least Squares TLS 1.0.23 (12 March 2019) Creating model cache for 26 durations Searching 13452 data points, 1744 periods from 0.601 to 10.133 days

So, unfortunately I miss the planet.

Desktop (please complete the following information):

Additional context Thanks for your help and congrats for this amazing tool!

hippke commented 5 years ago

Perhaps the time series is too short for 2 transits (the default in TLS?) Try to add n_transits_min=1. Does that fix it?

hippke commented 5 years ago

I tried it myself, it indeed solves it. Very interesting light curve: There appear to be 3 double-transits spaced ~5.66 days apart? One close to the gap? What are these double dips?

MilevaE commented 5 years ago

It is TOI-270 (Gunther et al. 2019). I was trying to reproduce with TLS this detection:

Screenshot from 2019-06-07 18-24-03

So, these double dips corresponds with a double transits. The one in the middle just one of them.

Indeed, your solutions works perfect! Thanks! I was thinking that by default n_transits_min is 2 .. So, I don't understand why we need to set 1 to make it works, I mean, each planet has at least two transits...

hippke commented 5 years ago

yeah, that definition is a bit strange (but I didn't invent it). with n_transits_min=2 you have always at least 2 transits (without gaps). It's a minimum requirement. Usually the placement in time is fortunate enough to provide +1 transit.

MilevaE commented 5 years ago

I get it! Thanks a lot for your clarifications :)

I close the issue ;)