Low-level Taylor backend API#

The reference catalogue for the low-level Taylor-backend routines. Use this page when you have dropped below the Orbit class and need to know the exact function names, signatures, and per-function semantics. See Taylor-series backend overview for the conceptual model that ties these routines together and Function naming conventions for the suffix grammar that explains how the names are constructed.

Every function listed here is numba.njit()-compiled and operates on NumPy arrays. Per-function detail (parameters, shapes, units, mathematical notes) lives in the source docstrings and is rendered below via autosummary.

Coefficient solvers#

These functions take Keplerian orbital elements and return Taylor coefficient matrices that the position and velocity evaluators consume. Variants suffixed with _d additionally return the (7, D, 5) parameter-derivative tensor.

solve2d(te, p, a, i, e, w[, lan])

Calculate the Taylor expansion for the (x, y) position around a given expansion-point time relative to the transit centre.

solve2d_d(te, p, a, i, e, w[, lan])

Calculate Taylor expansion coefficients and their parameter derivatives around a given expansion-point time relative to the transit centre.

solve3d(te, p, a, i, e, w[, lan])

Calculate the Taylor expansion for the (x, y, z) position around a given expansion-point time relative to the transit centre.

solve3d_d(te, p, a, i, e, w[, lan])

Calculate Taylor expansion coefficients and their parameter derivatives for the 3D position around a given expansion-point time relative to the transit centre.

Two-dimensional position and distance#

Single-expansion-point evaluators for the sky-plane \((x, y)\) position and the projected planet-star distance \(d = \sqrt{x^2 + y^2}\). Each function operates on one (2, 5) coefficient matrix from solve2d() and is sufficient for transit light-curve modelling. The whole-orbit dispatchers that batch these calls across a expansion-point grid live in Whole-orbit dispatchers (multi-expansion-point).

pos(time, tc, p, c[, te])

Evaluate the planet's sky-plane (x, y) position at an absolute time using a 2D Taylor expansion.

pos_c(time, c)

Evaluate the planet's sky-plane (x, y) position at an expansion-point-centered time.

sep(time, tc, p, c[, te])

Evaluate the projected planet-star separation at an absolute time.

sep_c(time, c)

Evaluate the sky-projected planet-star separation in the units of stellar radii at an expansion-point-centered time.

Parameter-derivative variants:

pos_d(time, tc, p, c, dc[, te])

Evaluate the (x, y) position and its orbital-parameter derivatives at an absolute time.

pos_cd(time, c, dc)

Evaluate the (x, y) position and its orbital-parameter derivatives at an expansion-point-centered time.

sep_d(time, tc, p, c, dc[, te])

Evaluate the projected planet-star distance and its parameter derivatives at an absolute time.

sep_cd(time, c, dc)

Evaluate the projected planet-star separation and its parameter derivatives at an expansion-point-centered time.

Three-dimensional position and distance#

Single-expansion-point evaluators that additionally return the line-of-sight coordinate \(z\). Each function operates on one (3, 5) coefficient matrix from solve3d(). Needed for eclipses, light travel time, phase curves, and radial velocities. The whole-orbit dispatchers that batch these calls across a expansion-point grid live in Whole-orbit dispatchers (multi-expansion-point).

pos(time, tc, p, c[, te])

Evaluate the planet's (x, y, z) position at an absolute time using a 3D Taylor expansion.

pos_c(time, c)

Evaluate the planet's (x, y, z) position at an expansion-point-centered time.

sep(time, tc, p, c[, te])

Evaluate the sky-projected planet-star separation at an absolute time.

sep_c(time, c)

Evaluate the sky-projected planet-star separation in units of stellar radii at an expansion-point-centered time.

zpos(time, tc, p, c[, te])

Evaluate the planet's line-of-sight z position at an absolute time.

zpos_c(time, c)

Evaluate the planet's line-of-sight z position at an expansion-point-centered time.

Parameter-derivative variants:

