Last updated on May 12, 2026.

netsse.base#

Class definitions for the NetSSE software.

Copyright (C) 2023-2026 Technical University of Denmark, R.E.G. Mounet

This code is part of the NetSSE software.

NetSSE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

NetSSE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

To credit the author, users are encouraged to use below reference:

Mounet, R. E. G., & Nielsen, U. D. NetSSE: An open-source Python package
for network-based sea state estimation from ships, buoys, and other
observation platforms (version 2.2). Technical University of Denmark,
GitLab. February 2026. https://doi.org/10.11583/DTU.26379811.

Last updated on 20-02-2026 by R.E.G. Mounet

Classes#

Buoy

Initialises the buoy as a platform.

Collection

Initialises the data collection.

Network

Initialises the network.

Operation

Initialises the operation.

Platform

Initialises the platform.

SeaState

Initialises the sea state at a given time and geographical position in the ocean.

SeaStateCollec

Initialises the sea state collection.

Spectrum

Vessel

Initialises the wave radar as a platform.

WaveRadar

Initialises the wave radar as a platform.

WaveSequence

Initialises the wave sequence.

WaveSpectrum

Initialises the sea state at a given time and geographical position in the ocean.

Module Contents#

class netsse.base.Buoy(name=None, owner='undefined', operations=[], seastate_collections=[], type='undefined')[source]#

Bases: Platform

Initialises the buoy as a platform.

Parameters:
  • type (str, default 'undefined') –

    Buoy type.

    Note

    Consult netsse.base.Platform.__init__() for information on the other parameters.

  • name (str)

  • owner (str)

  • operations (list)

  • seastate_collections (list)

Example

>>> buoy1 = netsse.base.Buoy()
type = 'undefined'[source]#
class netsse.base.Collection(area='undefined', nature='undefined', origin='undefined', datetime_start=datetime.now(), datetime_end=datetime.now(), lat_min=0, lat_max=0, lon_min=0, lon_max=0)[source]#

Initialises the data collection.

Parameters:
  • area (str, default 'undefined') – Area of data collection.

  • nature (str, default 'undefined') – Nature of the data collection.

  • origin (str or object, default 'undefined') – Origin or source of the data collection.

  • datetime_start (datetime object, default datetime.now()) – Time coverage of the data collection.

  • datetime_end (datetime object, default datetime.now()) – Time coverage of the data collection.

  • lat_min (float, default 0) – Latitude [deg North] at the southern/northern edge of the geographical domain covered by the data collection.

  • lat_max (float, default 0) – Latitude [deg North] at the southern/northern edge of the geographical domain covered by the data collection.

  • lon_min (float, default 0) – Longitude [deg East] at the western/eastern edge of the geographical domain covered by the data collection.

  • lon_max (float, default 0) – Longitude [deg East] at the western/eastern edge of the geographical domain covered by the data collection.

Example

>>> collec1 = netsse.base.Collection()
area = 'undefined'[source]#
datetime_end[source]#
datetime_start[source]#
lat_max = 0[source]#
lat_min = 0[source]#
lon_max = 0[source]#
lon_min = 0[source]#
nature = 'undefined'[source]#
origin = 'undefined'[source]#
class netsse.base.Network(name=None, nature='undefined', platforms=[])[source]#

Initialises the network.

Parameters:
  • name (str, optional) – Network name. By default, the name string is generated randomly in the format NetworkXXXX.

  • nature (str, default 'undefined') – Network nature.

  • platforms (list, default []) – List of platforms (as Platform instances).

See also

Platform

Example

>>> plaform1 = netsse.base.Platform()
>>> network = netsse.base.Network(platforms=[plaform1])
add_platform(*args, ignore_msg=False)[source]#

Add a Platform instance to the list of platforms in the network.

Parameters:
  • *args (Platform object) – Platform to be added to the network.

  • ignore_msg (bool, default False) – If False, messages are printed to inform about any changes made to the network. If True, thoses messages are turned off.

Example

>>> plaform2 = netsse.base.Platform()
>>> network.add_platform(platform2,ignore_msg=True)
remove_platform(*args, ignore_msg=False)[source]#

Remove a Platform instance from the list of platforms in the network.

Parameters:
  • *args (Platform object or str) – Platform to be removed from the network. Identified by the corresponding name or Platform instance.

  • ignore_msg (bool, default False) – If False, messages are printed to inform about any changes made to the network. If True, thoses messages are turned off.

Example

