jaxoplanet.orbits.keplerian

Contents

jaxoplanet.orbits.keplerian#

Module Contents#

Classes#

Central

A central body in an orbital system

Body

Initialize an orbiting body (e.g. a planet) using orbital parameters

OrbitalBody

A computational tool

System

A Keplerian orbital system

class jaxoplanet.orbits.keplerian.Central(*, mass: jaxoplanet.types.Quantity | None = None, radius: jaxoplanet.types.Quantity | None = None, density: jaxoplanet.types.Quantity | None = None)[source]#

Bases: equinox.Module

A central body in an orbital system

Parameters:
  • mass (Optional[Quantity]) – Mass of central body [mass unit].

  • radius (Optional[Quantity]) – Radius of central body [length unit].

  • density (Optional[Quantity]) – Density of central body [mass/length**3 unit].

  • map (Optional[Map]) – Map of the central body. If None a uniform map with intensity 1 is used.

property shape: tuple[int, Ellipsis][source]#
mass: jaxoplanet.types.Quantity[source]#
radius: jaxoplanet.types.Quantity[source]#
density: jaxoplanet.types.Quantity[source]#
classmethod from_orbital_properties(*, period: jaxoplanet.types.Quantity, semimajor: jaxoplanet.types.Quantity, radius: jaxoplanet.types.Quantity | None = None, body_mass: jaxoplanet.types.Quantity | None = None) Central[source]#

Initialize the central body (e.g. a star) of an orbital system using orbital parameters to derive radius and mass.

Parameters:
  • period – The orbital period of the orbiting body [time unit].

  • semimajor – The semi-major axis of the orbiting body [length unit].

  • radius (Optional[Quantity]) – Radius of central body [length unit].

  • body_mass (Optional[Quantity]) – Mass of orbiting body [mass unit].

Returns:

Central object

class jaxoplanet.orbits.keplerian.Body[source]#

Bases: equinox.Module

Initialize an orbiting body (e.g. a planet) using orbital parameters

See https://docs.exoplanet.codes/en/latest/tutorials/data-and-models/ for a description of the orbital geometry.

Parameters:
  • central (Optional[Central]) – The Central object that this Body orbits [Central].

  • time_transit (Optional[Quantity]) – The epoch of a reference transit [time unit].

  • time_peri (Optional[Quantity]) – The epoch of a reference periastron passage [time unit].

  • period (Optional[Quantity]) – Orbital period [time unit].

  • semimajor (Optional[Quantity]) – Semi-major axis in [length unit].

  • inclination (Optional[Quantity]) – Inclination of orbital plane in [angular unit].

  • impact_param (Optional) – Impact parameter.

  • eccentricity (Optional) – Eccentricity, must be 0 <= eccentricity < 1 where 0 = circular orbit.

  • omega_peri (Optional[Quantity]) – Argument of periastron [angular unit].

  • sin_omega_peri (Optional) – sin(argument of periastron).

  • cos_omega_peri (Optional) – cos(argument of periastron).

  • asc_node (Optional[Quantity]) – Longitude of ascending node [angular unit].

  • sin_asc_node (Optional) – sin(longitude of ascending node).

  • cos_asc_node (Optional) – cos(longitude of ascending node).

  • mass (Optional[Quantity]) – Mass of orbiting body [mass unit].

  • radius (Optional[Quantity]) – Radius of orbiting body [length unit].

  • central_radius (Optional[Quantity]) – Radius of central body [length unit].

  • radial_velocity_semiamplitude (Optional[Quantity]) – The radial velocity semi-amplitude [length/time unit].

  • parallax (Optional[Quantity]) – Parallax (to convert position/velocity into arcsec). [length unit].

time_transit: jaxoplanet.types.Quantity | None[source]#
time_peri: jaxoplanet.types.Quantity | None[source]#
period: jaxoplanet.types.Quantity | None[source]#
semimajor: jaxoplanet.types.Quantity | None[source]#
inclination: jaxoplanet.types.Quantity | None[source]#
impact_param: jaxoplanet.types.Quantity | None[source]#
eccentricity: jaxoplanet.types.Quantity | None[source]#
omega_peri: jaxoplanet.types.Quantity | None[source]#
sin_omega_peri: jaxoplanet.types.Quantity | None[source]#
cos_omega_peri: jaxoplanet.types.Quantity | None[source]#
asc_node: jaxoplanet.types.Quantity | None[source]#
sin_asc_node: jaxoplanet.types.Quantity | None[source]#
cos_asc_node: jaxoplanet.types.Quantity | None[source]#
mass: jaxoplanet.types.Quantity | None[source]#
radius: jaxoplanet.types.Quantity | None[source]#
radial_velocity_semiamplitude: jaxoplanet.types.Quantity | None[source]#
parallax: jaxoplanet.types.Quantity | None[source]#
__check_init__() None[source]#
class jaxoplanet.orbits.keplerian.OrbitalBody(central: Central, body: Body)[source]#

