grids.mixins.chunking.GridChunkingMixin.construct_chunk_interpolator#

GridChunkingMixin.construct_chunk_interpolator(field: ndarray, field_axes: Sequence[str], chunks: ChunkIndexInput, method: str = 'linear', include_ghosts: bool = False, halo_offsets: HaloOffsetInput | None = None, bounds_error: bool = False, fill_value: float | None = nan, oob_behavior: str = 'raise', __validate__: bool = True, **kwargs) RegularGridInterpolator[source]#

Construct an interpolator for a specific chunk using SciPy’s RegularGridInterpolator.

Parameters:
  • field (np.ndarray) – Field data over the chunk, aligned with field_axes.

  • field_axes (Sequence[str]) – Axes spanned by the field (e.g., [“x”, “y”]).

  • chunks (ChunkIndexInput) – Chunk index (e.g., (1, 2) or [1, 2]) for the region over which to interpolate.

  • method ({"linear", "nearest"}, default "linear") – Interpolation method.

  • include_ghosts (bool, default False) – Whether to include ghost zones in the chunk coordinate extraction.

  • halo_offsets (int, sequence[int], or array, optional) – Extra padding around the chunk region.

  • bounds_error (bool, default False) – Whether to raise an error for out-of-bound queries.

  • fill_value (float or None, default np.nan) – Fill value for out-of-bound queries if bounds_error=False.

  • oob_behavior ({"raise", "clip"}, default "raise") – How to handle index overflow when applying halo or ghost zones.

  • __validate__ (bool, default True) – Whether to perform full input validation.

  • **kwargs – Extra options forwarded to RegularGridInterpolator.

Returns:

interpolator – A callable that performs interpolation over the selected chunk.

Return type:

RegularGridInterpolator