Along-trajectory metrics for evaluating Lagrangian simulation quality.
Every metric here is a broadcasting function of two trajectories,
f(y, y_ref), whose last two axes are (time, 2) and whose leading axes
broadcast under standard NumPy/JAX rules. A metric therefore works
transparently on a single trajectory (T, 2), an ensemble (S, T, 2), or
any batched/broadcast pair — no ensemble flag required.
Because they satisfy the same broadcasting contract as the kernels in
pastax.score, these metrics double as energy-score kernels, e.g.
energy_score(forecast, obs, kernel=liu_index, reduce="last").
separation_distance¶
- pastax.metric.separation_distance(y, y_ref)
Point-wise great-circle distance between
yandy_ref.- Parameters
y(Float[jaxlib._jax.Array,'*batch time 2']) – Predicted trajectory/-ies, shape(..., T, 2).y_ref(Float[jaxlib._jax.Array,'*#batch time 2']) – Reference trajectory, shape(..., T, 2); broadcasts againsty.
- Returns
Distance at each time step in metres, shape
(..., T).- Return type
Float[jaxlib._jax.Array, ‘*batch time’]
normalized_separation_distance¶
- pastax.metric.normalized_separation_distance(y, y_ref)
Instantaneous separation normalised by cumulative reference arc length.
where is the separation distance at time and is the reference trajectory travel distance at time .
- Parameters
y(Float[jaxlib._jax.Array,'*batch time 2']) – Predicted trajectory/-ies, shape(..., T, 2).y_ref(Float[jaxlib._jax.Array,'*#batch time 2']) – Reference trajectory, shape(..., T, 2); broadcasts againsty.
- Returns
Dimensionless normalised separation, shape
(..., T).- Return type
Float[jaxlib._jax.Array, ‘*batch time’]
liu_index¶
- pastax.metric.liu_index(y, y_ref)
Liu & Weisberg (2011) normalised cumulative Lagrangian separation.
where is the separation distance at time and is the reference trajectory travel distance at time . The denominator is thus a double cumulative sum of the per-step distances.
Reference: Liu & Weisberg (2011), J. Geophys. Res.
- Parameters
y(Float[jaxlib._jax.Array,'*batch time 2']) – Predicted trajectory/-ies, shape(..., T, 2).y_ref(Float[jaxlib._jax.Array,'*#batch time 2']) – Reference trajectory, shape(..., T, 2); broadcasts againsty.
- Returns
Dimensionless Liu Index, shape
(..., T).- Return type
Float[jaxlib._jax.Array, ‘*batch time’]