rodluger / starry

Tools for mapping stars and planets.
https://starry.readthedocs.io
MIT License
138 stars 32 forks source link

Allow users to define both the semi-major axis and the orbital period #306

Open taylorbell57 opened 1 year ago

taylorbell57 commented 1 year ago

Is your feature request related to a problem? Please describe. When fitting exoplanet time series observations, the observable features are the orbital period and the a/R*. It is frustrating when using starry to need to set only one of these values and have the other determined assuming a Keplerian orbit which necessitates that users provide the masses of the star and planet which are not relevant observable parameters. At this point I have had to resort to solving for the planet's mass assuming a stellar mass and the fitted orbital period and semi-major axis in order to actually fit for these two parameters I care about: an annoying and wasteful step to have to manually add. It also isn't immediately clear whether it is the semi-major axis or the orbital period that gets overwritten by starry, and there are no warnings messages telling the user that one of the input values is going to be ignored if both values are provided when initializing the Secondary object.

Describe the solution you'd like It would seem easy to me to allow users to specify both the orbital period and semi-major axis, and at no point calculate or make use of the planet's mass if both values are provided. I do understand that there may be users that would want starry to just calculate the Keplerian orbital period for a fitted mass. My suggested solution would be to require any 2 of the following: semi-major axis, orbital period, object masses. If any one of those three is missing, it can be calculated using the others, and to my knowledge there's no point in calculating a missing mass if it wasn't provided.

dfm commented 1 year ago

Agreed that this is a good interface to provide. One point I would add here is that while this is straightforward for a single transiting body, you can end up with an inconsistent set of orbits for multi-planet systems since each planet will have a different implied stellar density. This might be fine in many cases, but (in my experience) it's non-trivial to design a good and consistent interface for this while still supporting multi-planet systems consistently.