Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions LATTE/LATTE_DV.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,18 +685,19 @@ def addPageNumber(canvas, doc):
data_bls= [['Parameter', "bls1", "bls2"],
['period', "{:.3f}".format(bls_stats1[0]), "{:.3f}".format(bls_stats2[0])],
['t0', "{:.2f}".format(bls_stats1[1]), "{:.2f}".format(bls_stats2[1])],
['depth', "{:.5f} ± {:.5f}".format(bls_stats1[2][0],bls_stats1[2][1]), "{:.5f} ± {:.5f}".format(bls_stats2[2][0],bls_stats2[2][1]) ],
['depth phased', "{:.5f} ± {:.5f}".format(bls_stats1[3][0],bls_stats1[3][1]), "{:.5f} ± {:.5f}".format(bls_stats2[3][0],bls_stats2[3][1]) ],
['depth half', "{:.5f} ± {:.5f}".format(bls_stats1[4][0],bls_stats1[4][1]), "{:.5f} ± {:.5f}".format(bls_stats2[4][0],bls_stats2[4][1]) ],
['depth odd', "{:.5f} ± {:.5f}".format(bls_stats1[5][0],bls_stats1[5][1]), "{:.5f} ± {:.5f}".format(bls_stats2[5][0],bls_stats2[5][1]) ],
['depth even', "{:.5f} ± {:.5f}".format(bls_stats1[6][0],bls_stats1[6][1]), "{:.5f} ± {:.5f}".format(bls_stats2[6][0],bls_stats2[6][1]) ],
['duration', "{:.5f}".format(bls_stats1[2]), "{:.5f}".format(bls_stats2[2])],
['depth', "{:.5f} ± {:.5f}".format(bls_stats1[3][0],bls_stats1[3][1]), "{:.5f} ± {:.5f}".format(bls_stats2[3][0],bls_stats2[3][1]) ],
['depth phased', "{:.5f} ± {:.5f}".format(bls_stats1[4][0],bls_stats1[4][1]), "{:.5f} ± {:.5f}".format(bls_stats2[4][0],bls_stats2[4][1]) ],
['depth half', "{:.5f} ± {:.5f}".format(bls_stats1[5][0],bls_stats1[5][1]), "{:.5f} ± {:.5f}".format(bls_stats2[5][0],bls_stats2[5][1]) ],
['depth odd', "{:.5f} ± {:.5f}".format(bls_stats1[6][0],bls_stats1[6][1]), "{:.5f} ± {:.5f}".format(bls_stats2[6][0],bls_stats2[6][1]) ],
['depth even', "{:.5f} ± {:.5f}".format(bls_stats1[7][0],bls_stats1[7][1]), "{:.5f} ± {:.5f}".format(bls_stats2[7][0],bls_stats2[7][1]) ],
]

table_bls=Table(data_bls)
table_bls=Table(data_bls,colWidths=width * 0.2, style=[
('LINEABOVE',(0,1),(-1,1),1,colors.black),
('LINEABOVE',(0,8),(-1,8),1,colors.black),
('FONTSIZE', (0,0),(-1,7), 8),
('LINEABOVE',(0,9),(-1,9),1,colors.black),
('FONTSIZE', (0,0),(-1,8), 8),
])

else: # if the first BLS returned a period that was very short such that the second one didn't work.
Expand Down Expand Up @@ -738,17 +739,18 @@ def addPageNumber(canvas, doc):
data_bls= [['Parameter', "bls1" ],
['period', "{:.3f}".format(bls_stats1[0]) ],
['t0', "{:.2f}".format(bls_stats1[1]) ],
['depth', "{:.5f} ± {:.5f}".format(bls_stats1[2][0],bls_stats1[2][1]) ],
['depth phased', "{:.5f} ± {:.5f}".format(bls_stats1[3][0],bls_stats1[3][1]) ],
['depth half', "{:.5f} ± {:.5f}".format(bls_stats1[4][0],bls_stats1[4][1]) ],
['depth odd', "{:.5f} ± {:.5f}".format(bls_stats1[5][0],bls_stats1[5][1]) ],
['depth even', "{:.5f} ± {:.5f}".format(bls_stats1[6][0],bls_stats1[6][1]) ],
['duration', "{:.5f}".format(bls_stats1[2]) ],
['depth', "{:.5f} ± {:.5f}".format(bls_stats1[3][0],bls_stats1[3][1]) ],
['depth phased', "{:.5f} ± {:.5f}".format(bls_stats1[4][0],bls_stats1[4][1]) ],
['depth half', "{:.5f} ± {:.5f}".format(bls_stats1[5][0],bls_stats1[5][1]) ],
['depth odd', "{:.5f} ± {:.5f}".format(bls_stats1[6][0],bls_stats1[6][1]) ],
['depth even', "{:.5f} ± {:.5f}".format(bls_stats1[7][0],bls_stats1[7][1]) ],
]

table_bls=Table(data_bls)
table_bls=Table(data_bls,colWidths=width * 0.25, style=[
('LINEABOVE',(0,1),(-1,1),1,colors.black),
('LINEABOVE',(0,8),(-1,8),1,colors.black),
('LINEABOVE',(0,9),(-1,9),1,colors.black),
('FONTSIZE', (0,0),(-1,7), 8),
])

Expand Down
14 changes: 10 additions & 4 deletions LATTE/LATTEutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5824,6 +5824,7 @@ def data_bls(tic, indir, alltime, allflux, allfluxbinned, alltimebinned, args):
two lists of the statistics of the to BLS runs. Each list contains:
stats_period
stats_t0
stats_duration
stats_depth
stats_depth_phased
stats_depth_half
Expand Down Expand Up @@ -5909,6 +5910,7 @@ def data_bls(tic, indir, alltime, allflux, allfluxbinned, alltimebinned, args):

stats_period = period
stats_t0 = mid_transit_t0
stats_duration = duration
stats_depth = model.compute_stats(period, duration, t0)['depth']
stats_depth_phased = model.compute_stats(period, duration, t0)['depth_phased']
stats_depth_half = model.compute_stats(period, duration, t0)['depth_half']
Expand All @@ -5917,7 +5919,7 @@ def data_bls(tic, indir, alltime, allflux, allfluxbinned, alltimebinned, args):


if (2*duration) >= period: # if the 'found' events are very short period, don't rn the BLS twice as the code would crash.
return [stats_period, stats_t0, stats_depth, stats_depth_phased, stats_depth_half, stats_depth_odd, stats_depth_even], [-999]
return [stats_period, stats_t0, stats_duration, stats_depth, stats_depth_phased, stats_depth_half, stats_depth_odd, stats_depth_even], [-999]

# Find the in-transit points using a longer duration as a buffer to avoid ingress and egress
in_transit = model.transit_mask(alltimebinned, period, 2*duration, t0)
Expand All @@ -5939,13 +5941,14 @@ def data_bls(tic, indir, alltime, allflux, allfluxbinned, alltimebinned, args):

stats2_period = period2
stats2_t0 = mid_transit_t02
stats2_duration = duration2
stats2_depth = model2.compute_stats(period2, duration2, t0)['depth']
stats2_depth_phased = model2.compute_stats(period2, duration2, t0)['depth_phased']
stats2_depth_half = model2.compute_stats(period2, duration2, t0)['depth_half']
stats2_depth_odd = model2.compute_stats(period2, duration2, t0)['depth_odd']
stats2_depth_even = model2.compute_stats(period2, duration2, t0)['depth_even']

return [stats_period, stats_t0, stats_depth, stats_depth_phased, stats_depth_half, stats_depth_odd, stats_depth_even], [stats2_period, stats2_t0, stats2_depth, stats2_depth_phased, stats2_depth_half, stats2_depth_odd, stats2_depth_even]
return [stats_period, stats_t0, stats_duration, stats_depth, stats_depth_phased, stats_depth_half, stats_depth_odd, stats_depth_even], [stats2_period, stats2_t0, stats2_duration, stats2_depth, stats2_depth_phased, stats2_depth_half, stats2_depth_odd, stats2_depth_even]

