Trajectory¤
Trajectory utilities for building source tracks in the center-of-mass frame, with optional annual parallax correction.
Classes¤
microlux.trajectory.TrajectoryParameters
¤
Bases: NamedTuple
A NamedTuple containing microlensing trajectory parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
t0 |
ndarray
|
Time of closest approach. |
u0 |
ndarray
|
Impact parameter at |
tE |
ndarray
|
Einstein timescale. |
rho |
ndarray
|
Source radius in units of Einstein radius. |
alpha_rad |
ndarray
|
Trajectory angle in radians. |
s |
ndarray
|
Projected lens separation in Einstein-radius units. |
q |
ndarray
|
Lens mass ratio. |
pi_E_N |
ndarray
|
North component of microlensing parallax vector. Only used when annual parallax is enabled. |
pi_E_E |
ndarray
|
East component of microlensing parallax vector. Only used when annual parallax is enabled. |
microlux.trajectory.TrajectoryModel
¤
Bases: NamedTuple
A NamedTuple representing a trajectory model with optional annual parallax.
Attributes:
| Name | Type | Description |
|---|---|---|
times |
ndarray
|
Observation times in Julian Date. |
delta_s |
ndarray | None
|
Annual parallax displacement projected on
the sky plane in (North, East), shape |
photo_center |
bool
|
Whether to convert trajectory from center-of-mass
coordinates to magnification-center coordinates for the |
calculate_trajectory(params: TrajectoryParameters | np.ndarray | jnp.ndarray) -> jnp.ndarray
¤
Calculate complex source trajectory at each epoch.
Parameters
params: One of:TrajectoryParameters- Length-9 array:
[t0, u0, tE, rho, alpha_rad, s, q, pi_E_N, pi_E_E] - Length-7 array:
[t0, u0, tE, rho, alpha_rad, s, q](parallax disabled)
Returns
trajectory: Complex trajectory array with shape(N,).
Functions¤
microlux.trajectory.get_trajectory_model(times: np.ndarray, coords: Coordinates, t0_par: float | None = None, photo_center: bool = False) -> TrajectoryModel
¤
Build a TrajectoryModel with optional annual parallax precomputation.
Parameters
times: Observation epochs in JD.coords: Source sky coordinates used for annual parallax projection.t0_par: Parallax reference epoch. IfNone, parallax is disabled.photo_center: Whether to apply photocenter correction fors > 1.
Returns
trajectory_model: Trajectory model instance.
Notes
- When
t0_parisNone, the model expects 7 trajectory parameters. - When
t0_paris set, annual parallax is enabled and the model expects 9 trajectory parameters.