-
Notifications
You must be signed in to change notification settings - Fork 158
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
Modified CDIPS output to present flux values and BTJD time #1335
base: main
Are you sure you want to change the base?
Changes from 3 commits
15487a3
476555c
aad9528
7b8c3bb
7d9d36d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,8 @@ | |
log = logging.getLogger(__name__) | ||
|
||
def read_cdips_lightcurve(filename, | ||
flux_column="IRM1", | ||
include_inst_errs=False, | ||
flux_column="IFL1", | ||
include_inst_errs=True, | ||
quality_bitmask=None): | ||
"""Returns a TESS CDIPS `~lightkurve.lightcurve.LightCurve`. | ||
|
||
|
@@ -25,6 +25,11 @@ def read_cdips_lightcurve(filename, | |
is allowed. The `quality_bitmask` parameter is ignored but accepted for | ||
compatibility with other data format readers. | ||
|
||
There are several kinds of flux and magnitudes provided. For consistancy | ||
we have chosen to display as default 'IFL1', the flux in aperture 1. | ||
This is given in ADU. | ||
The flux_err is also provided as 'IFE1' in ADU | ||
|
||
More information: https://archive.stsci.edu/hlsp/cdips | ||
|
||
Parameters | ||
|
@@ -40,9 +45,10 @@ def read_cdips_lightcurve(filename, | |
""" | ||
ap = flux_column[-1] | ||
|
||
# Only the instrumental magnitudes are provided, and are not provided for | ||
# trend-filtered light curves. User should select whether to include the | ||
# instrumental errors or ignore them | ||
# A user can chose to dipsplay the magnitudes or any of the other flux values, | ||
# They can do this by using the flux_column key | ||
# By default the flux_err for the given flux specified is returned | ||
|
||
if include_inst_errs: | ||
# If fluxes are requested, return flux errors | ||
if flux_column[:-1].lower()=="ifl": | ||
|
@@ -63,6 +69,11 @@ def read_cdips_lightcurve(filename, | |
quality_column=quality_column, | ||
time_format='btjd') | ||
|
||
#The time displayed is in BJD not BTJD. We can fix this by subtracting | ||
# 2457000 | ||
lc["time"] = lc["time"]-2457000 | ||
|
||
|
||
# Filter out poor-quality data | ||
# NOTE: Unfortunately Astropy Table masking does not yet work for columns | ||
# that are Quantity objects, so for now we remove poor-quality data instead | ||
|
@@ -74,8 +85,19 @@ def read_cdips_lightcurve(filename, | |
quality_mask = (lc['quality']=="G") | (lc['quality']=="0") | ||
lc = lc[quality_mask] | ||
|
||
|
||
#This makes sure that the TIC ID is obtained and returned as the plot label | ||
tic = lc.meta.get('TICID') | ||
if tic is not None: | ||
# compatibility with SPOC, QLP, etc. | ||
lc.meta["TARGETID"] = tic | ||
lc.meta["TICID"] = tic | ||
lc.meta["OBJECT"] = f"TIC {tic}" | ||
# for Lightkurve's plotting methods | ||
lc.meta["LABEL"] = f"TIC {tic}" | ||
|
||
|
||
lc.meta["AUTHOR"] = "CDIPS" | ||
lc.meta['TARGETID'] = lc.meta.get('TICID') | ||
lc.meta['QUALITY_BITMASK'] = 36 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The bitmask needs to be updated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the point here to change the quality bitmask to the TESS default i.e., 175? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Additionally CDIPS light curves have already had quality filtering applied, and do not provide the bitflags necessary for a user to apply a new bitmask. |
||
lc.meta['QUALITY_MASK'] = quality_mask | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be taken care of with the
time_format
argument by setting it tojd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has now been adjusted. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note however that the time is given in BJD, but this does not seem to be an option.