Skip to content
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

Drop TESS rows with negative or NaN flux #213

Merged
merged 1 commit into from
Jan 18, 2024
Merged
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
11 changes: 8 additions & 3 deletions light_curves/code_src/TESS_Kepler_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ def TESS_Kepler_get_lightcurves(sample_table, radius):
# convert to Pandas
lcdf = lightcurve.to_pandas().reset_index()

# record band name
filtername = clean_filternames(lightcurve)

# filter out TESS negative fluxes (non-detections) and NaNs
# https://tess.mit.edu/public/tesstransients/pages/readme.html
if filtername == "TESS":
lcdf = lcdf.loc[lcdf.flux > 0]

# these light curves are too highly sampled for our AGN use case, so reduce their size
# by choosing only to keep every nth sample
nsample = 30
Expand All @@ -92,9 +100,6 @@ def TESS_Kepler_get_lightcurves(sample_table, radius):
flux_lc = lcdf_small.flux #in electron/s
fluxerr_lc = lcdf_small.flux_err #in electron/s

# record band name
filtername = clean_filternames(lightcurve)

# put this single object light curves into a pandas multiindex dataframe
# fluxes are in units of electrons/s and will be scaled to fit the other fluxes when plotting
dfsingle = pd.DataFrame(dict(flux=flux_lc, err=fluxerr_lc, time=time_lc, objectid=row["objectid"], band=filtername,label=row["label"])).set_index(["objectid", "label", "band", "time"])
Expand Down