Version 2022-12-06, by Andrej Prša (aprsa@villanova.edu)
This notebook recreates the results presented in Prša (2023): "The LSST Cadence Impact on Non-Time-Critical Eclipsing Binary Science". Please refer to the paper for all details on the computation logic.
We work out the simulation by using the opsim v2.1 baseline run; afterwards, we run the same steps on other opsim runs.
We start with the usual imports. OpSim runs are distributed as sqlite databases. We will use pickles to dump intermediate results that we reuse later on.
import numpy as np
import sqlite3 as sql
import matplotlib.pyplot as plt
import pickle
import os
For plotting, we generated a style file that makes the plots jupyter-friendlier. This is completely optional; if you decide to use it, you will need to copy jupyter.mplstyle into ~/.config/matplotlib/stylelib/jupyter.mplstyle
.
plt.style.use('jupyter')
subdir = '2.1'
suffix = 'baseline_v2.1'
db = sql.connect(f'{subdir}/{suffix}_10yrs.db')
dbc = db.cursor()
The idea is to look at their distributions and make sure that everything looks the way it should. We expect a smooth distribution that corresponds to the WFD and peaks that correspond to DDFs. We also expect to see a zone of avoidance in the direction of high galactic extinction.
dbc.execute('select fieldRa, fieldDec from observations')
results = dbc.fetchall()
r = np.array(results)
print(f'{r.shape[0]} field visits read in.')
2081749 field visits read in.
Thus, we have 2M+ field visits in all $ugrizy$ passbands over the course of 10 years. Plot their distributions:
plt.yscale('log')
plt.xlabel('Right ascension')
plt.ylabel('Number of visits')
plt.hist(r[:,0], bins=50, label='v2.1 baseline')
plt.legend()
plt.savefig('dist_ra.pdf')
plt.yscale('log')
plt.xlabel('Declination')
plt.ylabel('Number of visits')
plt.hist(r[:,1], bins=50, label='v2.1 baseline')
plt.legend()
plt.savefig('dist_dec.pdf')
These two plots reproduce Fig. 1 in the paper.
You can extract the latest version from the catalog homepage or grab the used catalog from here. We need the spatial position, the ephemerides and eclipse parameters for all TESS EBs.
# tic=0, ra=5, dec=6, tmag=9, t0=10, P0=12, pf: pw=15, pd=16, pp=17, sw=18, sd=19, sp=20; 2g: pw=21, pd=22, pp=23, sw=24, sd=25, sp=26
tessEBs = np.genfromtxt('tessEBs.csv', delimiter=',', usecols=(0, 10, 12, 5, 6, 15, 18, 21, 24, 17, 20), skip_header=True)
t0s = dict(zip(tessEBs[:,0], tessEBs[:,1]))
periods = dict(zip(tessEBs[:,0], tessEBs[:,2]))
pwidths_pf = dict(zip(tessEBs[:,0], tessEBs[:,5]))
swidths_pf = dict(zip(tessEBs[:,0], tessEBs[:,6]))
pwidths_2g = dict(zip(tessEBs[:,0], tessEBs[:,7]))
swidths_2g = dict(zip(tessEBs[:,0], tessEBs[:,8]))
ppos_pf = dict(zip(tessEBs[:,0], tessEBs[:,9]))
spos_pf = dict(zip(tessEBs[:,0], tessEBs[:,10]))
For each visit, record the timestamp and passband information. Store this information in a dictionary where TESS IDs are used as keys. NOTE: this is a computationally expensive step, so it is practical to have to do it only once. That is why, once the lookup is done, we pickle the timestamps and store them for future use. You can either recompute it here or use the pickle that is distributed and available here.
if os.path.exists(f'timestamps_{suffix}.pkl'):
with open(f'timestamps_{suffix}.pkl', 'rb') as f:
eb_vro_obs = pickle.load(f)
else:
eb_vro_obs = {}
for i, eb in enumerate(tessEBs):
print(f'TIC {int(eb[0])} processed ({i+1}/{len(tessEBs)}).')
dbc.execute(f"select observationStartMJD,filter from observations where pow(fieldRa-({eb[3]}), 2) + pow(fieldDec-({eb[4]}), 2) < 3.0625")
eb_vro_obs[int(eb[0])] = dbc.fetchall()
with open(f'timestamps_{suffix}.pkl', 'wb') as f:
pickle.dump(eb_vro_obs, f)
with open(f'timestamps_{suffix}.pkl', 'rb') as f:
eb_vro_obs = pickle.load(f)
Each entry in the timestamp has the timestamp itself and the filter in which the data were taken, for example:
list(eb_vro_obs.items())[0]
(91961, [(60365.268620232615, 'y'), (60365.29233825059, 'y'), (60365.300757273595, 'y'), (60365.32352518584, 'y'), (60374.25087474818, 'r'), (60374.274772042714, 'i'), (60374.28987802617, 'i'), (60374.31451248783, 'z'), (60377.39812844855, 'r'), (60382.3946814303, 'i'),
(60383.390564578105, 'i'), (60383.39103179271, 'i'), (60383.400974161894, 'r'), (60383.40144005104, 'r'), (60386.40478158532, 'z'), (60391.36892813432, 'z'), (60391.3803152626, 'y'), (60395.382793404126, 'y'), (60395.39314022137, 'y'), (60402.359548948865, 'z'), (60402.37081936748, 'y'), (60403.23254585343, 'g'), (60403.25732356261, 'r'), (60404.35321428223, 'r'), (60404.37875005508, 'i'), (60408.18269169073, 'u'), (60408.206895174524, 'g'), (60409.316123681776, 'r'), (60409.34054914877, 'i'), (60411.310278588986, 'g'), (60411.33442371535, 'r'), (60415.30795405585, 'i'), (60415.33220003281, 'z'), (60421.16536730167, 'y'), (60421.1882415142, 'y'), (60422.18491933729, 'y'), (60428.35727726831, 'i'), (60432.24676748056, 'i'), (60432.27088807116, 'z'), (60433.12389866133, 'u'), (60433.148209882434, 'r'), (60434.25520874391, 'g'), (60434.27863248965, 'u'), (60438.25265215699, 'r'), (60438.255076067275, 'r'), (60438.276911617824, 'i'), (60438.279284673765, 'i'), (60442.24569805951, 'i'), (60442.27011223108, 'r'), (60466.07712448133, 'r'), (60466.102256158025, 'i'), (60467.02655932152, 'g'), (60467.05215866267, 'r'), (60467.19814334474, 'u'), (60467.22118731517, 'g'), (60467.23565126836, 'g'), (60467.260076413055, 'r'), (60475.97985717087, 'i'), (60476.00408354281, 'z'), (60484.112359766244, 'y'), (60484.13512462079, 'y'), (60486.98013179421, 'i'), (60486.98159187978, 'i'), (60487.00493585309, 'z'), (60487.006519849034, 'z'), (60491.11202151915, 'z'), (60491.13637921639, 'y'), (60510.067887349935, 'y'), (60510.09085865137, 'y'), (60512.115591395064, 'i'), (60512.13943855676, 'z'), (60526.99714037313, 'r'), (60527.02166690385, 'i'), (60528.99285081723, 'r'), (60529.0176391692, 'i'), (60692.37046960806, 'z'), (60736.39976598439, 'r'), (60759.39032372248, 'i'), (60759.39983076409, 'r'), (60763.23713022928, 'r'), (60763.26258672456, 'i'), (60769.220239800175, 'g'), (60769.24477505647, 'r'), (60785.31715669128, 'i'), (60785.34151025373, 'z'), (60785.36302144498, 'z'), (60785.39433329968, 'y'), (60785.40417644337, 'y'), (60786.283645783136, 'y'), (60786.30632133344, 'y'), (60791.084642190355, 'u'), (60791.10768884392, 'r'), (60793.1770174033, 'u'), (60793.201680044825, 'g'), (60793.24911959156, 'r'), (60793.27360482313, 'i'), (60796.12839419731, 'u'), (60796.15263229716, 'g'), (60796.25480968004, 'u'), (60796.27810824638, 'r'), (60810.24539269153, 'y'), (60810.268144427755, 'y'), (60810.28442243804, 'i'), (60810.30819592028, 'z'), (60810.373120550415, 'y'), (60823.030146794175, 'r'), (60823.05329256911, 'u'), (60829.02200082025, 'i'), (60829.04665792238, 'z'), (60847.97680297004, 'g'), (60848.00131300314, 'r'), (60848.151110667684, 'g'), (60848.17511531073, 'r'), (60857.9835371518, 'i'), (60858.008562118914, 'z'), (60858.99530399821, 'i'), (60865.07310111353, 'z'), (60865.07356080941, 'z'), (60865.09722538047, 'y'), (60865.097685076355, 'y'), (60867.084032500046, 'i'), (60867.10795864872, 'z'), (60867.13108130103, 'z'), (60871.12722776103, 'i'), (60871.15139014294, 'z'), (60881.04519202725, 'r'), (60886.02735060136, 'r'), (60886.051961249235, 'i'), (60893.99119483099, 'y'), (60894.0140932896, 'y'), (60894.088365611395, 'y'), (60894.11075903772, 'y'), (60895.0325557348, 'i'), (60895.057229560014, 'z'), (61063.37500916918, 'r'), (61063.375425835846, 'r'), (61089.30890412297, 'g'), (61089.333221940695, 'r'), (61097.31211312702, 'g'), (61097.33754192511, 'r'), (61099.30721343175, 'i'), (61099.33172297876, 'z'), (61100.296888302655, 'y'), (61100.31994181495, 'y'), (61112.21442915715, 'r'), (61112.238925929756, 'i'), (61112.26330285156, 'z'), (61112.28888221833, 'z'), (61112.31318915716, 'y'), (61113.406177940284, 'r'), (61114.37109875445, 'r'), (61114.38236730166, 'i'), (61117.23987049383, 'u'), (61117.24028186103, 'u'), (61117.262754345, 'r'), (61117.26320329705, 'r'), (61117.3900724912, 'y'), (61117.39097791297, 'y'), (61117.40145933041, 'y'), (61117.40236318196, 'y'), (61119.25487226496, 'r'), (61120.36723135279, 'r'), (61120.37859876941, 'i'), (61122.35659828203, 'y'), (61122.36651224045, 'y'), (61128.2273587871, 'i'), (61128.25271277667, 'z'), (61137.4074638054, 'y'), (61137.418648179286, 'y'), (61139.36230397668, 'i'), (61139.39053674268, 'r'), (61140.313409534945, 'g'), (61140.33768777303, 'r'), (61142.35538809299, 'r'), (61142.375555685365, 'i'), (61145.31433220121, 'g'), (61145.33877563366, 'r'), (61146.35641070746, 'u'), (61146.37959413388, 'g'), (61155.1304427118, 'z'), (61155.1551886904, 'i'), (61159.3421481498, 'z'), (61159.36586314502, 'y'), (61165.30258913577, 'y'), (61165.325170066506, 'y'), (61168.25980194546, 'i'), (61168.283761492785, 'r'), (61168.305015130674, 'r'), (61168.328841104354, 'i'), (61169.29210547168, 'r'), (61169.31586581108, 'i'), (61170.25400855632, 'r'), (61170.278775286875, 'i'), (61173.24038648196, 'u'), (61173.263067728396, 'g'), (61177.25228517234, 'u'), (61177.27559443282, 'g'), (61177.33284904977, 'r'), (61177.35705388769, 'i'), (61181.2454072901, 'r'), (61181.26966829687, 'i'), (61192.02186515953, 'z'), (61192.04594191804, 'y'), (61192.98738929733, 'z'), (61193.011614444375, 'y'), (61194.22028428746, 'y'), (61194.24280743484, 'y'), (61194.28138882903, 'i'), (61194.30506613853, 'z'), (61196.15414819241, 'i'), (61196.17801189166, 'z'), (61213.97663069169, 'z'), (61214.00085924489, 'y'), (61224.17190839431, 'i'), (61224.196534324015, 'z'), (61224.220228948434, 'y'), (61226.163628182854, 'i'), (61226.18765496647, 'z'), (61228.12840164237, 'g'), (61228.15237338627, 'r'), (61228.98710925043, 'g'), (61229.01234591684, 'r'), (61229.07601985447, 'z'), (61229.09984737457, 'y'), (61229.13042396948, 'g'), (61240.034718988085, 'r'), (61240.05872810082, 'i'), (61241.11801459617, 'r'), (61241.14181846353, 'i'), (61247.04120295606, 'z'), (61247.04211251192, 'z'), (61247.06539146036, 'y'), (61247.06630067305, 'y'), (61247.088295737434, 'y'), (61247.08874410388, 'y'), (61252.081619358905, 'i'), (61252.10535977964, 'z'), (61252.12731830321, 'z'), (61252.151030035195, 'y'), (61254.03886938884, 'r'), (61254.06271554493, 'i'), (61254.08600346471, 'i'), (61254.109700951405, 'z'), (61256.035609659666, 'g'), (61256.0601087611, 'r'), (61256.08251705877, 'r'), (61256.10620278093, 'i'), (61259.03907570558, 'r'), (61259.06305442585, 'i'), (61261.03461899089, 'u'), (61261.05711112832, 'r'), (61266.99377052875, 'u'), (61267.01660210495, 'r'), (61267.04188636304, 'r'), (61267.065633243925, 'i'), (61267.99527009114, 'y'), (61268.01812331055, 'y'), (61268.042090076924, 'y'), (61268.06452861723, 'y'), (61477.391871617976, 'r'), (61477.39343023458, 'r'), (61493.35767627085, 'z'), (61493.36923029633, 'y'), (61498.35852955991, 'i'), (61498.38282964419, 'r'), (61500.37472123799, 'g'), (61501.36826108773, 'r'), (61501.39434050729, 'i'), (61505.38401006345, 'r'), (61505.395285374056, 'i'), (61513.30167893611, 'y'), (61513.32442087751, 'y'), (61521.30074232893, 'i'), (61521.324898472114, 'z'), (61521.38783226136, 'i'), (61521.39901607456, 'z'), (61521.40794670182, 'z'), (61521.417783352634, 'y'), (61523.28938220936, 'g'), (61523.31343442353, 'r'), (61523.33289237222, 'r'), (61523.35666165925, 'i'), (61525.38574985086, 'z'), (61525.396928773465, 'y'), (61526.3083323699, 'u'), (61526.33208323517, 'g'), (61527.2811393138, 'u'), (61536.269492818996, 'y'), (61536.29226454843, 'y'), (61539.25113083348, 'z'), (61539.275391541814, 'y'), (61551.02196934024, 'g'), (61551.04655322063, 'r'), (61551.06962703284, 'r'), (61551.095373200515, 'i'), (61551.19901938042, 'i'), (61551.22295260768, 'z'), (61552.19220784843, 'r'), (61552.21657958758, 'i'), (61558.06023168414, 'g'), (61558.0854700986, 'r'), (61562.19604817611, 'i'), (61562.22073568622, 'r'), (61577.168292436494, 'y'), (61577.19493653114, 'z'), (61577.21864096264, 'y'), (61602.1095884447, 'y'), (61602.133365636546, 'z'), (61608.042232961, 'g'), (61608.06628348658, 'r'), (61608.089280164095, 'r'), (61608.11416041705, 'i'), (61608.13787564417, 'z'), (61608.16023059131, 'z'), (61608.18390062236, 'y'), (61614.04081356531, 'z'), (61614.0650099372, 'i'), (61614.07511724313, 'i'), (61614.09898291404, 'z'), (61621.044411663424, 'y'), (61621.06733461507, 'y'), (61621.091185020734, 'y'), (61621.11361163716, 'y'), (61622.04153543885, 'u'), (61622.064828710376, 'r'), (61622.08611900459, 'r'), (61622.109858904885, 'i'), (61624.04215352043, 'u'), (61624.04256652212, 'u'), (61624.065941485846, 'r'), (61624.06638761588, 'r'), (61624.08895933883, 'r'), (61624.11268577768, 'i'), (61631.049382690915, 'i'), (61631.073188599636, 'z'), (61631.09596976068, 'z'), (61641.045165181415, 'r'), (61641.06897415886, 'i'), (61827.310096139874, 'u'), (61839.302800975485, 'i'), (61839.32798014861, 'z'), (61841.30159789222, 'z'), (61850.37927683839, 'i'), (61850.39063920937, 'r'), (61851.246081943784, 'r'), (61851.27117638267, 'i'), (61856.241637755054, 'g'), (61856.26665477999, 'r'), (61864.37124404368, 'y'), (61864.395062220174, 'y'), (61866.36485869963, 'r'), (61866.39108630527, 'i'), (61866.406819275406, 'i'), (61868.33813291852, 'y'), (61868.36040783096, 'y'), (61874.3642784844, 'i'), (61877.29872778263, 'i'), (61877.32273059555, 'z'), (61877.33138236779, 'z'), (61877.35582565687, 'i'), (61877.3975902298, 'z'), (61877.40788611227, 'y'), (61882.285864632344, 'r'), (61882.30905079831, 'u'), (61882.337948583416, 'u'), (61882.36173509875, 'r'), (61885.35081951641, 'u'), (61885.35123177363, 'u'), (61885.37410613333, 'g'), (61885.37455201952, 'g'), (61886.31356641455, 'g'), (61890.125520339265, 'g'), (61890.14972677417, 'r'), (61890.1752942532, 'r'), (61890.199872951125, 'i'), (61892.28952497289, 'z'), (61893.29090816396, 'z'), (61893.31471382502, 'y'), (61894.12500929174, 'i'), (61894.14944531713, 'z'), (61895.11668020052, 'y'), (61895.13968918129, 'y'), (61896.16253243246, 'z'), (61896.188522020406, 'y'), (61896.2970478468, 'y'), (61896.31997597883, 'y'), (61904.03714809982, 'r'), (61904.061363391906, 'i'), (61904.08449889264, 'i'), (61904.108816327695, 'r'), (61907.28816759025, 'r'), (61908.197084407904, 'i'), (61908.22144972154, 'r'), (61908.258000350936, 'r'), (61911.20125566457, 'g'), (61911.22493157943, 'u'), (61916.274770440046, 'g'), (61916.2986719171, 'r'), (61917.247417553226, 'r'), (61917.27140142231, 'i'), (61923.03375382159, 'z'), (61923.05808509249, 'y'), (61935.217011780565, 'i'), (61935.24159632215, 'z'), (61935.26527550856, 'y'), (61936.20577610998, 'i'), (61936.22954313592, 'r'), (61937.97594132196, 'g'), (61938.000238809975, 'r'), (61938.15443383339, 'i'), (61938.178223918316, 'z'), (61938.20690958577, 'z'), (61938.2306218797, 'y'), (61940.15702281102, 'g'), (61940.18105423606, 'r'), (61940.208916725715, 'r'), (61940.23262247879, 'i'), (61942.986811234405, 'y'), (61943.00957779197, 'y'), (61943.11528560957, 'u'), (61943.13867878349, 'r'), (61943.16519284199, 'r'), (61943.18914927421, 'i'), (61945.97439275843, 'i'), (61945.9985746074, 'r'), (61946.03848979602, 'r'), (61948.98613653601, 'y'), (61949.00920293909, 'y'), (61959.96177434064, 'z'), (61959.97320580733, 'i'), (61960.198796442346, 'z'), (61960.963007726335, 'z'), (61960.97441140589, 'i'), (61961.11451283849, 'z'), (61961.13839522444, 'i'), (61972.07784134869, 'i'), (61972.10172456591, 'r'), (61976.02845187635, 'g'), (61976.05263107781, 'r'), (61977.08000535483, 'r'), (61977.10404906632, 'i'), (61977.125995443275, 'y'), (61977.14836047858, 'y'), (61987.04223600342, 'i'), (61987.0662651502, 'z'), (61987.08645280228, 'z'), (61987.110200177805, 'y'), (61988.9866586718, 'i'), (61989.01093042945, 'z'), (61989.04142637989, 'z'), (61989.0652895356, 'y'), (61989.98912179633, 'i'), (61990.01327420796, 'z'), (61994.0436937552, 'r'), (61994.06745154398, 'i'), (62001.99730633575, 'i'), (62002.0213526436, 'r'), (62002.04378920162, 'r'), (62002.067466363966, 'i'), (62017.04544678141, 'z'), (62017.0691419344, 'y'), (62203.25178194266, 'i'), (62203.27656661865, 'z'), (62243.122948003285, 'u'), (62243.14512387298, 'g'), (62243.168909074244, 'g'), (62243.19417524356, 'r'), (62249.170423495154, 'i'), (62249.19541856668, 'z'), (62250.348587381835, 'r'), (62250.37234967559, 'i'), (62264.23604765571, 'u'), (62264.259422158066, 'r'), (62292.22237121843, 'i'), (62292.246163161064, 'z'), (62307.16865365095, 'i'), (62307.192605971635, 'z'), (62307.2577336828, 'g'), (62313.24253776597, 'y'), (62322.16864275271, 'r'), (62322.19280333629, 'i'), (62322.214710857996, 'i'), (62325.12353071554, 'g'), (62325.14752615014, 'r'), (62330.118922283495, 'g'), (62330.142754850145, 'r'), (62330.16572898304, 'r'), (62330.189430210055, 'i'), (62340.11676779994, 'y'), (62346.08931685702, 'i'), (62346.11317692118, 'z'), (62357.04541191566, 'g'), (62357.06984639535, 'r'), (62357.09403645741, 'r'), (62358.03317287957, 'y'), (62358.055686585714, 'y'), (62377.012606317694, 'i'), (62377.03633112405, 'z'), (62520.33723699843, 'y'), (62520.34709204422, 'y'), (62522.37051901227, 'z'), (62561.26673588595, 'u'), (62561.29099289598, 'g'), (62562.30005549559, 'u'), (62562.32442644815, 'g'), (62566.29421351961, 'r'), (62566.32057186265, 'g'), (62566.34593814266, 'r'), (62568.29265626388, 'u'), (62577.24554210802, 'z'), (62577.27012659797, 'y'), (62579.21215689402, 'i'), (62579.23682316299, 'z'), (62585.289321406104, 'z'), (62585.314546649664, 'y'), (62589.241578215035, 'g'), (62589.26690446574, 'r'), (62592.184804504584, 'u'), (62592.208127511265, 'r'), (62592.23773024053, 'r'), (62592.26247127495, 'i'), (62599.19168049798, 'g'), (62599.30567118531, 'y'), (62599.328414865784, 'y'), (62606.12527600556, 'z'), (62606.14939976558, 'i'), (62606.21462965647, 'z'), (62606.24033282746, 'y'), (62607.1887211663, 'z'), (62613.31340737521, 'i'), (62613.33771568054, 'z'), (62613.36059801326, 'z'), (62615.12675538722, 'r'), (62615.15103452381, 'g'), (62615.339605731795, 'r'), (62615.36335008341, 'i'), (62618.177462788626, 'u'), (62620.12295658904, 'u'), (62620.1467316523, 'r'), (62624.07885810933, 'u'), (62624.10273589838, 'r'), (62625.11315922495, 'g'), (62625.11360979955, 'g'), (62625.137990938085, 'r'), (62625.13845138599, 'r'), (62625.17715556927, 'r'), (62629.07233438017, 'i'), (62629.097060303495, 'r'), (62629.25376608376, 'i'), (62629.2547780355, 'i'), (62629.277878757406, 'r'), (62629.27885431655, 'r'), (62645.06650080012, 'r'), (62645.09074278192, 'i'), (62645.19692345099, 'r'), (62645.22101659169, 'i'), (62645.27884189667, 'z'), (62645.30255114245, 'y'), (62646.070236162785, 'r'), (62646.09487409408, 'i'), (62647.03365389349, 'r'), (62647.056744665744, 'u'), (62647.076962911844, 'u'), (62651.18608917399, 'y'), (62651.20862020706, 'y'), (62667.95729506727, 'z'), (62667.96896984967, 'i'), (62668.208916563766, 'i'), (62668.23262539377, 'z'), (62669.159501755596, 'r'), (62669.18342485027, 'i'), (62673.19846243017, 'z'), (62673.22221970869, 'y'), (62675.15339061143, 'z'), (62675.177193887095, 'y'), (62679.11764362162, 'r'), (62679.14097218815, 'u'), (62688.09486091319, 'r'), (62688.11852084512, 'u'), (62688.14606642153, 'u'), (62688.16913697213, 'r'), (62688.996838113184, 'y'), (62689.95487755492, 'i'), (62689.966185879675, 'z'), (62706.07086073576, 'r'), (62706.09459347232, 'g'), (62708.07075995516, 'g'), (62708.094645145065, 'r'), (62711.08457647404, 'r'), (62711.085021593244, 'r'), (62711.108364153115, 'i'), (62711.10880824289, 'i'), (62724.99231493849, 'i'), (62725.01618642196, 'z'), (62725.04977890837, 'z'), (62725.07391437849, 'y'), (62725.1248327744, 'z'), (62725.1266241962, 'z'), (62726.09164397153, 'z'), (62727.07278422289, 'y'), (62727.09513743446, 'y'), (62727.995717937985, 'i'), (62728.01964741445, 'r'), (62728.042477793, 'r'), (62728.06619974038, 'i'), (62729.05331918683, 'r'), (62729.07701839135, 'i'), (62730.9704915082, 'i'), (62730.98158935298, 'r'), (62730.994586065994, 'r'), (62731.01867622492, 'i'), (62753.013153447435, 'y'), (62955.38410963772, 'i'), (62955.39582642842, 'z'), (62956.378286169835, 'z'), (62956.389598198264, 'y'), (62961.36125273853, 'i'), (62961.38709492993, 'z'), (62973.387700414816, 'r'), (62973.39888520877, 'i'), (62980.16279814352, 'g'), (62980.18805164552, 'r'), (62980.29785577604, 'r'), (62980.32208936494, 'g'), (63009.20936573465, 'u'), (63009.233010392665, 'g'), (63011.20650772653, 'u'), (63011.229356389595, 'g'), (63016.06808426346, 'z'), (63016.09299612648, 'y'), (63017.03408212342, 'z'), (63017.05894884334, 'y'), (63038.15470477524, 'i'), (63038.17879332371, 'r'), (63040.10767532258, 'r'), (63040.13176031889, 'i'), (63040.153031506525, 'i'), (63040.17711773365, 'r'), (63043.16086362312, 'u'), (63043.184108997106, 'g'), (63044.99212538298, 'i'), (63055.115491311895, 'i'), (63055.139344267816, 'z'), (63081.0391998094, 'z'), (63081.06344089721, 'y'), (63081.08703240377, 'i'), (63081.11074074633, 'z'), (63082.04941216138, 'z'), (63082.076483406774, 'i'), (63082.10022704853, 'z'), (63082.1230798969, 'z'), (63082.14679294776, 'y'), (63084.085898446625, 'i'), (63084.10959745309, 'z'), (63089.00714926128, 'i'), (63254.3686130266, 'z'), (63258.32147246592, 'y'), (63258.34448943516, 'y'), (63303.303994354814, 'i'), (63308.2413033263, 'u'), (63308.26452321119, 'g'), (63312.36892583452, 'y'), (63312.37912206946, 'y'), (63312.38690014531, 'i'), (63312.39786013444, 'z'), (63324.36124302778, 'y'), (63324.385765985, 'z'), (63324.40183567828, 'z'), (63324.41360876105, 'y'), (63360.07804406537, 'u'), (63364.11048532306, 'g'), (63364.11093836239, 'g'), (63364.13596794753, 'r'), (63364.13645571258, 'r'), (63367.122809424196, 'r'), (63369.08104438896, 'i'), (63369.105894253065, 'z'), (63378.19810145409, 'y'), (63378.20006428508, 'y'), (63378.22126088311, 'y'), (63378.22318216611, 'y'), (63381.07363932776, 'r'), (63381.09851830005, 'i'), (63386.23715642101, 'u'), (63386.259518354076, 'g'), (63412.992148036574, 'i'), (63413.01722673057, 'z'), (63433.034896894416, 'z'), (63433.05960531996, 'y'), (63434.11270705214, 'z'), (63434.136439931324, 'y'), (63434.15567932647, 'y'), (63434.17804060495, 'y'), (63437.031757584795, 'z'), (63437.055849948614, 'y'), (63451.045022682396, 'r'), (63451.06900483092, 'i'), (63463.971998076224, 'z'), (63463.9831760868, 'y'), (63609.3641362794, 'z'), (63609.36455294606, 'z'), (63611.368656779996, 'z'), (63640.37266503841, 'r'), (63640.38471349537, 'i'), (63645.3155416559, 'z'), (63645.340593417466, 'y'), (63655.298295463326, 'r'), (63655.32362724794, 'i'), (63657.29815644132, 'g'), (63657.32330005245, 'r'), (63658.2928693805, 'u'), (63658.31586811824, 'r'), (63663.29059389403, 'r'), (63663.31511472923, 'i'), (63663.40110088748, 'z'), (63663.40151755414, 'z'), (63663.40242885599, 'z'), (63665.39363971222, 'z'), (63668.247563501, 'z'), (63668.27172428192, 'y'), (63668.28209025871, 'y'), (63668.305638197606, 'y'), (63670.24336427049, 'y'), (63670.2664987414, 'y'), (63681.23373664347, 'r'), (63681.258651680975, 'i'), (63694.36342754879, 'i'), (63694.390585687775, 'z'), (63699.17330646587, 'y'), (63699.1965466887, 'y'), (63707.1382744558, 'z'), (63707.16285819302, 'y'), (63708.172149504404, 'z'), (63708.19852960429, 'i'), (63712.3047352659, 'u'), (63712.32802542762, 'g'), (63713.34904476195, 'i'), (63713.372834264715, 'r'), (63715.17434404818, 'u'), (63715.19920731127, 'g'), (63717.08393636628, 'u'), (63717.108036384314, 'r'), (63719.12147166933, 'r'), (63719.146316875864, 'i'), (63722.13361843879, 'i'), (63724.11957583502, 'r'), (63724.14509064437, 'i'), (63741.06545704551, 'u'), (63741.08881295247, 'g'), (63743.07973885869, 'g'), (63744.0233248606, 'r'), (63744.047729102575, 'g'), (63747.255946151825, 'r'), (63766.98482536808, 'r'), (63767.00918434177, 'i'), (63773.20976758369, 'y'), (63788.07031709897, 'y'), (63788.09339795296, 'y'), (63788.123438742565, 'y'), (63788.14583029264, 'y'), (63789.08712614099, 'i'), (63789.108442592944, 'z'), (63789.1324879966, 'y'), (63789.96395695136, 'z'), (63789.97556364412, 'i'), (63797.06883020753, 'r'), (63797.09274304535, 'i'), (63801.068281482585, 'r'), (63801.068729629405, 'r'), (63801.092202566986, 'i'), (63801.092650756014, 'i'), (63802.02843051072, 'g'), (63802.05259018779, 'r'), (63805.04009818201, 'r'), (63805.06408465682, 'i'), (63808.03205410126, 'u'), (63808.05472771387, 'r'), (63808.0746788954, 'r'), (63814.99354293943, 'i'), (63815.01792964561, 'z'), (63815.045602706414, 'z'), (63815.06932851049, 'y'), (63816.005714303545, 'i'), (63816.04919074869, 'z'), (63816.073464766436, 'y'), (63816.095860386915, 'y'), (63822.997793311275, 'i'), (63823.02208658674, 'z'), (63826.04085390172, 'r'), (63826.06522744951, 'i'), (63833.00438525586, 'r'), (63833.00483294808, 'r'), (63833.02827613365, 'i'), (63833.02872239035, 'i')])
Now we can count the number of visits per passband. We will store the information in two dictionaries: per_band_timestamps
, which holds timestamps divided by passbands, and per_band_nobs
, which aggregates the number of observations rather than explicit timestamps. We also append another column to per_band_nobs
for the cumulative number of observations.
passbands = ['u', 'g', 'r', 'i', 'z', 'y']
per_band_timestamps = {}
for tic, timestamps in eb_vro_obs.items():
# skip any TESS EBs that LSST will not observe:
if len(timestamps) == 0:
continue
per_band_timestamps[tic] = {}
for passband in passbands:
per_band_timestamps[tic][passband] = [ts[0] for ts in timestamps if ts[1] == passband]
per_band_nobs = np.empty((len(per_band_timestamps), 1+len(passbands)), dtype=int)
i = 0
for tic in eb_vro_obs.keys():
if tic not in per_band_timestamps.keys():
continue
per_band_nobs[i,:-1] = [len(per_band_timestamps[tic][passband]) for passband in passbands]
per_band_nobs[i, -1] = per_band_nobs[i,:-1].sum()
i += 1
We can now easily plot per-passband visits:
plt.xlabel('Fraction of visits per passband')
plt.ylabel('Number of EBs')
for i, passband in enumerate(passbands):
if i == 0:
v, r,_ = plt.hist(per_band_nobs[:,i]/per_band_nobs[:,-1], bins=50, alpha=0.5, label=passband)
else:
plt.hist(per_band_nobs[:,i]/per_band_nobs[:,-1], bins=r, alpha=0.3, label=passband)
plt.legend()
plt.savefig(f'per_passband_visits_{suffix}.pdf')
This recreates Fig. 6 from the paper. We will export per_band_nobs
to disk, for opsim comparison purposes:
np.savetxt(f'colors_{suffix}.csv', per_band_nobs, delimiter=',', fmt='%d')
We can now print out an aggregate count, which is reported in Table 3 of the paper:
for i, pb in enumerate(passbands):
print(f'fraction in {pb}-band: {np.mean(per_band_nobs[:,i])/np.mean(per_band_nobs[:,-1]):0.3f} +/- {np.std(per_band_nobs[:,i])/np.mean(per_band_nobs[:,-1]):0.3f}')
fraction in u-band: 0.066 +/- 0.065 fraction in g-band: 0.098 +/- 0.114 fraction in r-band: 0.223 +/- 0.239 fraction in i-band: 0.226 +/- 0.240 fraction in z-band: 0.193 +/- 0.140 fraction in y-band: 0.194 +/- 0.240
For that, we need to see at what orbital phase will LSST observe these TESS EBs. To do that, we first convert timestamps to phase stamps:
all_times, all_phases = {}, {}
for tic, item in eb_vro_obs.items():
# skip any entries without ephemerides:
if tic not in t0s.keys() or np.isnan(periods[tic]) or np.isnan(t0s[tic]):
continue
all_times[tic] = np.array([entry[0] for entry in item])
all_phases[tic] = (all_times[tic]-t0s[tic]) % periods[tic] / periods[tic]
print(f'{len(all_phases)} of {len(eb_vro_obs)} timeseries converted to phase series.')
4571 of 4578 timeseries converted to phase series.
Next, we define an in_eclipse()
function that will return True
if a timestamp covers an eclipse, and False
otherwise. The extra logic is because it needs to account for phase wrapping.
def in_eclipse(phase, pos1, wid1, pos2, wid2):
if np.all(np.isnan((pos1, wid1, pos2, wid2))):
return False
if np.any(np.isnan((pos1, wid1))):
cond1 = False
else:
ll1 = (pos1 - wid1/2) % 1
ul1 = (pos1 + wid1/2) % 1
cond1 = (phase > ll1) | (phase < ul1) if ul1 < ll1 else (phase > ll1) & (phase < ul1)
if np.any(np.isnan((pos2, wid2))):
cond2 = False
else:
ll2 = (pos2 - wid2/2) % 1
ul2 = (pos2 + wid2/2) % 1
cond2 = (phase > ll2) | (phase < ul2) if ul2 < ll2 else (phase > ll2) & (phase < ul2)
return cond1 or cond2
Now we do another loop over eb_vro_ebs
and count the number of visits during eclipse; this will allow us to estimate a likelihood that an EB will be recognized as such from the aggregate LSST data. While at it, we save these counts into a file for subsequent use.
counts = []
for tic, item in eb_vro_obs.items():
# skip any entries without ephemerides:
if tic not in t0s.keys() or np.isnan(periods[tic]) or np.isnan(t0s[tic]) or len(item) == 0:
continue
timestamps, phases, eclpts = {}, {}, {}
for passband in passbands:
timestamps[passband] = np.array([ts[0] for ts in item if ts[1] == passband])
phases[passband] = (timestamps[passband]-t0s[tic]) % periods[tic] / periods[tic]
eclpts[passband] = [ph for ph in phases[passband] if in_eclipse(ph, ppos_pf[tic], pwidths_pf[tic], spos_pf[tic], swidths_pf[tic])]
counts.append([
tic,
len(all_phases[tic]),
len(eclpts['u'])+len(eclpts['g'])+len(eclpts['r'])+len(eclpts['i'])+len(eclpts['z'])+len(eclpts['y']),
len(eclpts['u']),
len(eclpts['g']),
len(eclpts['r']),
len(eclpts['i']),
len(eclpts['z']),
len(eclpts['y'])
])
# f.write(f"{tic},{len(all_phases[tic])},{len(all_phases[tic][(all_phases[tic] < pwidths_pf[tic]/2) | (all_phases[tic] > 1-pwidths_pf[tic]/2)])},{len(peclpts['u'])},{len(peclpts['g'])},{len(peclpts['r'])},{len(peclpts['i'])},{len(peclpts['z'])},{len(peclpts['y'])}\n")
counts = np.array(counts)
np.savetxt(f'counts_{suffix}.csv', counts, delimiter=',', fmt='%d')
The counts
array now has aggregate counts and per-passband counts for each TIC; if, for example, we wanted to identify EBs in the deep drilling fields, we would filter on the number of total number of field visits larger than, say, 1000:
dd_ebs = counts[:,0][counts[:,1] > 1000]
print(f'Deep drilling EBs: {dd_ebs}')
for dd_eb in dd_ebs:
print(f' {counts[:,0][counts[:,0]==dd_eb][0]}: {counts[:,1][counts[:,0]==dd_eb][0]:5d} observations.')
Deep drilling EBs: [143022688 144598282 152507230 219222201 219238496 332910947 332910986] 143022688: 2189 observations. 144598282: 19933 observations. 152507230: 6973 observations. 219222201: 8732 observations. 219238496: 6309 observations. 332910947: 9954 observations. 332910986: 5877 observations.
This is reported in Table 2 in the paper. Using counts
, we can now plot the histogram of the field visits per EB:
plt.yscale('log')
plt.ylim(1, 100)
plt.xlabel('Number of field visits')
plt.ylabel('Number of EBs')
plt.hist(counts[:,1], bins=np.linspace(0, 1000, 101))
plt.savefig(f'field_visits_{suffix}.pdf');
More interestingly, we can plot the number of visits that coincide with EB eclipses:
plt.yscale('log')
plt.xlabel('Number of field visits during eclipse')
plt.ylabel('Number of EBs')
plt.hist(counts[:,2], bins=np.linspace(0, 500, 51))
plt.savefig(f'primary_eclipse_visits_{suffix}.pdf');
And even more informatively, we can plot the fraction of field visits during eclipse from all field visits:
plt.yscale('log')
plt.xlabel('Fraction of visits during eclipse from all field visits')
plt.ylabel('Number of EBs')
plt.hist(counts[:,2]/counts[:,1], bins=30)
plt.savefig(f'fraction_of_visits_{suffix}.pdf');
These three plots are depicted in Fig. 3 of the paper. We can use the fraction to form a detection metric: if, say, a given fraction of points in eclipse is observed, there is a good chance that the periodicity will be detected and that the light curve will be characterized as an EB. For 5%, for example:
fraction = counts[:,2]/counts[:,1]
print(f'the total number of TESS systems VRO will observe: {len(fraction)}')
print(f'systems with at least 5% of points in eclipse: {len(fraction[fraction > 0.05])}')
print(f'detection rate: {len(fraction[fraction>0.05])/len(fraction)}')
the total number of TESS systems VRO will observe: 2602 systems with at least 5% of points in eclipse: 1683 detection rate: 0.6468101460415066
This will inevitably be a function of orbital period; let's plot that:
all_vro_periods = np.array([periods[int(tic)] for tic in counts[:,0]])
det_vro_periods = all_vro_periods[fraction>0.05]
print(f'fraction detected: {len(det_vro_periods)/len(all_vro_periods)}')
plt.yscale('log')
plt.xlabel('Orbital period [days]')
plt.ylabel('Number of EBs')
v, r, _ = plt.hist(all_vro_periods, bins=np.linspace(0, 60, 31), label='all EBs')
plt.hist(det_vro_periods, bins=r, label='EBs with at least 5% of data points in eclipse')
plt.legend()
plt.savefig(f'threshold_effect_on_periods_{suffix}.pdf')
fraction detected: 0.6468101460415066
fractions = np.arange(0.0, 0.451, 0.005)
detected = []
for f in fractions:
detected.append(len(all_vro_periods[fraction>f])/len(all_vro_periods))
plt.xlabel('Requested fraction of points in eclipse')
plt.ylabel('Fraction of detected systems')
plt.plot(fractions, detected, 'b-')
plt.savefig(f'thresholds_{suffix}.pdf')
Note: the reason why the fraction of detected systems at the requested fraction 0 isn't 1 is because of the '>' instead of '>=' sign; but if there are 0 points in eclipse then we won't detect it as an EB no matter what. Thus, we're losing 15% of the TESS systems because LSST will never hit any of the eclipses. This becomes even worse for long period EBs (such as those detected by Kepler), but then again, we'll be mostly interested in short period MM pairs.
We can now quantify detection rates under this metric for 2.5%, 5% and 10% (Table 1 in the paper):
print(f'the total number of TESS systems VRO will observe: {len(fraction)}')
for threshold in [0.025, 0.05, 0.1]:
print(f'systems with at least {threshold*100:1.1f}% of points in eclipse: {len(fraction[fraction > threshold])} ({len(fraction[fraction>threshold])/len(fraction):3.3f})')
the total number of TESS systems VRO will observe: 2602 systems with at least 2.5% of points in eclipse: 1982 (0.762) systems with at least 5.0% of points in eclipse: 1683 (0.647) systems with at least 10.0% of points in eclipse: 1194 (0.459)
We have seen above that the distribution of visits per target varies quite substantially. It is useful to provide a figure to "guide the eye" on how this impacts light curve coverage (Fig. 2 in the paper):
tics = [399253092, 419744996, 124604724, 152507230]
lens = [len(eb_vro_obs[tic]) for tic in tics]
Generate the figures for all TICs:
for tic, l in zip(tics, lens):
if l == 0:
continue
data = np.loadtxt(f'lcs_ascii/tic{tic:010d}.01.norm.lc')
data = data[np.argsort(data[:,1])]
all_xs = all_phases[tic]
all_ys = np.interp(all_xs, data[:,1], data[:,2])
plt.title(f'TIC {tic}, P={periods[tic]:3.3f}-d, {l} observations in all filters over 10 years')
plt.xlabel('Phase')
plt.ylabel('Normalized flux')
plt.plot(data[:,1], data[:,2], 'b,', label='TESS')
plt.plot(all_xs, all_ys, 'r.', label='LSST, all filters')
plt.savefig(f'tic{tic:010d}.pdf')
plt.clf()
<Figure size 1152x432 with 0 Axes>
It is interesting to take a closer look at the number of visits in deep drilling fields. This part didn't make the cut for the paper but it still might be informative.
tics = dd_ebs
lens = [len(eb_vro_obs[tic]) for tic in tics]
Take one of the most visited TICs, load the data, sort it by phase, and interpolate LSST observations:
tic = 144598282
data = np.loadtxt(f'lcs_ascii/tic{tic:010d}.01.norm.lc')
data = data[np.argsort(data[:,1])]
all_xs = all_phases[tic]
all_ys = np.interp(all_xs, data[:,1], data[:,2])
Compare TESS and simulated LSST observations:
plt.plot(data[:,1], data[:,2], 'b.')
plt.plot(all_xs, all_ys, 'r.')
[<matplotlib.lines.Line2D at 0x7fa574eb1cf0>]
Quantify this in numbers rather than a plot:
ts, ps = {}, {}
print(f'TIC {tic}:')
for passband in passbands:
ts[passband] = np.array([item[0] for item in eb_vro_obs[tic] if item[1] == passband])
print(f' {len(ts[passband])} timestamps in {passband}')
ps[passband] = (ts[passband]-t0s[tic]) % periods[tic] / periods[tic]
TIC 144598282: 1176 timestamps in u 2325 timestamps in g 4681 timestamps in r 4709 timestamps in i 2363 timestamps in z 4679 timestamps in y
Per passband distribution of field visits:
plt.axvline(0.483-pwidths_pf[tic]/2)
plt.axvline(0.483+pwidths_pf[tic]/2)
plt.title(f'TIC {tic}')
for passband in passbands:
xs = ps[passband]
ys = np.interp(xs, data[:,1], data[:,2])
plt.plot(xs, ys, ',', label=passband)
plt.legend()
<matplotlib.legend.Legend at 0x7fa574f5ea70>
color = ['purple', 'red', 'orange', 'yellow', 'green', 'blue']
for tic in tics.astype(int):
ts, ps = {}, {}
print(f'Plotting a phased curve for TIC {tic}.')
for passband in passbands:
ts[passband] = np.array([item[0] for item in eb_vro_obs[tic] if item[1] == passband])
ps[passband] = (ts[passband]-t0s[tic]) % periods[tic] / periods[tic]
data = np.loadtxt(f'lcs_ascii/tic{tic:010d}.01.norm.lc')
data = data[np.argsort(data[:,1])]
plt.title(f'TIC {tic}: P={periods[tic]:3.3f}-d, {len(eb_vro_obs[tic])} datapoints')
plt.xlabel('Phase')
plt.ylabel('Normalized flux')
for i, passband in enumerate(passbands):
xs = ps[passband]
ys = i*0.03 + np.interp(xs, data[:,1], data[:,2])
plt.plot(xs, ys, '.', c=color[i], label=passband)
plt.plot(1+xs[xs<0.1], ys[xs<0.1], '.', c=color[i])
plt.plot(xs[xs>0.9]-1, ys[xs>0.9], '.', c=color[i])
plt.legend()
plt.savefig(f'tic{tic:010.0f}.pdf')
plt.clf()
Plotting a phased curve for TIC 143022688. Plotting a phased curve for TIC 144598282. Plotting a phased curve for TIC 152507230. Plotting a phased curve for TIC 219222201. Plotting a phased curve for TIC 219238496. Plotting a phased curve for TIC 332910947. Plotting a phased curve for TIC 332910986.
<Figure size 1152x432 with 0 Axes>
The logic and computation steps here are identical to the ones above, that is why we will concatenate all into a single cell. Here we loop over all opsim runs and calculate all relevant quantities that are reported in the paper.
subdir = '2.99'
opsims = ['draft_connected_v2.99', 'dd6_v2.99', 'low_gp_v2.99', 'roll_early_v2.99']
passbands = ['u', 'g', 'r', 'i', 'z', 'y']
for suffix in opsims:
print(f'opsim: {suffix}:')
# connect to the opsim:
db = sql.connect(f'{subdir}/{suffix}_10yrs.db')
dbc = db.cursor()
# count the number of entries; no need to plot the distributions.
dbc.execute('select fieldRa, fieldDec from observations')
results = dbc.fetchall()
r = np.array(results)
numobs = r.shape[0]
print(f' {numobs} total field visits.')
# check if we have precomputed timestamps; if so, load them; if not, compute and save them (time-consuming!):
if os.path.exists(f'timestamps_{suffix}.pkl'):
with open(f'timestamps_{suffix}.pkl', 'rb') as f:
eb_vro_obs = pickle.load(f)
else:
eb_vro_obs = {}
for i, eb in enumerate(tessEBs):
print(f'TIC {int(eb[0])} processed ({i+1}/{len(tessEBs)}).')
dbc.execute(f"select observationStartMJD,filter from observations where pow(fieldRa-({eb[3]}), 2) + pow(fieldDec-({eb[4]}), 2) < 3.0625")
eb_vro_obs[int(eb[0])] = dbc.fetchall()
with open(f'timestamps_{suffix}.pkl', 'wb') as f:
pickle.dump(eb_vro_obs, f)
# passband counts:
per_band_timestamps = {}
for tic, timestamps in eb_vro_obs.items():
# skip any TESS EBs that LSST will not observe:
if len(timestamps) == 0:
continue
per_band_timestamps[tic] = {}
for passband in passbands:
per_band_timestamps[tic][passband] = [ts[0] for ts in timestamps if ts[1] == passband]
per_band_nobs = np.empty((len(per_band_timestamps), 1+len(passbands)), dtype=int)
i = 0
for tic in eb_vro_obs.keys():
if tic not in per_band_timestamps.keys():
continue
per_band_nobs[i,:-1] = [len(per_band_timestamps[tic][passband]) for passband in passbands]
per_band_nobs[i, -1] = per_band_nobs[i,:-1].sum()
i += 1
np.savetxt(f'colors_{suffix}.csv', per_band_nobs, delimiter=',', fmt='%d')
for i, pb in enumerate(passbands):
print(f' fraction in {pb}-band: {np.mean(per_band_nobs[:,i])/np.mean(per_band_nobs[:,-1]):0.3f} +/- {np.std(per_band_nobs[:,i])/np.mean(per_band_nobs[:,-1]):0.3f}')
# phase up the data:
all_times, all_phases = {}, {}
for tic, item in eb_vro_obs.items():
# skip any entries without ephemerides:
if tic not in t0s.keys() or np.isnan(periods[tic]) or np.isnan(t0s[tic]):
continue
all_times[tic] = np.array([entry[0] for entry in item])
all_phases[tic] = (all_times[tic]-t0s[tic]) % periods[tic] / periods[tic]
print(f' * {len(all_phases)} of {len(eb_vro_obs)} timeseries converted to phase series.')
# count eclipse visits:
counts = []
for tic, item in eb_vro_obs.items():
# skip any entries without ephemerides:
if tic not in t0s.keys() or np.isnan(periods[tic]) or np.isnan(t0s[tic]) or len(item) == 0:
continue
timestamps, phases, eclpts = {}, {}, {}
for passband in passbands:
timestamps[passband] = np.array([ts[0] for ts in item if ts[1] == passband])
phases[passband] = (timestamps[passband]-t0s[tic]) % periods[tic] / periods[tic]
eclpts[passband] = [ph for ph in phases[passband] if in_eclipse(ph, ppos_pf[tic], pwidths_pf[tic], spos_pf[tic], swidths_pf[tic])]
counts.append([
tic,
len(all_phases[tic]),
len(eclpts['u'])+len(eclpts['g'])+len(eclpts['r'])+len(eclpts['i'])+len(eclpts['z'])+len(eclpts['y']),
len(eclpts['u']),
len(eclpts['g']),
len(eclpts['r']),
len(eclpts['i']),
len(eclpts['z']),
len(eclpts['y'])
])
counts = np.array(counts)
np.savetxt(f'counts_{suffix}.csv', counts, delimiter=',', fmt='%d')
# report fractions for Table 1:
fraction = counts[:,2]/counts[:,1]
print(f' the total number of TESS systems VRO will observe: {len(fraction)}')
for threshold in [0.025, 0.05, 0.1]:
print(f' systems with at least {threshold*100:1.1f}% of points in eclipse: {len(fraction[fraction > threshold])} ({len(fraction[fraction>threshold])/len(fraction):3.3f})')
# deep drilling number of visits:
dd_ebs = sorted(counts[:,0][counts[:,1] > 1000])
print(f' Deep drilling EBs: {dd_ebs}')
for dd_eb in dd_ebs:
print(f' {counts[:,0][counts[:,0]==dd_eb][0]}: {counts[:,1][counts[:,0]==dd_eb][0]:5d} observations.')
print('')
opsim: draft_connected_v2.99: 2076864 total field visits. fraction in u-band: 0.058 +/- 0.056 fraction in g-band: 0.088 +/- 0.133 fraction in r-band: 0.228 +/- 0.274 fraction in i-band: 0.232 +/- 0.276 fraction in z-band: 0.196 +/- 0.224 fraction in y-band: 0.199 +/- 0.273 * 4571 of 4577 timeseries converted to phase series. the total number of TESS systems VRO will observe: 2601 systems with at least 2.5% of points in eclipse: 1985 (0.763) systems with at least 5.0% of points in eclipse: 1687 (0.649) systems with at least 10.0% of points in eclipse: 1187 (0.456) Deep drilling EBs: [143022688, 144598282, 152507230, 219222201, 219238496, 219244444, 332910947, 332910986] 143022688: 2184 observations. 144598282: 24355 observations. 152507230: 9432 observations. 219222201: 11055 observations. 219238496: 8461 observations. 219244444: 1242 observations. 332910947: 11849 observations. 332910986: 7329 observations. opsim: dd6_v2.99: 2077797 total field visits. fraction in u-band: 0.057 +/- 0.049 fraction in g-band: 0.088 +/- 0.116 fraction in r-band: 0.228 +/- 0.242 fraction in i-band: 0.233 +/- 0.243 fraction in z-band: 0.197 +/- 0.202 fraction in y-band: 0.198 +/- 0.239 * 4571 of 4577 timeseries converted to phase series. the total number of TESS systems VRO will observe: 2602 systems with at least 2.5% of points in eclipse: 2001 (0.769) systems with at least 5.0% of points in eclipse: 1691 (0.650) systems with at least 10.0% of points in eclipse: 1187 (0.456) Deep drilling EBs: [143022688, 144598282, 152507230, 219222201, 219238496, 219244444, 332910947, 332910986] 143022688: 1685 observations. 144598282: 21088 observations. 152507230: 7831 observations. 219222201: 10270 observations. 219238496: 7357 observations. 219244444: 1144 observations. 332910947: 10899 observations. 332910986: 6566 observations. opsim: low_gp_v2.99: 2077254 total field visits. fraction in u-band: 0.058 +/- 0.056 fraction in g-band: 0.088 +/- 0.133 fraction in r-band: 0.226 +/- 0.274 fraction in i-band: 0.231 +/- 0.276 fraction in z-band: 0.196 +/- 0.225 fraction in y-band: 0.200 +/- 0.273 * 4571 of 4577 timeseries converted to phase series. the total number of TESS systems VRO will observe: 2602 systems with at least 2.5% of points in eclipse: 1990 (0.765) systems with at least 5.0% of points in eclipse: 1696 (0.652) systems with at least 10.0% of points in eclipse: 1192 (0.458) Deep drilling EBs: [143022688, 144598282, 152507230, 219222201, 219238496, 219244444, 332910947, 332910986] 143022688: 2277 observations. 144598282: 24397 observations. 152507230: 9450 observations. 219222201: 11072 observations. 219238496: 8505 observations. 219244444: 1329 observations. 332910947: 11869 observations. 332910986: 7337 observations. opsim: roll_early_v2.99: 2077239 total field visits. fraction in u-band: 0.057 +/- 0.056 fraction in g-band: 0.088 +/- 0.133 fraction in r-band: 0.227 +/- 0.274 fraction in i-band: 0.233 +/- 0.276 fraction in z-band: 0.196 +/- 0.224 fraction in y-band: 0.199 +/- 0.272 * 4571 of 4577 timeseries converted to phase series. the total number of TESS systems VRO will observe: 2602 systems with at least 2.5% of points in eclipse: 1997 (0.767) systems with at least 5.0% of points in eclipse: 1707 (0.656) systems with at least 10.0% of points in eclipse: 1206 (0.463) Deep drilling EBs: [143022688, 144598282, 152507230, 219222201, 219238496, 219244444, 332910947, 332910986] 143022688: 2216 observations. 144598282: 24364 observations. 152507230: 9457 observations. 219222201: 11058 observations. 219238496: 8527 observations. 219244444: 1289 observations. 332910947: 11835 observations. 332910986: 7318 observations.
That concludes the calculations! The results are reported in the paper. For any comments, suggestions or corrections, please reach out to me at aprsa@villanova.edu.