spatial.GeometryFMLineSpectrum

spatial.GeometryFMLineSpectrum(
    self,
    node_coordinates,
    element_table,
    codes=None,
    projection='LONG/LAT',
    dfsu_type=None,
    element_ids=None,
    node_ids=None,
    validate=True,
    frequencies=None,
    directions=None,
    reindex=False,
)

Flexible mesh line spectrum geometry.

Attributes

Name Description
boundary_codes Unique list of boundary codes.
codes Node codes of all nodes (0=water, 1=land, 2…=open boundaries).
dims Names of the dimensions, (“node”, …spectral).
directions Directional axis.
element_coordinates Center coordinates of each element.
element_ids Element ids (0-based).
frequencies Frequency axis.
is_geo Are coordinates geographical (LONG/LAT)?
is_layered Spectral geometries are never layered.
is_local_coordinates Are coordinates relative (NON-UTM)?
is_spectral Type is spectral dfsu (point, line or area spectrum).
max_nodes_per_element The maximum number of nodes for an element.
n_directions Number of directions.
n_elements Number of elements.
n_frequencies Number of frequencies.
n_nodes Number of nodes.
node_ids Node ids (0-based).
projection The projection.
projection_string The projection string.

Methods

Name Description
create_dummy_coordinates Create a line spectrum geometry with placeholder node coordinates.
get_space_axis Line spectrum has node as the geographic space dimension.
isel Select a subset of nodes.
reduce Return reduced geometry after spatial aggregation.

create_dummy_coordinates

spatial.GeometryFMLineSpectrum.create_dummy_coordinates(
    n_nodes,
    frequencies,
    directions,
)

Create a line spectrum geometry with placeholder node coordinates.

Parameters

Name Type Description Default
n_nodes int Number of nodes on the line required
frequencies np.array Frequency axis required
directions np.array Directional axis required

Returns

Name Type Description
GeometryFMLineSpectrum Geometry with nodes placed on a straight line

get_space_axis

spatial.GeometryFMLineSpectrum.get_space_axis()

Line spectrum has node as the geographic space dimension.

isel

spatial.GeometryFMLineSpectrum.isel(idx, axis='node')

Select a subset of nodes.

Parameters

Name Type Description Default
idx list[int] Node indices to select required
axis str Not used, nodes is the only spatial axis 'node'

Returns

Name Type Description
GeometryFMPointSpectrum or GeometryFMLineSpectrum Geometry for the selected nodes

reduce

spatial.GeometryFMLineSpectrum.reduce(axis)

Return reduced geometry after spatial aggregation.