def data_bls_FFI(tic, indir, alltime, allflux, args):
'''
Expand All @@ -5967,6 +5970,7 @@ def data_bls_FFI(tic, indir, alltime, allflux, args):
two lists of the statistics of the to BLS runs. Each list contains:
stats_period
stats_t0
stats_duration
stats_depth
stats_depth_phased
stats_depth_half
Expand Down Expand Up @@ -6004,6 +6008,7 @@ def data_bls_FFI(tic, indir, alltime, allflux, args):

stats_period = period
stats_t0 = t0
stats_duration = duration
stats_depth = model.compute_stats(period, duration, t0)['depth']
stats_depth_phased = model.compute_stats(period, duration, t0)['depth_phased']
stats_depth_half = model.compute_stats(period, duration, t0)['depth_half']
Expand All @@ -6012,7 +6017,7 @@ def data_bls_FFI(tic, indir, alltime, allflux, args):


if (2*duration) >= period: # if the 'found' events are very short period, don't rn the BLS twice as the code would crash.
return [stats_period, stats_t0, stats_depth, stats_depth_phased, stats_depth_half, stats_depth_odd, stats_depth_even], [-999]
return [stats_period, stats_t0, stats_duration, stats_depth, stats_depth_phased, stats_depth_half, stats_depth_odd, stats_depth_even], [-999]


# Find the in-transit points using a longer duration as a buffer to avoid ingress and egress
Expand All @@ -6033,13 +6038,14 @@ def data_bls_FFI(tic, indir, alltime, allflux, args):

stats2_period = period2
stats2_t0 = t02
stats2_duration = duration2
stats2_depth = model2.compute_stats(period2, duration2, t0)['depth']
stats2_depth_phased = model2.compute_stats(period2, duration2, t0)['depth_phased']
stats2_depth_half = model2.compute_stats(period2, duration2, t0)['depth_half']
stats2_depth_odd = model2.compute_stats(period2, duration2, t0)['depth_odd']
stats2_depth_even = model2.compute_stats(period2, duration2, t0)['depth_even']

return [stats_period, stats_t0, stats_depth, stats_depth_phased, stats_depth_half, stats_depth_odd, stats_depth_even], [stats2_period, stats2_t0, stats2_depth, stats2_depth_phased, stats2_depth_half, stats2_depth_odd, stats2_depth_even]
return [stats_period, stats_t0, stats_duration, stats_depth, stats_depth_phased, stats_depth_half, stats_depth_odd, stats_depth_even], [stats2_period, stats2_t0, stats2_duration, stats2_depth, stats2_depth_phased, stats2_depth_half, stats2_depth_odd, stats2_depth_even]

# --------------------------------------------
# plots #
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The code is designed to be fully interactive and does not require any prior know

### Installation

LATTE requires python3 to be installed on your computer, which can be download from https://www.python.org/downloads/. Once you have python3, you can download the code directly from github. Alternatively, you can install LATTE using pip (https://pypi.org/project/tessLATTE/) via your command line with:
LATTE requires python3 (*recommendation: `python==3.7`*) to be installed on your computer, which can be download from https://www.python.org/downloads/. Once you have python3, you can download the code directly from github. Alternatively, you can install LATTE using pip (https://pypi.org/project/tessLATTE/) via your command line with:

pip3 install tessLATTE

Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@
"matplotlib == 3.2.0",
"astroplan",
"astroquery",
"sklearn",
"scikit-learn",
"scipy",
"tess-point",
"reproject > 0.7",
"reportlab",
"astropy <= 4.0",
"mock > 2.0.0"],
"mock > 2.0.0",
"urllib3==1.26.6"],
entry_points={
"console_scripts": [
"LATTE=LATTE.__main__:main",
Expand Down
3 changes: 2 additions & 1 deletion tessLATTE.egg-info/requires.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ lightkurve>1.2.0
matplotlib==3.2.0
astroplan
astroquery
sklearn
scikit-learn
scipy
tess-point
reproject>0.7
reportlab
astropy<=4.0
mock>2.0.0
urllib3==1.26.6