diff --git a/exovetter/utils.py b/exovetter/utils.py index f5a3115..9fe33d1 100644 --- a/exovetter/utils.py +++ b/exovetter/utils.py @@ -2,13 +2,12 @@ import sys import warnings -import vetters as vet import numpy as np __all__ = ['sine', 'estimate_scatter', 'mark_transit_cadences', 'median_detrend', 'plateau', 'set_median_flux_to_zero', 'set_median_flux_to_one', 'sigmaClip', - 'get_mast_tce', 'WqedLSF', 'compute_phases', 'first_epoch', 'run_all'] + 'get_mast_tce', 'WqedLSF', 'compute_phases', 'first_epoch'] def sine(x, order, period=1): """Sine function for SWEET vetter.""" @@ -654,144 +653,3 @@ def first_epoch(epoch, period, lc): first_epoch = epoch + N*period return first_epoch - -def run_all(tces, lcs, vetters=[vet.VizTransits(), vet.ModShift(), vet.Lpp(), vet.OddEven(), vet.TransitPhaseCoverage(), vet.Sweet(), vet.LeoTransitEvents()], plot=False, verbose=False, plot_dir=None): - # TODO Add centroid, maybe rething plotting in general since plotting uses vetter.plot which essentially doubles runtime, - # probably should run initially with vet.run(plot=True) and not store them unless run_all plot=True - """Runs vetters and packs results into a dataframe. - - Parameters - ---------- - tces: list of tce objects to vet on - - lc: list of lightkurve objects to vet on - - vetters : list - List of vetter classes to run - - plot : bool - Toggle diagnostic plots - - plot_dir : str - path to store plots in, defaults to current working directory - - verbose : bool - Toggle timing info and other print statements - - Returns - ------------ - results : dataframe - Pandas dataframe of all the numerical results from the vetters - - """ - - results_dicts = [] # initialize a list to pack results from each tce into - tce_names = [] - run_start = py_time.time() - - if plot_dir is None: - plot_dir = os.getcwd() - - if plot or verbose: - for tce in tces: - if 'target' not in tce.keys(): - print("ERROR: Please supply a 'target' key to all input tces to use the plot or verbose parameters") - return - - for tce, lc in zip(tces, lcs): - if verbose: - print('Vetting', tce['target'], ':') - - tce_names.append(tce['target']) - results_list = [] # initialize a list to pack result dictionaries into - - # run each vetter, if plotting is true fill the figures into a list to save later - plot_figures = [] - for vetter in vetters: - time_start = py_time.time() - vetter_results = vetter.run(tce, lc) - - if plot: - if vetter.__class__.__name__ != 'VizTransits' and vetter.__class__.__name__ != 'LeoTransitEvents': - # viz_transits generates 2 figures so it's handled later, LeoTransitEvents just doesn't have a plot - vetter.plot() - vetter_plot = plt.gcf() - vetter_plot.suptitle(tce['target']+' '+vetter.__class__.__name__) - vetter_plot.tight_layout() - plt.close() - plot_figures.append(vetter_plot) - - if verbose: - time_end = py_time.time() - print(vetter.__class__.__name__, 'finished in', time_end - time_start, 's.') - - results_list.append(vetter_results) - - if verbose: # add some whitespace for readability - print() - - if plot: # save a pdf of each figure made for that vetter - diagnostic_plot = PdfPages(plot_dir+tce['target']+'.pdf') # initialize a pdf to save each figure into - - # plot the lightcurve with epochs oeverplotted - time, flux, time_offset_str = lightkurve_utils.unpack_lk_version(lc, "flux") # noqa: E50 - period = tce["period"].to_value(u.day) - dur = tce["duration"].to_value(u.day) - - time_offset_q = getattr(exo_const, time_offset_str) - epoch = tce.get_epoch(time_offset_q).to_value(u.day) - intransit = utils.mark_transit_cadences(time, period, epoch, dur, num_durations=3, flags=None) - - fig, ax1 = plt.subplots(nrows=1, ncols=1, figsize=(9,5)) - ax1.plot(time, flux, lw=0.4); - ax1.axvline(x=epoch, lw='0.6', color='r', label='epoch'); - ax1.fill_between(time, 0,1, where=intransit, transform=ax1.get_xaxis_transform(), color='r', alpha=0.15, label='in transit') - - ax1.set_ylabel('Flux') - ax1.set_xlabel('Time '+time_offset_str) - if 'target' in tce: - ax1.set_title(tce['target']); - - ax1.legend(); - lightcurve_plot = plt.gcf() - plt.close() - diagnostic_plot.savefig(lightcurve_plot) - - # run viz_transits plots - transit = VizTransits(transit_plot=True, folded_plot=False).run(tce, lc) - transit_plot = plt.gcf() - transit_plot.suptitle(tce['target']+' Transits') - transit_plot.tight_layout() - plt.close() - diagnostic_plot.savefig(transit_plot) - - folded = VizTransits(transit_plot=False, folded_plot=True).run(tce, lc) - folded_plot = plt.gcf() - folded_plot.suptitle(tce['target']+' Folded Transits') - folded_plot.tight_layout() - plt.close() - diagnostic_plot.savefig(folded_plot) - - # Save each diagnostic plot ran on that tce/lc - for plot in plot_figures: - diagnostic_plot.savefig(plot) - - diagnostic_plot.close() - - # put all values from each results dictionary into a single dictionary - results_dict = {k: v for d in results_list for k, v in d.items()} - - # delete dictionary entries that are huge arrays to save space - if results_dict.get('plot_data'): - del results_dict['plot_data'] - - # add the dictionary to the final list - results_dicts.append(results_dict) - - results_df = pd.DataFrame(results_dicts) # Put the values from each result dictionary into a dataframe - - results_df.insert(loc=0, column='tce', value=tce_names) - if verbose: - print('Execution time:', (py_time.time() - run_start), 's') - - return results_df diff --git a/exovetter/vetters.py b/exovetter/vetters.py index 6d0b354..dd58baf 100644 --- a/exovetter/vetters.py +++ b/exovetter/vetters.py @@ -26,7 +26,7 @@ __all__ = ['BaseVetter', 'ModShift', 'Lpp', 'OddEven', 'TransitPhaseCoverage', 'Sweet', 'Centroid', - 'VizTransits', 'LeoTransitEvents'] + 'VizTransits', 'LeoTransitEvents', 'run_all'] class BaseVetter(ABC): """Base class for vetters. @@ -900,3 +900,144 @@ def run(self, tce, lightcurve, plot=False): def plot(self): pass + +def run_all(tces, lcs, vetters=[VizTransits(), ModShift(), Lpp(), OddEven(), TransitPhaseCoverage(), Sweet(), LeoTransitEvents()], plot=False, verbose=False, plot_dir=None): + # TODO Add centroid, maybe rething plotting in general since plotting uses vetter.plot which essentially doubles runtime, + # probably should run initially with vet.run(plot=True) and not store them unless run_all plot=True + """Runs vetters and packs results into a dataframe. + + Parameters + ---------- + tces: list of tce objects to vet on + + lc: list of lightkurve objects to vet on + + vetters : list + List of vetter classes to run + + plot : bool + Toggle diagnostic plots + + plot_dir : str + path to store plots in, defaults to current working directory + + verbose : bool + Toggle timing info and other print statements + + Returns + ------------ + results : dataframe + Pandas dataframe of all the numerical results from the vetters + + """ + + results_dicts = [] # initialize a list to pack results from each tce into + tce_names = [] + run_start = py_time.time() + + if plot_dir is None: + plot_dir = os.getcwd() + + if plot or verbose: + for tce in tces: + if 'target' not in tce.keys(): + print("ERROR: Please supply a 'target' key to all input tces to use the plot or verbose parameters") + return + + for tce, lc in zip(tces, lcs): + if verbose: + print('Vetting', tce['target'], ':') + + tce_names.append(tce['target']) + results_list = [] # initialize a list to pack result dictionaries into + + # run each vetter, if plotting is true fill the figures into a list to save later + plot_figures = [] + for vetter in vetters: + time_start = py_time.time() + vetter_results = vetter.run(tce, lc) + + if plot: + if vetter.__class__.__name__ != 'VizTransits' and vetter.__class__.__name__ != 'LeoTransitEvents': + # viz_transits generates 2 figures so it's handled later, LeoTransitEvents just doesn't have a plot + vetter.plot() + vetter_plot = plt.gcf() + vetter_plot.suptitle(tce['target']+' '+vetter.__class__.__name__) + vetter_plot.tight_layout() + plt.close() + plot_figures.append(vetter_plot) + + if verbose: + time_end = py_time.time() + print(vetter.__class__.__name__, 'finished in', time_end - time_start, 's.') + + results_list.append(vetter_results) + + if verbose: # add some whitespace for readability + print() + + if plot: # save a pdf of each figure made for that vetter + diagnostic_plot = PdfPages(plot_dir+tce['target']+'.pdf') # initialize a pdf to save each figure into + + # plot the lightcurve with epochs oeverplotted + time, flux, time_offset_str = lightkurve_utils.unpack_lk_version(lc, "flux") # noqa: E50 + period = tce["period"].to_value(u.day) + dur = tce["duration"].to_value(u.day) + + time_offset_q = getattr(exo_const, time_offset_str) + epoch = tce.get_epoch(time_offset_q).to_value(u.day) + intransit = utils.mark_transit_cadences(time, period, epoch, dur, num_durations=3, flags=None) + + fig, ax1 = plt.subplots(nrows=1, ncols=1, figsize=(9,5)) + ax1.plot(time, flux, lw=0.4); + ax1.axvline(x=epoch, lw='0.6', color='r', label='epoch'); + ax1.fill_between(time, 0,1, where=intransit, transform=ax1.get_xaxis_transform(), color='r', alpha=0.15, label='in transit') + + ax1.set_ylabel('Flux') + ax1.set_xlabel('Time '+time_offset_str) + if 'target' in tce: + ax1.set_title(tce['target']); + + ax1.legend(); + lightcurve_plot = plt.gcf() + plt.close() + diagnostic_plot.savefig(lightcurve_plot) + + # run viz_transits plots + transit = VizTransits(transit_plot=True, folded_plot=False).run(tce, lc) + transit_plot = plt.gcf() + transit_plot.suptitle(tce['target']+' Transits') + transit_plot.tight_layout() + plt.close() + diagnostic_plot.savefig(transit_plot) + + folded = VizTransits(transit_plot=False, folded_plot=True).run(tce, lc) + folded_plot = plt.gcf() + folded_plot.suptitle(tce['target']+' Folded Transits') + folded_plot.tight_layout() + plt.close() + diagnostic_plot.savefig(folded_plot) + + # Save each diagnostic plot ran on that tce/lc + for plot in plot_figures: + diagnostic_plot.savefig(plot) + + diagnostic_plot.close() + + # put all values from each results dictionary into a single dictionary + results_dict = {k: v for d in results_list for k, v in d.items()} + + # delete dictionary entries that are huge arrays to save space + if results_dict.get('plot_data'): + del results_dict['plot_data'] + + # add the dictionary to the final list + results_dicts.append(results_dict) + + results_df = pd.DataFrame(results_dicts) # Put the values from each result dictionary into a dataframe + + results_df.insert(loc=0, column='tce', value=tce_names) + if verbose: + print('Execution time:', (py_time.time() - run_start), 's') + + return results_df \ No newline at end of file diff --git a/tutorial_notebooks/run_all.ipynb b/tutorial_notebooks/run_all.ipynb index 85ae7db..8b0ce43 100644 --- a/tutorial_notebooks/run_all.ipynb +++ b/tutorial_notebooks/run_all.ipynb @@ -21,9 +21,7 @@ "from exovetter import utils\n", "import lightkurve as lk\n", "import numpy as np\n", - "import os\n", - "%load_ext autoreload\n", - "%autoreload 2" + "import os" ] }, { @@ -37,7 +35,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 2, "id": "5905c663", "metadata": {}, "outputs": [ @@ -88,7 +86,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 3, "id": "e2646650-6f17-4729-897b-149733434550", "metadata": {}, "outputs": [ @@ -103,7 +101,7 @@ "data": { "text/html": [ "
TessLightCurve length=1085 LABEL="TIC 50365310" SECTOR=7 AUTHOR=SPOC FLUX_ORIGIN=pdcsap_flux\n", - "\n", + "
\n", "\n", "\n", "\n", @@ -180,7 +178,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 4, "id": "bad044e4-dbc7-442d-9152-d769d2dcfbfc", "metadata": {}, "outputs": [ @@ -419,13 +417,13 @@ "[5 rows x 40 columns]" ] }, - "execution_count": 8, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "results = utils.run_all(tces, lcs)\n", + "results = vet.run_all(tces, lcs)\n", "results" ] }, @@ -439,7 +437,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 5, "id": "f34c1b73-15bd-4fe7-81bc-47d1261fc0ce", "metadata": {}, "outputs": [ @@ -506,7 +504,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 6, "id": "36885532-5795-439a-b418-8c36f29f6ed4", "metadata": {}, "outputs": [ @@ -515,12 +513,12 @@ "output_type": "stream", "text": [ "Vetting TOI_1000.01 :\n", - "VizTransits finished in 0.0026009082794189453 s.\n", - "ModShift finished in 0.0019757747650146484 s.\n", - "Lpp finished in 0.11938214302062988 s.\n", - "OddEven finished in 0.0006961822509765625 s.\n", - "TransitPhaseCoverage finished in 0.0002238750457763672 s.\n", - "Sweet finished in 0.0022652149200439453 s.\n" + "VizTransits finished in 0.0033979415893554688 s.\n", + "ModShift finished in 0.0020651817321777344 s.\n", + "Lpp finished in 0.12156391143798828 s.\n", + "OddEven finished in 0.0007009506225585938 s.\n", + "TransitPhaseCoverage finished in 0.00023508071899414062 s.\n", + "Sweet finished in 0.002227783203125 s.\n" ] }, { @@ -537,15 +535,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "LeoTransitEvents finished in 0.09229278564453125 s.\n", + "LeoTransitEvents finished in 0.09868192672729492 s.\n", "\n", "Vetting TOI_1001.01 :\n", - "VizTransits finished in 0.0017790794372558594 s.\n", - "ModShift finished in 0.0015358924865722656 s.\n", - "Lpp finished in 0.12367486953735352 s.\n", - "OddEven finished in 0.0008358955383300781 s.\n", - "TransitPhaseCoverage finished in 0.00024127960205078125 s.\n", - "Sweet finished in 0.0023260116577148438 s.\n" + "VizTransits finished in 0.0031621456146240234 s.\n", + "ModShift finished in 0.0020949840545654297 s.\n", + "Lpp finished in 0.11873173713684082 s.\n", + "OddEven finished in 0.0009989738464355469 s.\n", + "TransitPhaseCoverage finished in 0.000247955322265625 s.\n", + "Sweet finished in 0.0025022029876708984 s.\n" ] }, { @@ -562,15 +560,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "LeoTransitEvents finished in 0.09924602508544922 s.\n", + "LeoTransitEvents finished in 0.10347580909729004 s.\n", "\n", "Vetting TOI_1004.01 :\n", - "VizTransits finished in 0.0021109580993652344 s.\n", - "ModShift finished in 0.0017731189727783203 s.\n", - "Lpp finished in 0.17325520515441895 s.\n", - "OddEven finished in 0.0008318424224853516 s.\n", - "TransitPhaseCoverage finished in 0.00026297569274902344 s.\n", - "Sweet finished in 0.0033299922943115234 s.\n" + "VizTransits finished in 0.0022132396697998047 s.\n", + "ModShift finished in 0.0019309520721435547 s.\n", + "Lpp finished in 0.1642301082611084 s.\n", + "OddEven finished in 0.0007297992706298828 s.\n", + "TransitPhaseCoverage finished in 0.00024771690368652344 s.\n", + "Sweet finished in 0.0029959678649902344 s.\n" ] }, { @@ -587,15 +585,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "LeoTransitEvents finished in 0.2060708999633789 s.\n", + "LeoTransitEvents finished in 0.1989738941192627 s.\n", "\n", "Vetting TOI_1007.01 :\n", - "VizTransits finished in 0.0016508102416992188 s.\n", - "ModShift finished in 0.002147197723388672 s.\n", - "Lpp finished in 0.1242671012878418 s.\n", - "OddEven finished in 0.0006961822509765625 s.\n", - "TransitPhaseCoverage finished in 0.0002219676971435547 s.\n", - "Sweet finished in 0.002146005630493164 s.\n" + "VizTransits finished in 0.001790761947631836 s.\n", + "ModShift finished in 0.001528024673461914 s.\n", + "Lpp finished in 0.12382984161376953 s.\n", + "OddEven finished in 0.0006921291351318359 s.\n", + "TransitPhaseCoverage finished in 0.00022602081298828125 s.\n", + "Sweet finished in 0.002209901809692383 s.\n" ] }, { @@ -612,18 +610,18 @@ "name": "stdout", "output_type": "stream", "text": [ - "LeoTransitEvents finished in 0.09681200981140137 s.\n", + "LeoTransitEvents finished in 0.09269189834594727 s.\n", "\n", "Vetting TOI_1011.01 :\n", - "VizTransits finished in 0.0021882057189941406 s.\n", - "ModShift finished in 0.0017290115356445312 s.\n", - "Lpp finished in 0.1316239833831787 s.\n", - "OddEven finished in 0.0008869171142578125 s.\n", - "TransitPhaseCoverage finished in 0.000270843505859375 s.\n", - "Sweet finished in 0.0029489994049072266 s.\n", - "LeoTransitEvents finished in 0.10241985321044922 s.\n", + "VizTransits finished in 0.004579067230224609 s.\n", + "ModShift finished in 0.0024979114532470703 s.\n", + "Lpp finished in 0.11461210250854492 s.\n", + "OddEven finished in 0.001191854476928711 s.\n", + "TransitPhaseCoverage finished in 0.0004417896270751953 s.\n", + "Sweet finished in 0.0025200843811035156 s.\n", + "LeoTransitEvents finished in 0.10301089286804199 s.\n", "\n", - "Execution time: 1.3098130226135254 s\n" + "Execution time: 1.2864856719970703 s\n" ] }, { @@ -845,13 +843,13 @@ "[5 rows x 40 columns]" ] }, - "execution_count": 10, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "utils.run_all(tces, lcs, verbose=True)" + "vet.run_all(tces, lcs, verbose=True)" ] }, { @@ -864,7 +862,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 7, "id": "e2f768e4-daf6-4c81-981d-c95122fb68ae", "metadata": {}, "outputs": [ @@ -873,12 +871,12 @@ "output_type": "stream", "text": [ "Vetting TOI_1000.01 :\n", - "VizTransits finished in 0.0023818016052246094 s.\n", - "ModShift finished in 0.20995092391967773 s.\n", - "Lpp finished in 0.2312309741973877 s.\n", - "OddEven finished in 0.06843924522399902 s.\n", - "TransitPhaseCoverage finished in 0.032601118087768555 s.\n", - "Sweet finished in 0.07028007507324219 s.\n" + "VizTransits finished in 0.003843069076538086 s.\n", + "ModShift finished in 0.22887396812438965 s.\n", + "Lpp finished in 0.22654104232788086 s.\n", + "OddEven finished in 0.07564377784729004 s.\n", + "TransitPhaseCoverage finished in 0.03296995162963867 s.\n", + "Sweet finished in 0.0754239559173584 s.\n" ] }, { @@ -895,17 +893,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "LeoTransitEvents finished in 0.10457897186279297 s.\n", + "LeoTransitEvents finished in 0.10062885284423828 s.\n", "\n", "Vetting TOI_1001.01 :\n", - "VizTransits finished in 0.00249481201171875 s.\n", - "ModShift finished in 0.08408093452453613 s.\n", - "Lpp finished in 0.25842905044555664 s.\n", - "OddEven finished in 0.0720529556274414 s.\n", - "TransitPhaseCoverage finished in 0.040396928787231445 s.\n", - "Sweet finished in 0.09176993370056152 s.\n", - "LeoTransitEvents finished in 0.10706806182861328 s.\n", - "\n" + "VizTransits finished in 0.002048015594482422 s.\n", + "ModShift finished in 0.07797884941101074 s.\n", + "Lpp finished in 0.24198412895202637 s.\n", + "OddEven finished in 0.0640571117401123 s.\n", + "TransitPhaseCoverage finished in 0.035349130630493164 s.\n", + "Sweet finished in 0.08143305778503418 s.\n" ] }, { @@ -922,13 +918,15 @@ "name": "stdout", "output_type": "stream", "text": [ + "LeoTransitEvents finished in 0.10015416145324707 s.\n", + "\n", "Vetting TOI_1004.01 :\n", - "VizTransits finished in 0.0025000572204589844 s.\n", - "ModShift finished in 0.07913088798522949 s.\n", - "Lpp finished in 0.2831149101257324 s.\n", - "OddEven finished in 0.0731649398803711 s.\n", - "TransitPhaseCoverage finished in 0.034700870513916016 s.\n", - "Sweet finished in 0.09195399284362793 s.\n" + "VizTransits finished in 0.0022280216217041016 s.\n", + "ModShift finished in 0.07458901405334473 s.\n", + "Lpp finished in 0.2812201976776123 s.\n", + "OddEven finished in 0.0686037540435791 s.\n", + "TransitPhaseCoverage finished in 0.031362056732177734 s.\n", + "Sweet finished in 0.08179998397827148 s.\n" ] }, { @@ -945,15 +943,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "LeoTransitEvents finished in 0.2190110683441162 s.\n", + "LeoTransitEvents finished in 0.2036757469177246 s.\n", "\n", "Vetting TOI_1007.01 :\n", - "VizTransits finished in 0.0019881725311279297 s.\n", - "ModShift finished in 0.08329105377197266 s.\n", - "Lpp finished in 0.2544231414794922 s.\n", - "OddEven finished in 0.07157588005065918 s.\n", - "TransitPhaseCoverage finished in 0.03624987602233887 s.\n", - "Sweet finished in 0.08405303955078125 s.\n" + "VizTransits finished in 0.0015697479248046875 s.\n", + "ModShift finished in 0.08336281776428223 s.\n", + "Lpp finished in 0.24611878395080566 s.\n", + "OddEven finished in 0.06262087821960449 s.\n", + "TransitPhaseCoverage finished in 0.031687021255493164 s.\n", + "Sweet finished in 0.07726097106933594 s.\n" ] }, { @@ -970,15 +968,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "LeoTransitEvents finished in 0.09392428398132324 s.\n", + "LeoTransitEvents finished in 0.09960699081420898 s.\n", "\n", "Vetting TOI_1011.01 :\n", - "VizTransits finished in 0.0024030208587646484 s.\n", - "ModShift finished in 0.0794069766998291 s.\n", - "Lpp finished in 0.24875187873840332 s.\n", - "OddEven finished in 0.07429099082946777 s.\n", - "TransitPhaseCoverage finished in 0.03765296936035156 s.\n", - "Sweet finished in 0.08509302139282227 s.\n" + "VizTransits finished in 0.0026531219482421875 s.\n", + "ModShift finished in 0.06942915916442871 s.\n", + "Lpp finished in 0.22440290451049805 s.\n", + "OddEven finished in 0.06994199752807617 s.\n", + "TransitPhaseCoverage finished in 0.03462505340576172 s.\n", + "Sweet finished in 0.07561588287353516 s.\n" ] }, { @@ -995,9 +993,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "LeoTransitEvents finished in 0.0972909927368164 s.\n", + "LeoTransitEvents finished in 0.1004798412322998 s.\n", "\n", - "Execution time: 7.906814813613892 s\n" + "Execution time: 7.523571252822876 s\n" ] }, { @@ -1209,14 +1207,14 @@ "[5 rows x 40 columns]" ] }, - "execution_count": 11, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "plot_dir = os.getcwd() + '/run_all_plots/'\n", - "utils.run_all(tces, lcs, plot=True, plot_dir=plot_dir, verbose=True)" + "vet.run_all(tces, lcs, plot=True, plot_dir=plot_dir, verbose=True)" ] }, { @@ -1229,7 +1227,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 8, "id": "c9d822ab-16dc-4296-88e6-ef3be34efa3f", "metadata": {}, "outputs": [ @@ -1238,31 +1236,31 @@ "output_type": "stream", "text": [ "Vetting TOI_1000.01 :\n", - "ModShift finished in 0.0028450489044189453 s.\n", - "OddEven finished in 0.0007598400115966797 s.\n", - "Sweet finished in 0.0027332305908203125 s.\n", + "ModShift finished in 0.004275321960449219 s.\n", + "OddEven finished in 0.0007128715515136719 s.\n", + "Sweet finished in 0.0023560523986816406 s.\n", "\n", "Vetting TOI_1001.01 :\n", - "ModShift finished in 0.0018889904022216797 s.\n", - "OddEven finished in 0.0007419586181640625 s.\n", - "Sweet finished in 0.002672910690307617 s.\n", + "ModShift finished in 0.0018801689147949219 s.\n", + "OddEven finished in 0.0007581710815429688 s.\n", + "Sweet finished in 0.0030488967895507812 s.\n", "\n", "Vetting TOI_1004.01 :\n", - "ModShift finished in 0.002496004104614258 s.\n", - "OddEven finished in 0.0007910728454589844 s.\n", - "Sweet finished in 0.0038080215454101562 s.\n", + "ModShift finished in 0.0038678646087646484 s.\n", + "OddEven finished in 0.0008869171142578125 s.\n", + "Sweet finished in 0.004680156707763672 s.\n", "\n", "Vetting TOI_1007.01 :\n", - "ModShift finished in 0.0017549991607666016 s.\n", - "OddEven finished in 0.0006771087646484375 s.\n", - "Sweet finished in 0.002209901809692383 s.\n", + "ModShift finished in 0.002006053924560547 s.\n", + "OddEven finished in 0.0006930828094482422 s.\n", + "Sweet finished in 0.0022268295288085938 s.\n", "\n", "Vetting TOI_1011.01 :\n", - "ModShift finished in 0.0016150474548339844 s.\n", - "OddEven finished in 0.0006268024444580078 s.\n", - "Sweet finished in 0.002237081527709961 s.\n", + "ModShift finished in 0.0017788410186767578 s.\n", + "OddEven finished in 0.0006690025329589844 s.\n", + "Sweet finished in 0.0023241043090820312 s.\n", "\n", - "Execution time: 0.02939009666442871 s\n" + "Execution time: 0.034240007400512695 s\n" ] }, { @@ -1479,13 +1477,13 @@ "4 [[1.2134464387025161e-05, 4.865065235028228e-0... " ] }, - "execution_count": 12, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "utils.run_all(tces, lcs, vetters=[vet.ModShift(), vet.OddEven(dur_frac=0.9), vet.Sweet()], verbose=True)\n" + "vet.run_all(tces, lcs, vetters=[vet.ModShift(), vet.OddEven(dur_frac=0.9), vet.Sweet()], verbose=True)\n" ] } ], diff --git a/tutorial_notebooks/run_all_plots/TOI_1000.01.pdf b/tutorial_notebooks/run_all_plots/TOI_1000.01.pdf index f1b707a..6fa8cd5 100644 Binary files a/tutorial_notebooks/run_all_plots/TOI_1000.01.pdf and b/tutorial_notebooks/run_all_plots/TOI_1000.01.pdf differ diff --git a/tutorial_notebooks/run_all_plots/TOI_1001.01.pdf b/tutorial_notebooks/run_all_plots/TOI_1001.01.pdf index 4d142a0..8d0437a 100644 Binary files a/tutorial_notebooks/run_all_plots/TOI_1001.01.pdf and b/tutorial_notebooks/run_all_plots/TOI_1001.01.pdf differ diff --git a/tutorial_notebooks/run_all_plots/TOI_1004.01.pdf b/tutorial_notebooks/run_all_plots/TOI_1004.01.pdf index bd66b51..d3b495f 100644 Binary files a/tutorial_notebooks/run_all_plots/TOI_1004.01.pdf and b/tutorial_notebooks/run_all_plots/TOI_1004.01.pdf differ diff --git a/tutorial_notebooks/run_all_plots/TOI_1007.01.pdf b/tutorial_notebooks/run_all_plots/TOI_1007.01.pdf index 3560360..00764ec 100644 Binary files a/tutorial_notebooks/run_all_plots/TOI_1007.01.pdf and b/tutorial_notebooks/run_all_plots/TOI_1007.01.pdf differ diff --git a/tutorial_notebooks/run_all_plots/TOI_1011.01.pdf b/tutorial_notebooks/run_all_plots/TOI_1011.01.pdf index 3807b61..48385d6 100644 Binary files a/tutorial_notebooks/run_all_plots/TOI_1011.01.pdf and b/tutorial_notebooks/run_all_plots/TOI_1011.01.pdf differ
timefluxflux_errtimecorrcadencenocentroid_colcentroid_rowsap_fluxsap_flux_errsap_bkgsap_bkg_errpdcsap_fluxpdcsap_flux_errqualitypsf_centr1psf_centr1_errpsf_centr2psf_centr2_errmom_centr1mom_centr1_errmom_centr2mom_centr2_errpos_corr1pos_corr2
dpixpixelectron / selectron / selectron / selectron / selectron / selectron / spixpixpixpixpixpixpixpixpixpix
Timefloat64float64float32int32float64float64float32float32float32float32float32float32int32float64float32float64float32float64float32float64float32float32float32