Skip to main content

An API for ocean wave kinematics

Project description

spectral_wave_data

An API for ocean wave kinematics

This Python package is part of the spectral_wave_data API developed by the GitHub organization SpectralWaveData.

alt text

Purpose and goals

The main idea is to provide an open API for boosting research and industrial application of spectral ocean wave kinematic. This API can be utilized by academic and commercial software developers to assess effects of ocean gravity waves. Not limited to spectral kinematics, but also, as advanced boundary conditions for more sophisticated wave models and to study related effects on marine structures.

By using this simple but powerful interface another goal with this API is to tear down walls between the fields of oceanography, marine hydrodynamics (flow around marine structures) and structural engineering.

What kind of waves?

There are many spectral formulations out there. Our goal is not to implement all of them, but to make the API generic in the sense that most formulations can apply this API, and that additional formulations can easily be tested or added at a later stage without breaking the current API. At this stage we have implemented long and short crested waves propagating in infinite or constant water depth. For long crested seas support for varying depth is also included.

The current version has been used for describing, Airy, Stokes, Stream waves and Higher-Order-Spectral-Method waves of arbitrary order. Detailed kinematics of simulated rogue waves can be evaluated.

Documentation

Detailed documentation describing theory, examples, implementation and related tools is hosted on ReadTheDocs.

The software

This is the python package. However, in general spectral_wave_data provides API for several other programming languages:

  • ISO Fortran-2008
  • ISO C / C++
  • Python 2 and 3

The spectral_wave_data Python package mainly contains a class SpectralWaveData providing the official Python API. In addition, it provides a script swd_meta for extracting typical meta data from a given SWD-file. Such files contain the spectral information of the actual wave trains.

As explained in the documentation the class SpectralWaveData provides consistent exception handling.

Usage

Typical usage in a Python script or program::

from spectral_wave_data import SpectralWaveData

# x0/y0/t0/beta are parameters shifting the spatial and temporal reference frame
swd = SpectralWaveData(file_swd="my.swd", x0=0.0, y0=0.0, t0=0.0, beta=180.0)

swd.update_time(time=3.8143127)      # Maximum time can be obtained from: swd['tmax']

zeta = swd.elev(x=5.3, y=12.4)
acc_e = swd.acc_euler(x=7.3, y=-3.4, z=-8.3)
acc_p = swd.acc_particle(x=7.3, y=-3.4, z=-8.3)
phi2 = swd.grad_phi_2nd(x=7.3, y=-3.4, z=-8.3)

print("Surface elevation at (x, y) = ", zeta)
print("Euler (local) acceleration in x-direction at (x,y,z) = ", acc_e.x)
print("Particle acceleration in x-direction at (x,y,z) = ", acc_p.x)
print("d^2(potential)/dxdz at (x,y,z) = ", phi2.xz)

Meta data from an actual SWD file can be extracted using the console script swd_meta::

>>> swd_meta my.swd
version: 1.0.0
prog:    raschii-1.0.3
date:    2020:01:22 19:57:55
fmt:     100
shp:     2
amp:     1
tmax:    6.3000000938773155
dt:      0.10000000149011612
nsteps:  64
nstrip:  0
order:   -1
d:       32.0
n:       50
sizex:   220.00000561733003
lmax:    220.00000561733003
lmin:    4.400000112346601
dk:      0.028559932485222816
cid:     {'model': 'Fenton', 'T': 12.792885811907514, 'height': 18.5, ...}

Output and further examples are explained in the online documentation.

Installation

To install spectral_wave_data is usually obtained executing::

pip install spectral_wave_data

in your actual Python environment on Linux or Windows-10. Python 2.7 or 3.5, 3.6, 3.7 and 3.8 are supported.

On windows you may have to download and install the Intel redistributable library for Fortran 2020 using default options, unless you have a recent Intel Fortran compiler installed.

On Linux spectral_wave_data is compiled using gfortran. The related GNU libraries should most likely already be available in your system.

For other systems you need to build the package from source. To compile this Python package from source you need access to a recent Fortran compiler. E.g gfortran-10 or Intel Fortran 2019 or later.