pos_d(time, tc, p, c, dc[, te])

Evaluate the (x, y, z) position and its orbital-parameter derivatives at an absolute time.

pos_cd(time, c, dc)

Evaluate the (x, y, z) position and its orbital-parameter derivatives at an expansion-point-centered time.

sep_d(time, tc, p, c, dc[, te])

Evaluate the sky-projected planet-star separation and its parameter derivatives at an absolute time.

sep_cd(time, c, dc)

Evaluate the sky-projected planet-star separation and its parameter derivatives at an expansion-point-centered time.

zpos_d(time, tc, p, c, dc[, te])

Evaluate the line-of-sight z position and its parameter derivatives at an absolute time.

zpos_cd(time, c, dc)

Evaluate the line-of-sight z position and its parameter derivatives at an expansion-point-centered time.

Velocities#

Velocity-vector and line-of-sight velocity evaluators built on the same coefficient matrices used by the position evaluators.

vel_c(time, c)

Evaluate the planet's (vx, vy, vz) velocity at an expansion-point-centered time.

zvel_c(time, c)

Evaluate the planet's line-of-sight velocity component at an expansion-point-centered time.

zvel(time, tc, p, c[, te])

Evaluate the planet's line-of-sight velocity component at an absolute time.

rv_c(time, k, p, a, i, e, c)

Evaluate the stellar radial velocity induced by the planet at an expansion-point-centered time.

rv(time, k, tc, p, a, i, e, c[, te])

Evaluate the stellar radial velocity induced by the planet at an absolute time.

Parameter-derivative variants:

vel_cd(time, c, dc)

Evaluate the (vx, vy, vz) velocity and its orbital-parameter derivatives at an expansion-point-centered time.

zvel_cd(time, c, dc)

Evaluate the line-of-sight velocity and its parameter derivatives at an expansion-point-centered time.

zvel_d(time, tc, p, c, dc[, te])

Evaluate the line-of-sight velocity and its parameter derivatives at an absolute time.

rv_cd(time, k, p, a, i, e, c, dc)

Evaluate the stellar radial velocity and its parameter derivatives at an expansion-point-centered time.

rv_d(time, k, tc, p, a, i, e, c, dc[, te])

Evaluate the stellar radial velocity and its parameter derivatives at an absolute time.

Phase angle, reflected light, ellipsoidal variation, and emission#

Single-expansion-point cosine-of-phase-angle, Lambertian reflected-light phase-curve, ellipsoidal-variation, and cosine thermal-emission evaluators, built on the same (3, 5) coefficient matrices. The Lambert evaluators form the flux \((k/r)^2 A_g\, f(\alpha)\) from the phase-angle cosine, using the instantaneous star-planet distance \(r = \sqrt{x^2+y^2+z^2}\) for the inverse-square illumination (exact for eccentric orbits); the ellipsoidal-variation signal scales as \(1/r^3\); the emission model is \(k^2 f_\mathrm{ratio}\,(1 + \cos\delta\,c_z + \sin\delta\,s)/2\) with a signed in-plane component \(s\) (from the orbital normal) and a hotspot offset \(\delta\). The whole-orbit dispatchers in Whole-orbit dispatchers (multi-expansion-point) delegate to these.

cos_alpha_c(time, c)

Evaluate the cosine of the orbital phase angle at an expansion-point-centered time.

cos_alpha(time, tc, p, c[, te])

Evaluate the cosine of the orbital phase angle at an absolute time.

lambert_phase_curve_c(time, ag, k, c)

Evaluate the Lambertian phase-curve flux contribution at an expansion-point-centered time.

lambert_phase_curve(time, ag, k, tc, p, c[, te])

Evaluate the Lambertian phase-curve flux contribution at an absolute time.

ev_signal_c(time, alpha, mass_ratio, inc, c)

Evaluate the ellipsoidal-variation signal at an expansion-point-centered time.

ev_signal(time, alpha, mass_ratio, inc, tc, p, c)

