meepmeep.numba3d.pos_c

Contents

meepmeep.numba3d.pos_c#

meepmeep.numba3d.pos_c(time: float | ndarray[tuple[Any, ...], dtype[_ScalarT]], c: ndarray[tuple[Any, ...], dtype[_ScalarT]]) tuple[float | ndarray[tuple[Any, ...], dtype[_ScalarT]], float | ndarray[tuple[Any, ...], dtype[_ScalarT]], float | ndarray[tuple[Any, ...], dtype[_ScalarT]]][source]#

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

This is the “centered” variant of pos: it assumes the caller has already subtracted the expansion time te (and any epoch offset) so that time is a small displacement around the expansion point. Each spatial coordinate is evaluated as a 5th-order polynomial using Horner’s scheme.

Accepts a scalar time or a 1-D array of times and dispatches to the appropriate kernel at compile time (inside @njit) or at call time (pure Python). The array path is an explicit loop over the scalar kernel, which avoids the full-array temporaries that NumPy broadcasting would allocate for every Horner step.

Parameters:
timefloat or NDArray

Time relative to the Taylor series expansion point, i.e. time = tc - (te + epoch*p). Must lie within the expansion point’s region of validity for the truncation error to remain small.

cNDArray

A (3, 5) coefficient matrix produced by solve3d. See pos for the row/column ordering convention.

Returns:
pxfloat or NDArray

Sky-plane x position in units of stellar radii.

pyfloat or NDArray

Sky-plane y position in units of stellar radii.

pzfloat or NDArray

Line-of-sight z position in units of stellar radii. Positive values point toward the observer.

Notes

This is the fastest 3D position evaluator in the module since it skips the epoch-folding arithmetic. Prefer it whenever the expansion point index and centered time are already known (e.g. inside multi-expansion-point dispatch loops in orbit3d).