Due to the complexity of building from source we refer to the documentation and the spectral_wave_data GitHub repository for related instructions and download of the source code.

Installation problems?

In some rare and odd Python environments users have encountered issues loading the spectral_wave_data in combinations with e.g. numpy. The best solution is to reinstall your Python system in a proper way. However, a quick-fix is usually to load spectral_wave_data before numpy because spectral_wave_data requires a more recent version of some Intel DLLs on Windows.

This rare issue is not present if you apply recommended procedures for setting up your Python system. Hence, consistently using e.g. pyenv or Anaconda environments. In general, manual fumbling of system paths is always a source of subtle problems and should be avoided.

Copyright and license

This software is copyrighted and licensed open-source under the MIT License.

See the spectral_wave_data GitHub repository for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

spectral_wave_data-1.0.0rc1-cp38-cp38-win_amd64.whl (493.0 kB view details)

Uploaded CPython 3.8Windows x86-64

spectral_wave_data-1.0.0rc1-cp37-cp37m-win_amd64.whl (493.0 kB view details)

Uploaded CPython 3.7mWindows x86-64

spectral_wave_data-1.0.0rc1-cp36-cp36m-win_amd64.whl (493.0 kB view details)

Uploaded CPython 3.6mWindows x86-64

spectral_wave_data-1.0.0rc1-cp35-cp35m-win_amd64.whl (492.7 kB view details)

Uploaded CPython 3.5mWindows x86-64

spectral_wave_data-1.0.0rc1-cp27-cp27m-win_amd64.whl (493.1 kB view details)

Uploaded CPython 2.7mWindows x86-64

File details

Details for the file spectral_wave_data-1.0.0rc1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: spectral_wave_data-1.0.0rc1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 493.0 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for spectral_wave_data-1.0.0rc1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 bcbf13093f1c4d07190b7af40665d2d06353a29f6feaa36dc58942524399bfa4
MD5 63f40c0b85d771992f30bfdb1ae30d25
BLAKE2b-256 964068643978ed6c0c414d544f625b7e1ba552392a5b730d4d60937646697b37

See more details on using hashes here.

File details

Details for the file spectral_wave_data-1.0.0rc1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: spectral_wave_data-1.0.0rc1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 493.0 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for spectral_wave_data-1.0.0rc1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 15d221979a57ff61362f377c1177c2299b00685ac469df6d0e40252b2a879731
MD5 2c5b5395938e7220e597c8e65f653c1b
BLAKE2b-256 b2ef134d9112a9429275e870fe6865d486ddf01aea7301409f076817929f2f35

See more details on using hashes here.

File details

Details for the file spectral_wave_data-1.0.0rc1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: spectral_wave_data-1.0.0rc1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 493.0 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for spectral_wave_data-1.0.0rc1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 66d5d0fcc4704fc7f834e941da5cf1405024e9624fea0bd8aaf554a25a025604
MD5 f0d63cf5f22d152216b56370c770bff1
BLAKE2b-256 e932c001fe00a5fa8575d08296556021a0e997b4716f607a695b2bdf419b4b80

See more details on using hashes here.

File details

Details for the file spectral_wave_data-1.0.0rc1-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: spectral_wave_data-1.0.0rc1-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 492.7 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for spectral_wave_data-1.0.0rc1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 a5efcc161ee14b32d034837d05a209fdc65a62be35c0bbf5e506e866a31a22aa
MD5 cbb4fef839ffc4b488408c919ea46878
BLAKE2b-256 845ded36822ae737e49ff39259fa749a3928e902e18db30a0f9cf7fed6207ca6

See more details on using hashes here.

File details

Details for the file spectral_wave_data-1.0.0rc1-cp27-cp27m-win_amd64.whl.

File metadata

  • Download URL: spectral_wave_data-1.0.0rc1-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 493.1 kB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for spectral_wave_data-1.0.0rc1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 a349dcaf13b48854aefd9991b1a6fc49046e0710c9a5e39bbe6a3b1ffbe7a8fa
MD5 9d814950614d6d0fc231b38cadd79eae
BLAKE2b-256 f37689beb87eb488a19f565fd7e4a7a4512cf28cd59431e4faaaa06e0ec675b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page