pyinterp.grid.Grid3D

class pyinterp.grid.Grid3D(*args, increasing_axes: str | None = None)[source]

Bases: Grid2D

3D Cartesian Grid.

Parameters:
  • x (pyinterp.Axis) – X-Axis.

  • y (pyinterp.Axis, pyinterp.TemporalAxis) – Y-Axis.

  • z (pyinterp.Axis) – Z-Axis.

  • array (numpy.ndarray) – Discrete representation of a continuous function on a uniform 3-dimensional grid.

  • increasing_axes – Ensure that the axes of the grid are increasing. If this is not the case, the axes and grid provided will be flipped. Default to False.

Note

If the Z axis is a temporal axis, the grid will handle this axis during interpolations as a time axis.

Examples

>>> import numpy as np
>>> import pyinterp
>>> x_axis = pyinterp.Axis(numpy.arange(-180.0, 180.0, 1.0),
...                        is_circle=True)
>>> y_axis = pyinterp.Axis(numpy.arange(-80.0, 80.0, 1.0),
...                        is_circle=False)
>>> z_axis = pyinterp.TemporalAxis(
...     numpy.array(['2000-01-01'], dtype="datetime64[s]"))
>>> array = numpy.zeros((len(x_axis), len(y_axis), len(z_axis)))
>>> grid = pyinterp.Grid3D(x_axis, y_axis, z_axis, array)

Attributes

array

Gets the values handled by this instance.

x

Gets the X-Axis handled by this instance.

y

Gets the Y-Axis handled by this instance.

z

Gets the Z-Axis handled by this instance.

Protected Methods

_DIMENSIONS

The number of grid dimensions handled by this object.