JuliaAstro/Orbits.jl

Add ability to specify distances in angles alongside a system distance

mileslucas opened this issue · 0 comments

Frequently separations of, e.g., binary stars is given in angles, usually arcseconds or mas. We should add another part of the constructor parsing that allows passing distance as a keyword argument, which will automatically change any angular arguments for a. We could also check if R_planet or R_star are angles and adjust them, but that feels kind of weird- I think people are more likely to use stellar radii in those contexts.

MWE:
current required behavior

distance = inv(6.94e-3) * u"pc"

orbit = KeplerianOrbit(;
    period=52.98u"yr",
    tp=2020.20u"yr",
    ecc=0.074,
    Omega=202.4u"°",
    a=(0.169u"arcsecond" * distance) |> u"AU",
    incl=68.5u"°",
    omega=58.7u"°"
)

desired behavior

orbit = KeplerianOrbit(;
    period=52.98u"yr",
    tp=2020.20u"yr",
    ecc=0.074,
    Omega=202.4u"°",
    a=0.169u"arcsecond",
    distance,
    incl=68.5u"°",
    omega=58.7u"°"
)

in this case there will have to be some decisions made about defaults. First off, what should the unitless default for distance be? I think parsec is reasonable. Second off, how do we want to autoconvert from angles to distances. For instance, using AU makes sense for arcseconds and parsec, but maybe stellar radii is more appropriate for close planetary systems.