High-level Expansion2D class API#

This page renders the full API of Expansion2D from its docstrings. See Expansion2D class overview for the conceptual tour and a quickstart, and Analytic parameter derivatives for the gradient math when the class is used in derivative mode.

class meepmeep.expansion2d.Expansion2D(tc: float, p: float, a: float, i: float, e: float, w: float, lan: float = 0.0, te: float = 0.0, derivatives: bool = False, parallel: bool = False)[source]#

Bases: object

High-level wrapper over the single-expansion-point 2D Taylor evaluators.

set_pars(*, tc: float, p: float, a: float, i: float, e: float, w: float, lan: float = 0.0)[source]#

Bind orbital elements and (re-)solve the single-expansion-point Taylor coefficients.

All parameters are keyword-only, so the call site always names the elements explicitly. The expansion-point time te is a construction-time constant and is reused on every call.

Parameters:
tcfloat

Time of inferior conjunction (transit centre) [days].

pfloat

Orbital period [days].

afloat

Scaled semi-major axis [R_star].

ifloat

Inclination [rad].

efloat

Eccentricity.

wfloat

Argument of periastron [rad].

lanfloat, optional

Longitude of the ascending node [rad]. A constant rotation of the sky-plane (x, y) coordinates about the line of sight. Defaults to 0.0. In derivative mode the gradient w.r.t. lan is the seventh orbital-parameter column.

Notes

After this call, self._coeffs holds the (2, 5) coefficient matrix (and self._dcoeffs the (7, 2, 5) derivative tensor when the instance is in derivative mode), and self._ep_time holds the absolute time of the expansion point (tc + te).

set_data(times)[source]#

Bind a time grid evaluated by the position / separation methods.

Parameters:
timesndarray, shape (N,)

Absolute observation times [days] at which position() and projected_separation() evaluate the orbit.

position()[source]#

Sky-plane (x, y) position at the times bound via set_data().

Returns:
tuple

(xs, ys) if the instance was created with derivatives=False; (xs, ys, dxs, dys) otherwise, where dxs and dys are shape (N, 7) arrays of partial derivatives with respect to (tc, p, a, i, e, w, lan). All positions are in units of the stellar radius.

projected_separation()[source]#

Sky-projected star-planet separation at the times bound via set_data().

The sky-projected separation between the centers of the star and planet, in units of the stellar radius.

Returns:
dndarray, shape (N,)

Projected separation per time, returned alone if derivatives=False.

ddndarray, shape (N, 7)

Only returned if derivatives=True: partial derivatives of d with respect to (tc, p, a, i, e, w, lan).

duration(k: float, kind: int = 14) float[source]#

Transit duration of the requested type [days].

Parameters:
kfloat

Planet-to-star radius ratio.

kindint, optional

Which duration to return: 14 (total, first-to-fourth contact; the default), 23 (full, second-to-third contact), 12 (ingress, first-to-second contact), or 34 (egress, third-to-fourth contact).

Returns:
float

The requested transit duration [days].

contact_point(k: float, point: int) float[source]#

Absolute time of a transit contact point [days].

Parameters:
kfloat

Planet-to-star radius ratio.

pointint

Contact point, one of 1, 2, 3, or 4.

Returns:
float

Absolute time of the requested contact point.

bounding_box(k: float)[source]#

Absolute first- and fourth-contact times bracketing the transit.

Parameters:
kfloat

Planet-to-star radius ratio.

Returns:
tuple

(T1, T4) absolute contact times [days].

min_separation(guess: float = 0.0)[source]#

Locate the minimum projected separation near the expansion point.

Parameters:
guessfloat, optional

Initial guess for the time of minimum separation, as an offset in days from the expansion point. Defaults to 0.0 (the expansion point itself).

Returns:
t_minfloat

Absolute time of minimum projected separation [days].

z_minfloat

Projected separation at the minimum, in units of the stellar radius.