<jupyter_start><jupyter_text>Download observations from TESS, Kepler<jupyter_code>kepler = search_lightcurvefile('HAT-P-11', mission='Kepler', cadence='short')
kepler_collection = kepler.download_all()
tess = search_lightcurvefile('HAT-P-11', mission='TESS', cadence='short')
tess_collection = tess.download_all()
def my_custom_corrector_func(lc):
    corrected_lc = lc.normalize().remove_outliers(sigma=4).remove_nans()#.flatten(window_length=10001)
    return corrected_lc
tes = tess_collection.SAP_FLUX.stitch(my_custom_corrector_func)
kep = kepler_collection.SAP_FLUX.stitch(my_custom_corrector_func)
period = 4.88780258
t0 = 2454605.89146
from toolkit.planet_params import hat11_params_morris
from toolkit import LightCurve, concatenate_transit_light_curves

h11 = hat11_params_morris()
kepler_lcs = LightCurve(kep.time + 2454833, kep.flux)
kepler_masked = LightCurve(**kepler_lcs.mask_out_of_transit(h11, oot_duration_fraction=0.5))
kepler_transits = kepler_masked.get_transit_light_curves(h11)

for lc in kepler_transits:
    lc.remove_polynomial_baseline(h11)

kepler_transits = concatenate_transit_light_curves(kepler_transits)
kepler_lcs = LightCurve(kep.time + 2454833, kep.flux)
kepler_masked = LightCurve(**kepler_lcs.mask_out_of_transit(h11, oot_duration_fraction=0.5))
kepler_transits = kepler_masked.get_transit_light_curves(h11)

for lc in kepler_transits:
    lc.remove_polynomial_baseline(h11)

kepler_transits = concatenate_transit_light_curves(kepler_transits)
kepler_transits.plot(h11, phase=True)
tess_lcs = LightCurve(tes.time + 2457000, tes.flux)
tess_masked = LightCurve(**tess_lcs.mask_out_of_transit(h11, oot_duration_fraction=0.5))
tess_transits = tess_masked.get_transit_light_curves(h11)

for lc in tess_transits:
    lc.remove_polynomial_baseline(h11)

tess_transits = concatenate_transit_light_curves(tess_transits)
tess_transits.plot(h11, phase=True)
plt.figure(figsize=(4, 3))
kepler_transits.plot(h11, phase=True, show=False, plot_kwargs=dict(color='k', marker='.', ls='none', rasterized=True, mec='none', label='Kepler'))
tess_transits.plot(h11, phase=True, show=False, plot_kwargs=dict(color='r', marker='.', ls='none', rasterized=True, alpha=0.7, mec='none', label='TESS'))
plt.ylim([0.992, 1.003])

ax = plt.gca()
plt.legend()
for s in ['right', 'top']: 
    ax.spines[s].set_visible(False)
plt.savefig('plots/comparison_lc.pdf', bbox_inches='tight', dpi=300)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12433100041169205, 'fraction_numerical': 0.04363935776039522, 'mean_word_length': 9.125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '323700', 'license': 'MIT', 'n_tokens_mistral': 1052, 'n_tokens_neox': 965, 'n_words': 128, 'path': 'tess_kepler.ipynb', 'repo_name': 'bmorris3/fader', 'size': '2429'}