>>> network.remove_platform(platform1,ignore_msg=True)
name = None[source]#
nature = 'undefined'[source]#
platforms = [][source]#
class netsse.base.Operation(id=None, area='undefined', nature='undefined', origin='undefined', datetime_start=datetime.now(), datetime_end=datetime.now(), lat_min=0, lat_max=0, lon_min=0, lon_max=0, segments=[])[source]#

Initialises the operation.

Parameters:
  • id (str, optional) – Operation identifier. By default, the id string is generated randomly in the format OperXXXXX.

  • segments (list, default []) –

    List of segments (as Segment instances) gathered during the operation.

    Note

    Consult netsse.base.Collection.__init__() for information on the other parameters.

  • area (str)

  • nature (str)

  • lat_min (float)

  • lat_max (float)

  • lon_min (float)

  • lon_max (float)

See also

Collection, Platform, Segment

Example

>>> operation1 = netsse.base.Operation()
id = None[source]#
segments = [][source]#
class netsse.base.Platform(name=None, owner='undefined', operations=[], seastate_collections=[])[source]#

Initialises the platform.

Parameters:
  • name (str, optional) – Name of the platform. By default, the name string is generated randomly in the format PlatformXXXXX.

  • owner (str, default 'undefined') – Platform owner.

  • operations (list, default []) – List of operations.

  • seastate_collections (list, default []) – List of sea state collections (as SeaStateCollec instances).

Example

>>> operation1 = netsse.base.Operation()
>>> seastatecollec1 = netsse.base.SeaStateCollec()
>>> platform1 = netsse.base.Platform(name='MyPlatform',owner='SomeCompany',        ...                                  operations=[operation1],        ...                                  seastate_collections=[seastatecollec1])
add_operation(*args, ignore_msg=False)[source]#

Add an Operation instance to the list of operations of the platform.

Parameters:
  • *args (Operation object) – Operation to be added to the platform.

  • ignore_msg (bool, default False) – If False, messages are printed to inform about any changes made to the platform. If True, thoses messages are turned off.

Example

>>> operation2 = netsse.base.Operation()
>>> platform1.add_operation(operation2,ignore_msg=True)
add_seastatecollec(*args, ignore_msg=False)[source]#

Add a SeaStateCollec instance to the list of sea state collections of the platform.

Parameters:
  • *args (SeaStateCollec object) – Collections to be added to the platform.

  • ignore_msg (bool, default False) – If False, messages are printed to inform about any changes made to the platform. If True, thoses messages are turned off.

Example

>>> seastatecollec2 = netsse.base.SeaStateCollec()
>>> platform1.add_seastatecollec(seastatecollec2,ignore_msg=True)
remove_operation(*args, ignore_msg=False)[source]#

Remove an existing Operation instance from the list of operations of the platform.

Parameters:
  • *args (Operation object or str) – Operation to be removed from the network. Identified by the corresponding identifier or Operation instance.

  • ignore_msg (bool, default False) – If False, messages are printed to inform about any changes made to the platform. If True, thoses messages are turned off.

Example

>>> platform1.remove_operation(platform1,ignore_msg=True)
remove_seastatecollec(*args, ignore_msg=False)[source]#

Remove an existing SeaStateCollec instance from the list of sea state collections of the platform.

Parameters:
  • *args (SeaStateCollec object or str) – Collections to be removed from the network. Identified by the corresponding identifier or SeaStateCollec instance.

  • ignore_msg (bool, default False) – If False, messages are printed to inform about any changes made to the platform. If True, thoses messages are turned off.

Example

>>> platform1.remove_seastatecollec(seastatecollec1,ignore_msg=True)
name = None[source]#
operations = [][source]#
owner = 'undefined'[source]#
seastate_collections = [][source]#
class netsse.base.SeaState(Hs=0, Tp=0, timestamp=datetime.now(), lat=0, lon=0, depth=0, duration=30 * 60)[source]#

Initialises the sea state at a given time and geographical position in the ocean.

Parameters:
  • Hs (float, default 0) – Significant wave height [m].

  • Tp (float, default 0) – Peak wave period [s].

  • timestamp (datetime object, default datetime.now()) – Timestamp at which the sea state applies.

  • lat (float, default 0) – Latitude [degrees North].

  • lon (float, default 0) – Longitude [degrees East].

  • depth (float, default 0) – Water depth [m] at the studied location.

  • duration (float, optional) – Time duration of the sea state [s], by default 30*60 = 1800 s.

Examples

>>> seastate = SeaState(Hs,Tp,timestamp,lat,lon,depth,duration)
set_params(Hs, Tp)[source]#

Sets the sea state parameters \(H_s\) and \(T_p\) to new user-defined values.

Parameters:
  • Hs (float) – Significant wave height [m].

  • Tp (float) – Peak wave period [s].

