xoa.core.interp.interp_transect

xoa.core.interp.interp_transect#

xoa.core.interp.interp_transect(data, j_base, i_base, frac_a, frac_b, it_base, frac_t, nx_src, ny_src, skipna, na_thres, method, time_method, bias, tension, periodic=False)[source]#

Trilinear interpolation at scattered (x, y, t) locations.

For each output point, the two bracketing source time steps are accessed and a spatial interpolation (bilinear or bicubic) is applied at each step, followed by linear time interpolation. No large intermediate array is built; the working memory per thread is O(K) scalars.

Parameters:
  • data ((nt_src, K, n_src) float64) – Source data; K = product of extra dims (e.g. depth levels collapsed), n_src = ny_src * nx_src (spatial grid flattened in C order).

  • j_base ((n_dst,) int64) – Row index of the SW corner; -1 marks an invalid (out-of-domain) point.

  • i_base ((n_dst,) int64) – Column index of the SW corner.

  • frac_a ((n_dst,) float64) – Fractional x position in [0, 1].

  • frac_b ((n_dst,) float64) – Fractional y position in [0, 1].

  • it_base ((n_dst,) int64) – Index of the lower bracketing source time step; -1 if out-of-range.

  • frac_t ((n_dst,) float64) – Fractional time position in [0, 1] toward it_base+1.

  • nx_src (int) – Number of source grid columns.

  • ny_src (int) – Number of source grid rows (used only for bicubic bounds checks).

  • skipna (bool) – When True, renormalise bilinear weights over valid (non-NaN) neighbours.

  • na_thres (float) – Minimum valid weight fraction; output is NaN when below this threshold.

  • method (int) – Spatial interpolation: 1=bilinear, 2=bicubic.

  • time_method (int) – Temporal interpolation: 1=linear.

  • bias (float) – Kochanek-Bartels bias for bicubic (0.0 = Catmull-Rom).

  • tension (float) – Kochanek-Bartels tension for bicubic (0.0 = standard).

  • periodic (bool) – Columns are wrapped around, like in a global grid.

Returns:

(K, n_dst) float64