jaxoplanet.orbits.keplerian
#
Module Contents#
Classes#
A central body in an orbital system |
|
Initialize an orbiting body (e.g. a planet) using orbital parameters |
|
A computational tool |
|
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.
- 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].
- class jaxoplanet.orbits.keplerian.OrbitalBody(central: Central, body: Body)[source]#
Bases:
equinox.Module
A computational tool
- 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 ofR_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 ofR_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 ofR_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
andinclination
parameters will be ignored and this amplitude will be used instead.
- Returns:
The components of the velocity vector at
t
in units ofR_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
andinclination
parameters will be ignored and this amplitude will be used instead.
- Returns:
The components of the velocity vector at
t
in units ofM_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
andinclination
parameters will be ignored and this amplitude will be used instead.
- Returns:
The components of the velocity vector at
t
in units ofM_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
andinclination
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 bodies: tuple[OrbitalBody, Ellipsis][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]#