JuliaAstro/Orbits.jl

Joining forces with PlanetOrbits.jl

sefffal opened this issue · 1 comments

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 JuliaAstro/Transits.jl#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:

  • pluggable Kepler solvers
  • hierarchy of orbit types for different parameterizations, e.g. keplerian orbit, keplerian orbit with distance, Thiele-Innes elements, r.v. orbits
  • flexible plots recipes for most quantities
  • plot orbits over images of a system
  • A nice interface for incrementalling solving an orbit, then calculating quantities of interest:
sol = orbitsolve(orbit, mjd("2020-01-01"))
rv = radvel(sol)
x = raoff(sol)

# 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. 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. 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!

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