kinextract.precompute_losvd_interp

kinextract.precompute_losvd_interp(st: FitState) None[source]

Precompute linear-interpolation indices/weights from xl onto vgrid0.

The LOSVD is recovered as an nl-bin histogram on the coarse velocity grid st.xl, but the template-LOSVD convolution is evaluated on the finer internal grid st.vgrid0. This function precomputes, once per fit, the bracketing bin indices (losvd_j0, losvd_j1) and linear interpolation weight (losvd_w) needed to resample any trial LOSVD histogram b from xl onto vgrid0 cheaply inside the optimizer’s inner loop (see getnlosvd_fast_from_b), avoiding a fresh searchsorted call on every objective-function evaluation.

Parameters:

st (FitState) – Fit state to update in place. Requires st.xl and st.vgrid0 to already be set. Populates st.losvd_j0, st.losvd_j1, and st.losvd_w.

Returns:

Results are stored directly on st.

Return type:

None