stevengiacalone / triceratops

Tool for Rating Interesting Candidate Exoplanets and Reliability Analysis of Transits Originating from Proximate Stars
https://triceratops.readthedocs.io
MIT License
20 stars 7 forks source link

[Question] Support for Kepler data #6

Closed martindevora closed 3 years ago

martindevora commented 3 years ago

Hello. I wanted to know about the complexity of adding support for Kepler and K2 data into Triceratops. Is the implementation very coupled to the TESS data and APIs or would it be more or less straightforward to support those old missions? What changes would need to be done, if possible?

Kind regards.

stevengiacalone commented 3 years ago

It's possible, but it will take a bit of work. The biggest changes would be to query the KIC/EPIC instead of the TIC when searching for nearby stars and pulling the Kepler TPFs instead of the TESS FFIs. These should be possible with astroquery.vizier and lightkurve. Ideally, we would use versions of the KIC/EPIC that are cross-matched with gaia, which makes things a little more complicated (there are cross-matched catalogs out there, but I'm not sure if there's a good way to query them without downloading the entire files). The stellar property estimates in the KIC/EPIC are also outdated (since they're pre-gaia), so we'd also need a way to update the Teff, Rs, and Ms in these catalogs.

This is on my list of things to do, but I won't have time to work on it until this summer, unfortunately.

martindevora commented 3 years ago

Hello. Maybe it can be implemented in two different stages: First just replacing tesscuts by targetpixelfiles and accepting Kepler old-catalogues. Once that is done and it works, an additional iteration could be done to use cross-matched catalogues.

If you think it is a good idea to split the develpment effort in these two stages and you won't have time enough to tackle this, I could offer my help for this development (at least for the first stage). You could give me some hints of the lines or methods to be changed and I will have a look at them.

Regards.

stevengiacalone commented 3 years ago

That sounds like a good idea! Thanks for offering to start the Kepler compatibility. I thought about it more and I think the easiest thing to do would be to continue using the TIC (which should contain all of the Kepler/K2 targets as well as the Gaia data) and assume that the values therein are representative of their KIC/EPIC counterparts (e.g., delta TESS mag = delta Kepler mag). That said, the only required changes would be in the init of the target class in triceratops.py. The changes would be as follows:

  1. Add an optional argument that specifies whether you would like to use "TESS", "Kepler", or "K2" (with "TESS" as the default value).
  2. If "Kepler" or "K2" are input, use astroquery.vizier to find the coordinates of the target based on its KIC/EPIC ID. Then use Catalogs.query_region to query the TIC for your targets.
  3. In the chunk of code where I convert RA/Dec to pixel coordinates, replace the TESS cutout with the Kepler TPF from lightkurve.

That should be the bare minimum needed to make triceratops Kepler/K2 compatible. I'd be happy to help debug any changes you'd like to push.

martindevora commented 3 years ago

Im already on it. I will let you know in case of doubts or will publish a merge request if everything goes smoothly.

Regards.

martindevora commented 3 years ago

Hi @stevengiacalone . I'm finding a problem: the Kepler TPFs are only 6x6 size. Specifying the cutout_size doesn't work because it is only supported by TESS. So far I'm stuck there. Any ideas about how to retrieve 22x22 Kepler TPFs?

martindevora commented 3 years ago

Related: https://github.com/lightkurve/lightkurve/issues/1074

martindevora commented 3 years ago

I think I've made it work. Despite, the function plot_field doesn't work yet and I don't know how much sense does it make to keep it as the TPFs are not containing field information. You can take a look at my fork. There you will find a notebook with an example. I hope you can try it and debug it carefully to watch that everything is going fine.

What should I do with the function plot_field for Kepler?

Kind Regards.

martindevora commented 3 years ago

Please keep me posted with the solution you come with for the plot field. Regards.

martindevora commented 3 years ago

Hi. Are you planning to release the changes that are already merged soon at some point? I'm still not seeing the Kepler parsing in the latest version. Regards.

stevengiacalone commented 3 years ago

Yes, I'll be uploading the next update in a few days.

stevengiacalone commented 3 years ago

The code should now be fully compatible with Kepler/K2. I updated the example file for your reference.