pyinterp.grid.Grid3D

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

Bases: pyinterp.grid.Grid2D

3D Cartesian Grid.

__init__(*args, increasing_axes=None)[source]

Initialize a new 3D Cartesian Grid.

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

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

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

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

  • increasing_axes (bool, optional) – 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(np.arange(-180.0, 180.0, 1.0),
...                        is_circle=True)
>>> y_axis = pyinterp.Axis(np.arange(-80.0, 80.0, 1.0),
...                        is_circle=False)
>>> z_axis = pyinterp.TemporalAxis(
...     np.array(['2000-01-01'], dtype="datetime64[s]"))
>>> array = np.zeros((len(x_axis), len(y_axis), len(z_axis)))
>>> grid = pyinterp.Grid3D(x_axis, y_axis, z_axis, array)

Methods

Grid3D._DIMENSIONS

The number of grid dimensions handled by this object

Attributes

Grid3D.array

Gets the values handled by this instance.

Grid3D.x

Gets the X-Axis handled by this instance.

Grid3D.y

Gets the Y-Axis handled by this instance

Grid3D.z

Gets the Z-Axis handled by this instance.