Skip to main content
# swantools

This repository gathers some useful functions and tools to be used alongside SWAN wave model.

For downloading, installing and using SWAN, please see: http://swanmodel.sourceforge.net/

To easily install the module just do:

```bash
sudo pip install swantools
```

alternatively, download the source code and install with:

```bash
sudo setup.py install
```

Nowadays, there is a I/O class which can handle TABLE, SPECOUT and BLOCK outputs. In the future, it will be possible to write spectral boundary conditions, TPAR files and initial conditions.

For example, to use the I/O structure for reading a TABLE with HEAD option do:

```python

import swantools

rw = swantools.SwanIO()

table = rw.read_swantable('file.txt')
```
This will return a pandas DataFrame with the model data.

Reading spectral (.spc) files become very easy:

```python

lon,lat,nfreqs,freqs,ndirs,dirs,spectra = rw.read_swanspc('file.txt','19990101.00000')
```

Some useful functions are also provided, for example:

```python

lat = np.arange(-40,-10,0.25)
lon = np.arange(-60,-40,0.25)
plats = np.array([-15.65,-25.25,-12.45])
plons = np.array([-35.20,-55.27,-30.10])

indx,dists = nearest_point(lon,lat,plons,plats)
```

Much more will be added in the future.

Enjoy !

Metadata

Release files for swantools 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swantools 0.1.1
File Size Uploaded Provenance Actions
swantools-0.1.1.tar.gz 4.5 kB Without provenance Details for swantools-0.1.1.tar.gz

Release files / swantools-0.1.1.tar.gz

Download URL swantools-0.1.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
eafc6c97458b92094a9d3dcd43810044c4a722f0f082a4f0042dd433d237ec8d
BLAKE2b-256 checksum
How to use checksums
5bf3ad1792906880f80745f3ce5c9ff714a978366fff7024f79c07d113bdcebf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for swantools 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page