Examples

>>> seastate.set_params(Hs,Tp)
depth = 0[source]#
duration = 1800[source]#
lat = 0[source]#
lon = 0[source]#
timestamp[source]#
class netsse.base.SeaStateCollec(id=None, area='undefined', nature='undefined', origin='undefined', datetime_start=datetime.now(), datetime_end=datetime.now(), lat_min=0, lat_max=0, lon_min=0, lon_max=0, seastates=[])[source]#

Initialises the sea state collection.

Parameters:
  • id (str, optional) – Data collection identifier. By default, the id string is generated randomly in the format CollecXXXXX.

  • seastates (list, default []) –

    List of sea states (as SeaState instances) gathered in the data collection.

    Note

    Consult netsse.base.Collection.__init__() for information on the other parameters.

  • area (str)

  • nature (str)

  • lat_min (float)

  • lat_max (float)

  • lon_min (float)

  • lon_max (float)

Example

>>> seastatecollec1 = netsse.base.SeaStateCollec()
id = None[source]#
seastates = [][source]#
class netsse.base.Spectrum(freq=np.linspace(0, 1, 100), ord=np.zeros((100,)), unit_freq='Hz')[source]#
class netsse.base.Vessel(name=None, owner='undefined', operations=[], seastate_collections=[], type='undefined', params={}, raos=[])[source]#

Bases: Platform

Initialises the wave radar as a platform.

Parameters:
  • type (str, default 'undefined') – Wave radar type.

  • params (dict, default {}) – Vessel main dimensions and other geometrical parameters.

  • raos (list, default []) –

    Vessel response amplitude operators.

    Note

    Consult netsse.base.Platform.__init__() for information on the other parameters.

  • name (str)

  • owner (str)

  • operations (list)

  • seastate_collections (list)

Example

>>> vessel1 = netsse.base.Vessel(params={'L':200,'B':25,'T':30})
add_rao(*args)[source]#
params[source]#
raos = [][source]#
type = 'undefined'[source]#
class netsse.base.WaveRadar(name=None, owner='undefined', operations=[], seastate_collections=[], type='undefined')[source]#

Bases: Platform

Initialises the wave radar as a platform.

Parameters:
  • type (str, default 'undefined') –

    Wave radar type.

    Note

    Consult netsse.base.Platform.__init__() for information on the other parameters.

  • name (str)

  • owner (str)

  • operations (list)

  • seastate_collections (list)

Example

>>> radar1 = netsse.base.WaveRadar()
type = 'undefined'[source]#
class netsse.base.WaveSequence(Hs=0, Tp=0, timestamp=datetime.now(), lat=0, lon=0, depth=0, wave=None, time=None, fs=10)[source]#

Bases: SeaState

Initialises the wave sequence.

Parameters:
  • wave (array-like of shape (Nt,), optional) – Sea surface elevation time-series [m]. By default None.

  • time (array-like of shape (Nt,), optional) – Vector of time [s], by default None.

  • fs (float, default 10) –

    Sampling frequency [Hz].

    Note

    Consult netsse.base.SeaState.__init__() for information on the other parameters.

Raises:

ValueError – In case the input time and wave vectors do not have the same length.

Examples

>>> waveseq =
...     WaveSequence(Hs, Tp, timestamp, lat, lon, depth, wave, time)
get_wavespec(method='Welch', nperseg=2**8, fmax=0)[source]#
duration[source]#
fs[source]#
class netsse.base.WaveSpectrum(Hs=np.nan, Tp=np.nan, freq=np.linspace(0, 1, 100), ord=np.zeros((100,)), unit_freq='Hz', timestamp=datetime.now(), lat=0, lon=0, depth=0, duration=30 * 60)[source]#

Bases: Spectrum, SeaState

Initialises the sea state at a given time and geographical position in the ocean.

Parameters:
  • Hs (float, default 0) – Significant wave height [m].

  • Tp (float, default 0) – Peak wave period [s].

  • timestamp (datetime object, default datetime.now()) – Timestamp at which the sea state applies.

  • lat (float, default 0) – Latitude [degrees North].

  • lon (float, default 0) – Longitude [degrees East].

  • depth (float, default 0) – Water depth [m] at the studied location.

  • duration (float, optional) – Time duration of the sea state [s], by default 30*60 = 1800 s.

Examples

>>> seastate = SeaState(Hs,Tp,timestamp,lat,lon,depth,duration)
get_params(smooth_Tp=True)[source]#
set_from_standard(method='JONSWAP', gamma=3.3)[source]#
set_from_waveseq(waveseq, method='Welch', nperseg=2**8, fmax=0)[source]#