-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial lc phase plot error #228
Comments
import pandas as pd
x = "359 710 978 1192 1894 1895 2005 2151 2168 2299 2321 2326 2338 2485 2537 2670 3487 4127 4144 4344 4348 4355 4356 4358 4555 4562 4635 4706 5087 5149 5153 5235 5396 5542 5571 5581 5619 5624".split()
p = [f"toi_{i}_files/tic_data.csv" for i in x]
df = pd.concat([pd.read_csv(i) for i in p])
df[['TOI int', 'Single Transit', 'Multiplanet System', 'Planet SNR']]
|
It seems like there are some single-transit systems which have non-zero period estimates on ExoFop. We set the system to be a
If the system is not a single-transit system, then our model uses
If not, we use import matplotlib.pyplot as plt
from tess_atlas.data import TICEntry
from tess_atlas.plotting import (
plot_raw_lightcurve
)
from tqdm.auto import tqdm
import os
FAILED_TOIS = "359 710 978 1192 1894 1895 2005 2151 2168 2299 2321 2326 2338 2485 2537 2670 3487 4127 4144 4344 4348 4355 4356 4358 4555 4562 4635 4706 5087 5149 5153 5235 5396 5542 5571 5581 5619 5624".split()
FAILED_TOIS = [int(i) for i in FAILED_TOIS]
OUT = "out"
os.makedirs(OUT, exist_ok=True)
for toi_n in tqdm(FAILED_TOIS, desc="Plotting TOI"):
tic = TICEntry.load(toi_n)
fig = plot_raw_lightcurve(tic, save=False)
fig.savefig(f"{OUT}/lc_{toi_n}.png")
plt.close(fig)
|
Taking a closer look at Here i have plotted |
@dfm -- any suggestions on this issue? |
Good question. I think this'll have something to do with |
@dfm -- im having trouble getting reasonable epoch values for some of these failed TOIs. I think the ExoFop epoch may be slightly off? %pip install lightkurve -q
import lightkurve as lk
import pandas as pd
EXOFOP_TOI = "https://exofop.ipac.caltech.edu/tess/download_toi.php?output=csv&toi={}"
BJD = 2457000
TOI = 1895
class ToiData:
def __init__(self, toi):
self.toi = toi
self.lc = lk.search_lightcurve(f"TOI {toi}", author="SPOC").download_all().stitch().remove_nans() -1
self.params = pd.read_csv(EXOFOP_TOI.format(toi)).to_dict('records')[0]
self.T = self.params['Period (days)']
t0 = self.params['Epoch (BJD)']-BJD
self.epochs = [t0 - self.T, t0, t0 + self.T]
def plot(self):
ax = self.lc.scatter()
ax.plot(self.epochs, [0,0,0], 'ro-')
ax.vlines([self.epochs[1]], min(self.lc.flux), 0, 'r', label='Exofop Epoch')
ax.vlines(self.epochs, min(self.lc.flux), 0, 'r', ls='--', label='Epoch+/-period')
ax.legend()
ToiData(TOI).plot() |
Ok maybe i shouldn't test with these TOIs where the epoch might be off (eg 1895, 359). Maybe these are just some TOIs that we wont be able to analyse. |
If the TOI list has incorrect entries then I think it's totally fine to punt on that for now! |
Other TOIs with the same issue:
The text was updated successfully, but these errors were encountered: