grids.mixins.core.GridUtilsMixin.construct_domain_interpolator#
- GridUtilsMixin.construct_domain_interpolator(field: ndarray, field_axes: Sequence[str], method: str = 'linear', bounds_error: bool = False, fill_value: float | None = nan, **kwargs)[source]#
Construct an interpolator object over the entire grid domain on a particular subset of axes.
This method utilizes SciPy’s
RegularGridInterpolator
to leverage its C-level interpolation methods.- Parameters:
field (
np.ndarray
) – The data to interpolate, shaped according to field_axes.field_axes (
Sequence[str]
) – Logical axes spanned by the field (e.g., [“x”, “y”]).method (
{"linear", "nearest"}
, default"linear"
) – Interpolation method.bounds_error (
bool
, defaultFalse
) – Whether to raise an error when queried points fall outside the domain.fill_value (
float
orNone
, defaultnp.nan
) – Value used to fill in for out-of-bound points if bounds_error=False.**kwargs – Additional keyword arguments passed to the interpolator constructor.
- Returns:
interpolator – A callable that takes physical coordinates and returns interpolated values.
- Return type:
RegularGridInterpolator