viscid.cython.cycalc module

viscid.cython.cycalc.interp()

Interpolate a field to points described by seeds

Note

Nearest neighbor is always used between the last value and vfield.crds.xh. This is done to keep from extrapolating and introducing new maxima. As such, AMR grids may be more step-like at patch boundaries.

Parameters:
  • vfield (viscid.field.Field) – Some Vector or Scalar field. If this field is not 3D, then vfield.atleast_3d() is called
  • seeds (viscid.claculator.seed) – locations for the interpolation
  • kind (str) – either ‘linear’ or ‘nearest’
  • wrap (bool) – if true, then call seeds.wrap on the result
  • method (str) – alias for kind, because why not
Returns:

numpy.ndarray of interpolated values. Shaped (seed.nr_points,) or (seed.nr_points, vfield.nr_comps) if vfield is a Scalar or Vector field.

viscid.cython.cycalc.interp_linear()

Interpolate a field to points described by seeds

Note

Nearest neighbor is used between the last value and vfield.crds.xh. This is done to keep from extrapolating and introducing new maxima.

Parameters:
  • vfield (viscid.field.Field) – Some Vector or Scalar field
  • seeds (viscid.claculator.seed) – locations for the interpolation
  • wrap (bool) – if true, then call seeds.wrap on the result
Returns:

numpy.ndarray of interpolated values. Shaped (seed.nr_points,) or (seed.nr_points, vfield.nr_comps) if vfield is a Scalar or Vector field.

viscid.cython.cycalc.interp_nearest()

Interpolate a field to points described by seeds

Parameters:
  • vfield (viscid.field.Field) – Some Vector or Scalar field
  • seeds (viscid.claculator.seed) – locations for the interpolation
  • wrap (bool) – if true, call seeds.wrap on the result
Returns:

numpy.ndarray of interpolated values. Shaped (seed.nr_points,) or (seed.nr_points, vfield.nr_comps) if vfield is a Scalar or Vector field.

viscid.cython.cycalc.interp_trilin()

Interpolate a field to points described by seeds

Note

Nearest neighbor is used between the last value and vfield.crds.xh. This is done to keep from extrapolating and introducing new maxima.

Parameters:
  • vfield (viscid.field.Field) – Some Vector or Scalar field
  • seeds (viscid.claculator.seed) – locations for the interpolation
  • wrap (bool) – if true, then call seeds.wrap on the result
Returns:

numpy.ndarray of interpolated values. Shaped (seed.nr_points,) or (seed.nr_points, vfield.nr_comps) if vfield is a Scalar or Vector field.