multimodemodel.Grid#
- class multimodemodel.Grid(x, y, z=None, mask=None, dx=None, dy=None, dz=None)[source]#
Grid information.
A Grid object holds all information about coordinates of the grid points and grid spacing, i.e. size of the grid box faces. For convenience there are following class methods:
- Parameters:
method) ((of the __init__)
x (
ndarray) – 2D np.ndarray of x-coordinates on gridy (
ndarray) – 2D np.ndarray of y-coordinates on gridz (
Array, defaultNone) – 1D Array of z coordinates.mask (
Array = None) – optional. Ocean mask, 1 where ocean is, 0 where land is. Default is a rectangular domain with closed boundaries.dx (
Optional[np.ndarray] = None) – Initialization of dxdy (
Optional[np.ndarray] = None) – Initialization of dydz (
Optional[np.ndarray] = None) – Initialization of dz
- Variables:
dx (
Array) – Grid spacing in x.dy (
Array) – Grid spacing in y.dz (
Array) – Grid spacing in z.mask (
Array) – optional. Ocean mask, 1 where ocean is, 0 where land is. Default is a rectangular domain with closed boundaries.shape (
tuple[int]) – Shape of the grid data.ndim (
int:) – Number of dimensionsdim_x (
int) – Axis index of x dimension.dim_y (
int) – Axis index of y dimension.dim_z (
int) – Axis index of z dimension.
- Raises:
ValueError – Raised if the shape of mask does not fit the shape of the grid.
Methods
__init__(x, y[, z, mask, dx, dy, dz])Initialize self.
cartesian(x, y[, z, mask])Generate a Cartesian grid.
merge(others, merger)Merge grids.
regular_lat_lon(lon_start, lon_end, ...[, ...])Generate a regular spherical grid.
split(splitter)Split grid.
Attributes