JuliaAstro / Orbits.jl

Flexible and fast astronomical orbits
MIT License
11 stars 2 forks source link

Joining forces with PlanetOrbits.jl #5

Open sefffal opened 1 year ago

sefffal commented 1 year ago

Hi folks, I can't help but notice there is a lot of overlap between PlanetOrbits.jl and Orbits.jl. Thoughts on merging these two packages? Edit: see previous discussion here https://github.com/JuliaAstro/Transits.jl/discussions/31

You can check out the docs for PlanetOrbits.jl here: https://sefffal.github.io/PlanetOrbits.jl/dev/

A few nice features I've implemented:

or convenience methods:

rv = radvel(orbit, mjd("2020-01-01"))



Features from Orbits.jl that are missing in PlanetOrbits.jl:
* support for units, instead of hardcoding a default set of unit conversions.
* some quantities like impact parameter, 
* orbit parameterizations better suited to transit and RV fitting

Features I'd love to have some day:
* sub-package for N body physics using [NBodySimulator.jl](https://github.com/SciML/NBodySimulator.jl). That is, taking a set of orbit structs and propagating them for N years with full interactions between them.
* better type hierarchy for multiple bodies, even when just doing 2 body physics with Keplers laws. E.g. something like `primary.mass` and `secondary.mass` etc.

This would also be a great route for getting solid transit fitting into [DirectDetections.jl](https://sefffal.github.io/DirectDetections.jl/dev/). I've done some experiments with Transits.jl and joint RV-transit fits. It sort of works, but still feels a bit hacky when mixing Transits.jl with PlanetOrbits.jl.

Challenges:
I think the biggest impediment would probably be agreeing to conventions, e.g. does argument of periapsis refer to the primary (as in RV, transit communities) or secondary (imaging, proper motion communities). This might be solved having an explicit separation between a primary and secondary as different types.

Anyways, let me know what you think! 
BrettKnoss commented 1 year ago

Is it possible to calucate an orbit knowing the mass and rho of both the star and planet?