Evaluate the ellipsoidal-variation signal at an absolute time.

emission_phase_curve_c(time, k, fratio, ...)

Evaluate the cosine emission phase-curve flux at an expansion-point-centered time.

emission_phase_curve(time, k, fratio, ...[, te])

Evaluate the cosine emission phase-curve flux at an absolute time.

Parameter-derivative variants:

cos_alpha_cd(time, c, dc)

Evaluate the cosine of the orbital phase angle and its parameter derivatives at an expansion-point-centered time.

cos_alpha_d(time, tc, p, c, dc[, te])

Evaluate the cosine of the orbital phase angle and its parameter derivatives at an absolute time.

lambert_phase_curve_cd(time, ag, k, c, dc)

Evaluate the Lambertian phase-curve flux and its parameter derivatives at an expansion-point-centered time.

lambert_phase_curve_d(time, ag, k, tc, p, c, dc)

Evaluate the Lambertian phase-curve flux and its parameter derivatives at an absolute time.

ev_signal_cd(time, alpha, mass_ratio, inc, c, dc)

Evaluate the ellipsoidal-variation signal and its parameter derivatives at an expansion-point-centered time.

ev_signal_d(time, alpha, mass_ratio, inc, ...)

Evaluate the ellipsoidal-variation signal and its parameter derivatives at an absolute time.

emission_phase_curve_cd(time, k, fratio, ...)

Evaluate the cosine emission phase-curve flux and its parameter derivatives at an expansion-point-centered time.

emission_phase_curve_d(time, k, fratio, ...)

Evaluate the cosine emission phase-curve flux and its parameter derivatives at an absolute time.

Geometric utilities#

Contact points, durations, and bounding boxes derived analytically from a coefficient matrix.

find_contact_point(k, point, c)

Find the contact point time for a planet.

find_z_min(tc, c)

Locate the local minimum of the projected planet-star distance.

bounding_box(k, coeffs)

Calculate the bounding box for a transit.

t1(k, c)

First contact time.

t4(k, c)

Fourth contact time.

t12(k, c)

Ingress duration T12 (first to second contact).

t14(k, c)

Total transit duration T14 (first to fourth contact).

t23(k, c)

Full-transit duration T23 (second to third contact).

t34(k, c)

Egress duration T34 (third to fourth contact).

The 3D module meepmeep.numba3d also exposes the same set of helpers operating on (3, 5) coefficient matrices.

Whole-orbit dispatchers (multi-expansion-point)#

Whole-orbit evaluators that use a precomputed time-to-expansion-point table (ep_table) to dispatch each input time to the appropriate expansion point and delegate to the centered single-expansion-point evaluators above. Each name is a single overloaded dispatcher that accepts either a scalar time or a 1-D float64 array of times; the _o suffix denotes the forward dispatcher and _od its gradient-returning counterpart.

Orbit setup:

solve3d_orbit(ep_times, p, a, i, e, w[, ...])

Pre-compute Taylor coefficients at every expansion point of one orbit.

ep_ix(t, tpa, p, dt, ep_table)

Return the expansion-point index for a single time.

Positions and distances:

pos_o(t, tpa, p, dt, ep_table, ep_times, coeffs)

Planet (x, y, z) position for any orbital phase.

zpos_o(t, tpa, p, dt, ep_table, ep_times, coeffs)

Planet z-position (line-of-sight coordinate) for any orbital phase.

sep_o(t, tpa, p, dt, ep_table, ep_times, coeffs)

Sky-projected planet-star separation for any orbital phase.

star_planet_distance_o(t, tpa, p, dt, ...)

3D star-planet distance at an array of times.

Velocities and radial velocity:

vel_o(t, tpa, p, dt, ep_table, ep_times, coeffs)

Planet (vx, vy, vz) velocity for any orbital phase.

zvel_o(t, tpa, p, dt, ep_table, ep_times, coeffs)

