Skip to main content

Module interpolation

Module interpolation 

Source
Expand description

Sampling fields at arbitrary points and resampling them onto other domains.

Interpolation is separable over a domain’s axes with InterpolationMethod::Nearest, InterpolationMethod::Linear (two-point) or InterpolationMethod::Cubic (four-point Lagrange, exact for cubics) stencils:

  • periodic (azimuth) axes wrap around;
  • bounded axes shift the stencil inside the grid near the ends (falling back to fewer points when an axis is too short);
  • polar axes on spherical domains continue across the pole onto the reflected samples (θ', φ + π) when the grid allows it (see Domain::across_pole), so queries between the pole and the first Gauss-Legendre node, or stencils straddling a pole, are handled smoothly.

Vector fields are interpolated in Cartesian components, which are smooth everywhere (spherical θ̂/φ̂ components flip sign across the poles), and the result is expressed in the field’s basis at the query point.

See the book entry Fields on grids.

Enums§

Extrapolation
What resampling does with target points outside the source domain.
InterpolationMethod
The interpolation stencil.