Sky Projection#
Various tools for projecting positions onto the sky.
- jorbit.astrometry.sky_projection.on_sky(x, v, time, observer_position, acc_func, acc_func_kwargs={}, ltt_position_fn=None, time_reference=0.0)[source]#
Compute the on-sky position of a particle from a given observer position.
This function computes the on-sky position of a particle at a given time, correcting for light travel time. By default it uses a 2nd-order Taylor expansion (position, velocity, acceleration) to propagate backward by the light travel time, where the acceleration is evaluated once at the observation time using
acc_func. Three iterations of the light travel time correction are applied, which is sufficient for most cases.For richer cases (e.g. a distant observer watching a close flyby, where higher-order terms in the polynomial expansion of position around the observation time matter), pass an explicit
ltt_position_fnclosure. When provided, this replaces both the on-the-fly acceleration evaluation and the constant-acceleration Taylor formula with a user-supplied propagator (typically built from IAS15 b-coefficients).Note: you can vmap this function, but don’t pass multiple particles at once: each one needs its own light travel time correction.
- Parameters:
x (
Array) – Position of the particle, shape (3,).v (
Array) – Velocity of the particle, shape (3,).time (
float) – Time at which to compute the on-sky position, expressed as therelative_timeoffset (in days) againsttime_reference. The acceleration is evaluated at the absolute JDtime + time_reference. Pass an absolute JD (TDB) here withtime_reference=0.0for standalone use.observer_position (
Array) – Position of the observer, shape (3,).acc_func (
Partial) – Acceleration function to use during light travel time correction. Must be a continuous function that can evaluate the positions of any fixed perturbers at arbitrary times. Ignored whenltt_position_fnis provided.acc_func_kwargs (
dict) – Additional arguments for the acceleration function.ltt_position_fn (
Partial|None) – Optional callable mapping a (negative) time offsetdtto the particle’s position attime + dt. When provided, this is used inside the LTT iteration in place of the constant-acceleration Taylor expansion, andacc_funcis not called. DefaultNonepreserves the original Taylor-based behavior.time_reference (
float) – Absolute JD (TDB) anchor thattimeis measured against. The acceleration is evaluated attime + time_reference. Defaults to0.0(i.e.timeis treated as an absolute JD). Ignored whenltt_position_fnis provided.
- Returns:
The right ascension and declination of the particle in radians, ICRS.
- Return type:
tuple[float,float]
- jorbit.astrometry.sky_projection.sky_sep(ra1, dec1, ra2, dec2)[source]#
Compute the angular separation between two points on the sky.
Following Astropy’s SkyCoord.separation, this uses the Vincenty formula.
- Parameters:
ra1 (
float) – Right ascension of the first position in radians.dec1 (
float) – Declination of the first position in radians.ra2 (
float) – Right ascension of the second position in radians.dec2 (
float) – Declination of the second position in radians.
- Returns:
The angular separation in arcseconds.
- Return type:
float
- jorbit.astrometry.sky_projection.tangent_plane_projection(ra_ref, dec_ref, ra, dec)[source]#
Project a point on the sky onto a tangent plane at a reference point.
Somewhat overkill, rotates the positions to the equator to avoid any potential issues near the poles.
- Parameters:
ra_ref (
float) – Right ascension of the reference point in radians.dec_ref (
float) – Declination of the reference point in radians.ra (
float) – Right ascension of the point to project in radians.dec (
float) – Declination of the point to project in radians.
- Returns:
The projected coordinates in arcseconds.
- Return type:
Array