KeplerGO / pyke

Easy command line tools for Kepler, K2 & TESS data analysis.
http://pyke.keplerscience.org
118 stars 35 forks source link

Simplifying access to MAST via Exoplanet Archives #147

Open evh3rd opened 6 years ago

evh3rd commented 6 years ago

Currently light curve files are specified by filename. I have been exploring Dan Foreman-Mackey's http://dfm.io/kplr/, which provides a way to look up light curves via the NASA Exoplanet Archive. For example, curves can be accessed via Kepler name, KIC, and KOI. The retrieved light curves are stored in structure rooted at a location defined by environment variable with directories for light curves from each KIC under it. Caching is supported (with a clobber flag to supported replacing a bad file).

I would like to see something like this in pyke and would be willing to build something based on kplr for it. Flags like --koi --kic --kepname would cause the current filename argument to be interpreted differently. Support quarters would be provided too.

barentsen commented 6 years ago

@evh3rd Thank you for the feedback, I fully agree that PyKE needs to be able to automatically retrieve data by star id (name, KIC, EPIC) or planet id (name, KOI). A while ago we looked into adding klpr as a dependency, but we ended up deciding that we'd rather want to support and maintain it natively in PyKE because kplr's API is rather focused on planets and this really deserves to be a carefully-crafted core feature of PyKE.

I think the first step is to add support for data retrieval to our band new API, i.e. I imagine we may want to add the following two static methods: KeplerTargetPixelFile.from_archive(name=..., kic=..., epic=..., koi=...) KeplerLightCurve.from_archive()

We haven't done any work on this, and happily take pull requests!

barentsen commented 6 years ago

I must add that this function (or perhaps a more general DataArchive class) will want to wrap the MAST API so that pixel files and lighcurves can also be obtained by channel, by campaign, by time range, etc.

The MAST API docs are here: https://archive.stsci.edu/vo/mast_services.html

Though we could conceivably start with only supporting KIC and EPIC IDs, which will be more trivial to implement.

evh3rd commented 6 years ago

I can adapt the code from kplr that accesses MAST to do the whole thing. It retrieves the webpage and parses it. I assume that it is front end for a database, but I doubt that I can access that directly. I will look into what information is available about TESS to see how close I can make this to being TESS ready. When I get a chance, I will put together a document describing the interface I plan to implement and the general design. I like the idea of the DataArchive class. My plan would be to call it and pass the path to the cached data file(s) to the existing code, which should not be aware of the front end.

Is there a TESS Instrument Handbook analogous to the Kepler Instrument Handbook?