Grid3D

Grid3D(
    self,
    *,
    x=None,
    x0=0.0,
    dx=None,
    nx=None,
    y=None,
    y0=0.0,
    dy=None,
    ny=None,
    z=None,
    z0=0.0,
    dz=None,
    nz=None,
    projection='NON-UTM',
    origin=(0.0, 0.0),
    orientation=0.0,
)

3D grid.

Origin in the center of cell in lower-left corner x, y and z axes are increasing and equidistant

Attributes

Name Description
dx X-axis grid spacing.
dy Y-axis grid spacing.
dz Z-axis grid spacing.
is_geo Are coordinates geographical (LONG/LAT)?
is_local_coordinates Are coordinates relative (NON-UTM)?
nx Number of x grid points.
ny Number of y grid points.
nz Number of z grid points.
orientation Grid orientation.
origin Coordinates of grid origo (in projection).
projection The projection.
projection_string The projection string.
x Array of x-axis coordinates (element center).
y Array of y-axis coordinates (element center).
z Array of z-axis node coordinates.

Methods

Name Description
get_space_axis Get geographic space axis indices within the geometry’s dims.
isel Get a subset geometry from this geometry.
reduce Return reduced geometry after spatial aggregation.

get_space_axis

Grid3D.get_space_axis()

Get geographic space axis indices within the geometry’s dims.

Returns which of the geometry’s dims represent geographic space dimensions, as opposed to spectral or other non-geographic dimensions.

This is used when axis=“space” or axis=“spatial” is specified in operations like aggregate, mean, etc.

Returns

Name Type Description
tuple[int, …] Space axis indices (0-indexed within geometry.dims). Returns empty tuple if there are no space dimensions (e.g., point geometries, pure spectral geometries).

Examples

Grid2D with dims=(“y”, “x”) returns (0, 1) - both are space. GeometryFMAreaSpectrum with dims=(“element”, “direction”, “frequency”) returns (0,) - only element is space, direction/frequency are spectral. GeometryFMPointSpectrum with dims=(“frequency”,) returns () - no space.

isel

Grid3D.isel(idx, axis)

Get a subset geometry from this geometry.

reduce

Grid3D.reduce(axis)

Return reduced geometry after spatial aggregation.