pencil.math.interpolation

Interpolation routines for scalar and vector fields.

Functions

vec_int(xyz, field, dxyz, oxyz, nxyz[, interpolation, ...])

vec_int(xyz, field, dxyz, oxyz, nxyz, interpolation='trilinear')

Module Contents

pencil.math.interpolation.vec_int(xyz, field, dxyz, oxyz, nxyz, interpolation='trilinear', splines=None)

vec_int(xyz, field, dxyz, oxyz, nxyz, interpolation=’trilinear’)

Interpolates the field around position xyz.

Parameters:
  • xyz (ndarray) – Position vector around which will be interpolated.

  • field (ndarray) – Vector field to be interpolated with shape [nz, ny, nx].

  • dxyz (ndarray) – Array with the three deltas.

  • oxyz (ndarray) – Array with the position of the origin.

  • nxyz (ndarray) – Number of grid points in each direction.

  • interpolation (string) – Interpolation method. Can be ‘mean’, ‘trilinear’ or ‘tricubic’. If ‘tricubic’ interpolation is chosen, then the splines functions need to be specified.

  • splines (ndarray, optional) – Field data for tricubic interpolation (deprecated, uses field parameter instead).

Return type:

ndarray with interpolated vector field.