Planet z-velocity (line-of-sight component) for any orbital phase.

rv_o(t, k, tpa, p, a, i, e, dt, ep_table, ...)

Radial velocity at an array of times (Perryman 2018, Eq.

Phase angles, Lambert curves, ellipsoidal variation, and emission:

true_anomaly_o(t, tpa, p, ex, ey, ez, w, dt, ...)

True anomaly at an array of times.

cos_alpha_o(t, tpa, p, dt, ep_table, ...)

Cosine of the phase angle for any orbital phase.

cos_v_p_angle_o(v, t, tpa, p, dt, ep_table, ...)

Cosine of the angle between the planet position and a fixed reference vector.

lambert_phase_curve_o(t, ag, k, tpa, p, dt, ...)

Lambertian phase-curve flux contribution.

ev_signal_o(alpha, mass_ratio, inc, t, tpa, ...)

Ellipsoidal variation signal (Lillo-Box et al. 2014, Eqs.

emission_phase_curve_o(t, k, fratio, offset, ...)

Cosine emission phase-curve flux contribution.

Light travel time:

light_travel_time_o(t, tpa, p, e, w, rstar, ...)

Light travel time correction, referenced to primary transit.

Whole-orbit dispatchers with parameter derivatives#

Gradient-returning counterparts of the orbit dispatchers above. Every function accepts an additional dcoeffs tensor of shape (N, 7, D, 5) (expansion point, parameter, dimension, Taylor order) produced by solve3d_orbit_d().

solve3d_orbit_d(ep_times, p, a, i, e, w[, ...])

Pre-compute Taylor and derivative coefficients at every expansion point of one orbit.

pos_od(t, tpa, p, dt, ep_table, ep_times, ...)

Planet (x, y, z) position and orbital-parameter derivatives for any orbital phase.

zpos_od(t, tpa, p, dt, ep_table, ep_times, ...)

Planet z-position and orbital-parameter derivatives for any orbital phase.

sep_od(t, tpa, p, dt, ep_table, ep_times, ...)

Sky-projected planet-star separation and orbital-parameter derivatives for any orbital phase.

vel_od(t, tpa, p, dt, ep_table, ep_times, ...)

Planet (vx, vy, vz) velocity and orbital-parameter derivatives for any orbital phase.

zvel_od(t, tpa, p, dt, ep_table, ep_times, ...)

Planet z-velocity and orbital-parameter derivatives for any orbital phase.

cos_alpha_od(t, tpa, p, dt, ep_table, ...)

Cosine of the phase angle and orbital-parameter derivatives for any orbital phase.

cos_v_p_angle_od(v, t, tpa, p, dt, ep_table, ...)

Cosine of the angle between planet position and a fixed reference vector v, with gradients.

true_anomaly_od(t, tpa, p, ex, ey, ez, w, ...)

True anomaly and its orbital-parameter derivatives.

star_planet_distance_od(t, tpa, p, dt, ...)

3D star-planet distance and orbital-parameter derivatives.

lambert_phase_curve_od(t, ag, k, tpa, p, dt, ...)

Lambertian phase-curve flux with gradients.

ev_signal_od(alpha, mass_ratio, inc, t, tpa, ...)

Ellipsoidal variation signal with gradients.

emission_phase_curve_od(t, k, fratio, ...)

Cosine emission phase-curve flux with gradients.

rv_od(t, k, tpa, p, a, i, e, dt, ep_table, ...)

Radial velocity and parameter derivatives.

light_travel_time_od(t, tpa, p, e, w, rstar, ...)

Light travel time correction with gradients.

Expansion point grid construction#

The expansion-point grid and the time-to-expansion-point table consumed by the multi-expansion-point dispatchers are built once per orbit by create_expansion_points().

create_expansion_points(n_ep, e[, quantity, ...])

Place expansion points along one orbital period and build the time-to-expansion-point table.

The two anomaly helpers below are not part of the aggregator surface but remain available at their source path.