spatial.GeometryFMVerticalColumn

spatial.GeometryFMVerticalColumn(
    self,
    *,
    node_coordinates,
    element_table,
    codes=None,
    projection='LONG/LAT',
    dfsu_type=DfsuFileType.Dfsu3DSigma,
    element_ids=None,
    node_ids=None,
    n_layers=1,
    n_sigma=None,
    validate=True,
    reindex=False,
)

A 3d geometry with consisting of a single vertical column.

Attributes

Name Description
bottom_elements List of 3d element ids of bottom layer.
boundary_codes Unique list of boundary codes.
boundary_polygons Lists of polygons defining domain outline.
boundary_polylines Lists of polygons defining domain outline (deprecated, use boundary_polygons).
codes Node codes of all nodes (0=water, 1=land, 2…=open boundaries).
dims Named array dimensions of data on this geometry.
e2_e3_table The 2d-to-3d element connectivity table for a 3d object.
elem2d_ids The associated 2d element id for each 3d element.
element_coordinates Center coordinates of each element.
element_ids Element ids (0-based).
is_geo Are coordinates geographical (LONG/LAT)?
is_layered Type is layered dfsu (3d, vertical profile or vertical column).
is_local_coordinates Are coordinates relative (NON-UTM)?
layer_ids The layer number (0=bottom, 1, 2, …) for each 3d element.
max_nodes_per_element The maximum number of nodes for an element.
n_elements Number of elements.
n_layers Maximum number of layers.
n_layers_per_column List of number of layers for each column.
n_nodes Number of nodes.
n_sigma_layers Number of sigma layers.
n_z_layers Maximum number of z-layers.
node_ids Node ids (0-based).
plot Not available for GeometryFM3D, use to_2d_geometry().plot instead.
projection The projection.
projection_string The projection string.
top_elements List of 3d element ids of surface layer.

Methods

Name Description
calc_ze Z-coordinates at element centers.
calc_zf Z-coordinates at layer faces (horizontal interfaces between layers).
contains Test if a list of points are contained by the horizontal extent of the mesh.
find_index Find a set of 3d element indices for points, an area and/or layers.
get_layer_elements 3d element ids for one (or more) specific layer(s).
get_space_axis Get geographic space axis indices within the geometry’s dims.
reduce Return reduced geometry after spatial aggregation.
to_2d_geometry extract 2d geometry from 3d geometry.
to_mesh Export the horizontal mesh to a mesh file.

calc_ze

spatial.GeometryFMVerticalColumn.calc_ze(zn=None)

Z-coordinates at element centers.

calc_zf

spatial.GeometryFMVerticalColumn.calc_zf(zn=None)

Z-coordinates at layer faces (horizontal interfaces between layers).

contains

spatial.GeometryFMVerticalColumn.contains(points)

Test if a list of points are contained by the horizontal extent of the mesh.

find_index

spatial.GeometryFMVerticalColumn.find_index(
    x=None,
    y=None,
    z=None,
    coords=None,
    area=None,
    layers=None,
)

Find a set of 3d element indices for points, an area and/or layers.

Typically not called directly, but by Dataset/DataArray’s sel() method.

Parameters

Name Type Description Default
x float | None X coordinate (easting or longitude) None
y float | None Y coordinate (northing or latitude) None
z float | None Z coordinate (depth, positive upwards) None
coords np.array(float, float) As an alternative to specifying x, y (and z) individually, the argument coords can be used instead, by default None None
area (float, float, float, float) Bounding box of coordinates (left lower and right upper) to be selected, by default None None
layers int or str or list[int] layer(s) to be selected: subset of “all”, “top”, “bottom”, “bottom+1”, …, or a layer number (0=bottom, 1, 2, …), by default None None

Returns

Name Type Description
np.array 3d element indices

get_layer_elements

spatial.GeometryFMVerticalColumn.get_layer_elements(layers)

3d element ids for one (or more) specific layer(s).

Parameters

Name Type Description Default
layers int or list(int) layer between 0 (bottom) and n_layers-1 (top) (can also be negative counting from -1 at the top layer) required

Returns

Name Type Description
np.array(int) element ids

get_space_axis

spatial.GeometryFMVerticalColumn.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.

reduce

spatial.GeometryFMVerticalColumn.reduce(axis)

Return reduced geometry after spatial aggregation.

to_2d_geometry

spatial.GeometryFMVerticalColumn.to_2d_geometry()

extract 2d geometry from 3d geometry.

Returns

Name Type Description
GeometryFM2D 2d geometry

to_mesh

spatial.GeometryFMVerticalColumn.to_mesh(outfilename)

Export the horizontal mesh to a mesh file.