guynir42 / AstroRetriever

A package used for downloading and processing images from various astronomical surveys
Other
4 stars 2 forks source link

Download TESS lightcurves #15

Closed guynir42 closed 1 year ago

guynir42 commented 2 years ago

Here are some things we need to do to get TESS integrated into VO: 1) create a new file named tess.py 2) Use the existing template in ztf.py to make a ParsObsTESS and VirtualTESS classes. 3) Make a fetch_data_from_observatory function (like the one in observatory.py under VirtualDemoObs class. It should accept the arguments self, cat_row, verbose=0 and any others that may be needed. This should return a dataframe with all photometry for a source, assuming cat_row is a dictionary that has ra and dec keys 4) Add a reduce_to_lightcurves function similar to that in VirtualZTF. This function should accept self, datasets, source=None, init_kwargs={} and any other arguments (probably want to add _** in the end to absorb additional but irrelevant keywords). This function should split up a dataset of raw data into lightcurves for different visits.

guynir42 commented 2 years ago

Hey @felixzhu555 I’m using Zenhub in GitHub, click this link to join my workspace and see other features available in GitHub or download the Zenhub extension and sign up with your GitHub account. Posted using Zenhub

felixzhu555 commented 2 years ago

Should we use SAP_FLUX or PDCSAP_FLUX? The TESS documentation says SAP is "Simple aperture photometry light curve" and PDCSAP is "PDC corrected SAP light curve". I'm going to default to PDC.

guynir42 commented 2 years ago

Sounds like a good bet to use the corrected lightcurve. I'll try to figure out what the differences are. It could also be good to download a few examples and plot them to try to see the differences.

felixzhu555 commented 2 years ago

Plotted one sample, it seems like PDC values are higher than SAP values by about 1000 e-/s (15400 vs 14400 average). Also, is this paper related to our goals? https://www.researchgate.net/publication/358457993_Searching_for_white_dwarf_variables_in_TESS_data

felixzhu555 commented 2 years ago

Comparing by magnitude seems a bit fuzzy, querying by MAST returns observations with slightly different mag values than those for the GAIA catalog. For example, GAIA's g_mean_mag = 8.524133, but astroquery yields GAIAmag = 8.47446. I wanted to clarify, what exactly is mag being used for in fetch_data? Is it just used to filter out anything with mag > threshold? Or do we also use mag to query?

felixzhu555 commented 2 years ago

astroquery also seems to have HTTP timeouts quite frequently, don't know how we can have the code handle such random issues.

guynir42 commented 2 years ago

The magnitude will not be exactly the same, these are different instruments with different wavelength bands. If the magnitude of some lightcurve is really far from the expected value that means it is the wrong source / mixed source, so we'll skip it. Besides that the magnitude is not needed for the query itself.

Do the PDC values seem more stable over the lightcurve? Can you calculate the RMS/mean of each lightcurve? Perhaps the noise is removed/detrended somehow.

One way to handle timeouts would be to make a loop (with, e.g., 10 tries) and in that loop do a try/except block. You'd want to "catch" only the timeout exceptions and ignore them (maybe print out something or not).