Bases: equinox.Module

A computational tool

property shape: tuple[int, Ellipsis][source]#
property central_radius: jaxoplanet.types.Quantity[source]#
property time_peri: jaxoplanet.types.Quantity[source]#
property inclination: jaxoplanet.types.Quantity[source]#
property omega_peri: jaxoplanet.types.Quantity | None[source]#
property total_mass: jaxoplanet.types.Quantity[source]#
central: Central[source]#
time_ref: jaxoplanet.types.Quantity[source]#
time_transit: jaxoplanet.types.Quantity[source]#
period: jaxoplanet.types.Quantity[source]#
semimajor: jaxoplanet.types.Quantity[source]#
sin_inclination: jaxoplanet.types.Quantity[source]#
cos_inclination: jaxoplanet.types.Quantity[source]#
impact_param: jaxoplanet.types.Quantity[source]#
mass: jaxoplanet.types.Quantity | None[source]#
radius: jaxoplanet.types.Quantity | None[source]#
eccentricity: jaxoplanet.types.Quantity | None[source]#
sin_omega_peri: jaxoplanet.types.Quantity | None[source]#
cos_omega_peri: jaxoplanet.types.Quantity | None[source]#
sin_asc_node: jaxoplanet.types.Quantity | None[source]#
cos_asc_node: jaxoplanet.types.Quantity | None[source]#
radial_velocity_semiamplitude: jaxoplanet.types.Quantity | None[source]#
parallax: jaxoplanet.types.Quantity | None[source]#
position(t: jaxoplanet.types.Quantity, parallax: jaxoplanet.types.Quantity | None = None) tuple[jaxoplanet.types.Quantity, jaxoplanet.types.Quantity, jaxoplanet.types.Quantity][source]#

This body’s position in the barycentric frame

Parameters:

t – The times where the position should be evaluated.

Returns:

The components of the position vector at t in units of R_sun.

central_position(t: jaxoplanet.types.Quantity, parallax: jaxoplanet.types.Quantity | None = None) tuple[jaxoplanet.types.Quantity, jaxoplanet.types.Quantity, jaxoplanet.types.Quantity][source]#

The central’s position in the barycentric frame

Parameters:

t – The times where the position should be evaluated.

Returns:

The components of the position vector at t in units of R_sun.

relative_position(t: jaxoplanet.types.Quantity, parallax: jaxoplanet.types.Quantity | None = None) tuple[jaxoplanet.types.Quantity, jaxoplanet.types.Quantity, jaxoplanet.types.Quantity][source]#

This body’s position relative to the central in the X,Y,Z frame

Parameters:

t – The times where the position should be evaluated.

Returns:

The components of the position vector at t in units of R_sun.

relative_angles(t: jaxoplanet.types.Quantity, parallax: jaxoplanet.types.Quantity | None = None) tuple[jaxoplanet.types.Quantity, jaxoplanet.types.Quantity][source]#

This body’s relative position to the central in the sky plane, in separation, position angle coordinates

Parameters:

t – The times where the angles should be evaluated.

Returns:

The separation (arcseconds) and position angle (radians, measured east of north) of the planet relative to the star.

velocity(t: jaxoplanet.types.Quantity, semiamplitude: jaxoplanet.types.Quantity | None = None) tuple[jaxoplanet.types.Quantity, jaxoplanet.types.Quantity, jaxoplanet.types.Quantity][source]#

This body’s velocity in the barycentric frame

Parameters:
  • t – The times where the velocity should be evaluated.

  • semiamplitude – The semi-amplitude of the orbit. By convention, this is half of the peak-to-peak amplitude of the central’s velocity. If provided, the mass and inclination parameters will be ignored and this amplitude will be used instead.

Returns:

The components of the velocity vector at t in units of R_sun/day.

central_velocity(t: jaxoplanet.types.Quantity, semiamplitude: jaxoplanet.types.Quantity | None = None) tuple[jaxoplanet.types.Quantity, jaxoplanet.types.Quantity, jaxoplanet.types.Quantity][source]#

The central’s velocity in the barycentric frame

Parameters:
  • t – The times where the velocity should be evaluated.

  • semiamplitude – The semi-amplitude of the orbit. By convention, this is half of the peak-to-peak amplitude of the central’s velocity. If provided, the mass and inclination parameters will be ignored and this amplitude will be used instead.

