lshillman / generation-ship-calculator

A tool for calculating generation ship feasibility, given several user-defined factors.
https://lshillman.github.io/generation-ship-calculator/
0 stars 0 forks source link

As a developer, I need to retrieve a list of candidate exoplanets from NASA's exoplanet archive, so that I can make appropriate calculations. #11

Open lshillman opened 2 years ago

lshillman commented 2 years ago

Okay. I think I've got something usable here, though it's kinda janky. The params this API takes are literally SQL queries, and my SQL is iffy, and the documentation for these tables lives in about a zillion different locations. BUT:

https://exoplanetarchive.ipac.caltech.edu/TAP/sync?query=select+pl_name,pl_masse,sy_dist+from+ps+where+upper(soltype)+like+%27%CONF%%27+and+pl_masse+between+0.5+and+2.0&format=json

This gives us the planet names, masses, and distance from Earth, where the star is sun-like and the planet masses are between 0.5 and 2x Earth mass. Annoyingly, the Trappist system returns a null value for distance, but I'm just gonna fill that in manually. I'll keep trying to see if there's a way to further restrict the call to just planets in the Goldilocks Zone, but also I'm gonna call this good enough for now.