Skip to main content

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 layered geometry consisting of a single vertical column.

Attributes

Name Description
bottom_elements Element id of the bottom element, as a list of one.
boundary_codes Unique list of boundary codes.
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 element ids of the column, bottom to top, as a table of one.
elem2d_ids The column index of each element (all 0).
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 element.
max_nodes_per_element The maximum number of nodes for an element.
n_elements Number of elements.
n_layers Number of layers.
n_layers_per_column Number of layers, as a list of one.
n_nodes Number of nodes.
n_sigma_layers Number of sigma layers.
n_z_layers Number of z-layers.
node_ids Node ids (0-based).
projection The projection.
projection_string The projection string.
top_elements Element id of the surface element, as a list of one.

Methods

Name Description
calc_ze Z-coordinates at element centers.
calc_zf Z-coordinates at layer faces (horizontal interfaces between layers).
elements_to_geometry Export a selection of elements to a new geometry.
find_index Find a set of element indices for z values and/or layers.
get_layer_elements Element ids for one (or more) specific layer(s).
get_space_axis Get geographic space axis indices within the geometry’s dims.
isel Export a selection of elements to a new geometry.
reduce Return reduced geometry after spatial aggregation.

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).

elements_to_geometry

spatial.GeometryFMVerticalColumn.elements_to_geometry(elements, keepdims=False)

Export a selection of elements to a new geometry.

find_index

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

Find a set of element indices for z values and/or layers.

A column has a single horizontal position, so x, y, area and the x,y part of coords are rejected.

Parameters

Name Type Description Default
x float | None Not supported None
y float | None Not supported None
z float | None Z coordinate (depth, positive upwards) None
coords np.array(float, float, float) Not supported None
area (float, float, float, float) Not supported 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 element indices

get_layer_elements

spatial.GeometryFMVerticalColumn.get_layer_elements(layers)

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.

isel

spatial.GeometryFMVerticalColumn.isel(idx, keepdims=False, **kwargs)

Export a selection of elements to a new geometry.

reduce

spatial.GeometryFMVerticalColumn.reduce(axis)

Return reduced geometry after spatial aggregation.