Returns:

The components of the velocity vector at t in units of M_sun/day.

relative_velocity(t: jaxoplanet.types.Quantity, semiamplitude: jaxoplanet.types.Quantity | None = None) tuple[jaxoplanet.types.Quantity, jaxoplanet.types.Quantity, jaxoplanet.types.Quantity][source]#

This body’s velocity relative to the central

Parameters:
  • t – The times where the velocity should be evaluated.

  • semiamplitude – The semi-amplitude of the orbit. By convention, this is half of the peak-to-peak amplitude of the central’s velocity. If provided, the mass and inclination parameters will be ignored and this amplitude will be used instead.

Returns:

The components of the velocity vector at t in units of M_sun/day.

radial_velocity(t: jaxoplanet.types.Quantity, semiamplitude: jaxoplanet.types.Quantity | None = None) jaxoplanet.types.Quantity[source]#

Get the radial velocity of the central

Note

The convention is that positive z points towards the observer. However, for consistency with radial velocity literature this method returns values where positive radial velocity corresponds to a redshift as expected.

Parameters:
  • t – The times where the radial velocity should be evaluated.

  • semiamplitude – The semi-amplitude of the orbit. If provided, the mass and inclination parameters will be ignored and this amplitude will be used instead.

Returns:

The reflex radial velocity evaluated at t.

class jaxoplanet.orbits.keplerian.System(central: Central | None = None, *, bodies: collections.abc.Iterable[Body | OrbitalBody] = ())[source]#

Bases: equinox.Module

A Keplerian orbital system

property shape: tuple[int, Ellipsis][source]#
property bodies: tuple[OrbitalBody, Ellipsis][source]#
property radius: jaxoplanet.types.Quantity[source]#
property central_radius: jaxoplanet.types.Quantity[source]#
central: Central[source]#
__repr__() str[source]#

Return repr(self).

add_body(body: Body | None = None, central: Central | None = None, **kwargs: Any) System[source]#
body_vmap(func: Callable, in_axes: int | None | collections.abc.Sequence[Any] = 0, out_axes: Any = 0) Callable[source]#

Map a function over the bodies of this system

If possible, this method will apply the appropriate jax.vmap to the input function, but if the Pytree structure of the bodies don’t match, this requires a loop over bodies, applying the function separately to each body, and stacking the results.

Parameters:
  • func – The function to map. It’s first positional argument must accept a Keplerian Body object.

  • in_axes – The input axis specifications for all arguments after the first. The semantics should match jax.vmap.

  • out_axes – The output axis specifications, matching jax.vmap.

Returns:

The vectorized version of func mapped over bodies in this system.

For example, if (for some reason) we wanted to compute the $x$ positions of all the bodies in a system at a particular time, in units of the body radius, we could use the following:

>>> from jaxoplanet.orbits.keplerian import Central, System
>>> sys = System(Central())
>>> sys = sys.add_body(period=1.0, radius=0.1)
>>> sys = sys.add_body(period=2.0, radius=0.2)
>>> pos = sys.body_vmap(
...     lambda body, t: body.position(t)[0] / body.radius,
...     in_axes=None,
... )
>>> pos(0.2)
<Quantity([40.0231   19.632687], 'dimensionless')>
position(t: jaxoplanet.types.Quantity) tuple[jaxoplanet.types.Quantity, jaxoplanet.types.Quantity, jaxoplanet.types.Quantity][source]#
central_position(t: jaxoplanet.types.Quantity) tuple[jaxoplanet.types.Quantity, jaxoplanet.types.Quantity, jaxoplanet.types.Quantity][source]#
relative_position(t: jaxoplanet.types.Quantity) tuple[jaxoplanet.types.Quantity, jaxoplanet.types.Quantity, jaxoplanet.types.Quantity][source]#
velocity(t: jaxoplanet.types.Quantity) tuple[jaxoplanet.types.Quantity, jaxoplanet.types.Quantity, jaxoplanet.types.Quantity][source]#
central_velocity(t: jaxoplanet.types.Quantity) tuple[jaxoplanet.types.Quantity, jaxoplanet.types.Quantity, jaxoplanet.types.Quantity][source]#
relative_velocity(t: jaxoplanet.types.Quantity) tuple[jaxoplanet.types.Quantity, jaxoplanet.types.Quantity, jaxoplanet.types.Quantity][source]#
radial_velocity(t: jaxoplanet.types.Quantity) jaxoplanet.types.Quantity[source]#