Skip to main content

Python package for working with ADCIRC input and output files.

Project description

AdcircPy

A Python interface for handling inputs and outputs for the ADCIRC hydrodynamic model.

Basic Installation:

You can install this software through conda or through pip.
The dependecies of Python packages installed through pip must be satisfied by the operating system (see Method 2 for details). On a normal user's computer, the recommended method of installation is through conda. Whether you are using the pip method or the conda method, it is generally good practice to always make use of a virtual environment for your project. If you are a Python newcomer, make sure to read upon Python environments and their usage as you dive more into Python development.

If you are doing development on a Windows machine it is highly recommended to use the Windows Subsystem for Linux, and run this software from a Widows-Subsystem-for-Linux shell. MingW64, Cygwin, the git-shell-for-windows, or any other off-the-shelf POSIX layer on Windows should work.

Method 1: Conda

The advantage of using conda is that it provides the necessary dependencies as precompiled binaries, therefore no local compilations are required, and cuts the installation time substantially. This is the recommended method to use.

Install Miniconda3 (recommended) or Anaconda3 on your system. Rememeber to make this installation on the POSIX layer when using Windows.

Create a new conda environment for your project, and inside the environment run:

conda update -n base -c defaults conda
conda install -c conda-forge gdal
pip install AdcircPy

Method 2: Pip-only (requires compilation of system libraries).

Pip requires that some system libraries are precompiled and installed before running pip install command. It is highly recommended that you use the system packge manager to satisfy these dependencies, or, they may be compiled from source. The .docker directory contains a full piecewise build on an Alpine distribution, which may be used for reference in case further guidance is required with respect to the full compilation procedure. Note that "dev" versions mean that the headers are required along with the compiled library. Also note that some of these libraries you may already have in your system.

Full system dependency list:

  • g++
  • gcc
  • m4
  • make
  • autoconf
  • zlib-dev
  • libc-dev
  • curl-dev
  • linux-headers
  • hdf5-dev
  • netcdf-c-dev
  • python3-dev
  • sqlite-dev
  • Proj4-dev
  • GDAL-dev
  • openblas-dev (for scipy)
  • freetype-dev (for matplotlib)
  • py3-pip

Once these dependencies have been met, you may simply do

pip install AdcircPy

NOTE: If you are developer and would like to debug the package, you may install this package on developer mode by first cloning the package, and then doing:

pip install -e .

Usage

CLI interface

After installation a few new commands are available on the command line interface.

A few of the available commands are:

  • PlotMesh
  • GenerateTidalRun
  • GenerateBestTrackFile
  • PlotMaxele
  • HighWaterMarkValidation
  • PlotTidalStationsOutput

Since this package is in development, the list above may not be up to date, therefore you may check setup.py, where the entrypoints for the present release are listed.

As an API

This package is an API to handle input and output files for the ADCIRC hydrodynamic model. You can load an Adcirc mesh and plot it by doing:

from AdcircPy import read_mesh
mesh = read_mesh('/path/to/fort.14')
# The most basic you can do with this software is create plots:
mesh.make_plot(show=True)

Example of fort.15 generation:

Tidal only run:

from AdcircPy import read_mesh
from datetime import datetime, timedelta
mesh = read_mesh('/path/to/fort.14', epsg=4326, vertical_datum='LSML')
start_date = datetime.now()
end_date = start_date + timedelta(days=5)
tidal_run = mesh.TidalRun(start_date, end_date, spinup_days=7)
tidal_run.dump()  # will write to stdout if no output path is given.

Example where global outputs are requested:

from AdcircPy import read_mesh
from AdcircPy import ElevationGlobalOutput as EGO
from datetime import datetime, timedelta
mesh = read_mesh('/path/to/fort.14')
start_date = datetime.now()
end_date = start_date + timedelta(days=5)
tidal_run = mesh.TidalRun(
            start_date, end_date,
            ElevationGlobalOutput=EGO(sampling_frequency=15))
tidal_run.dump()

* Examples will be updated as development continues. *

Please report bugs to jreniel@gmail.com

Project details


Download files

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

Source Distribution

AdcircPy-0.9.1.tar.gz (74.2 kB view details)

Uploaded Source

Built Distribution

AdcircPy-0.9.1-py3-none-any.whl (106.2 kB view details)

Uploaded Python 3

File details

Details for the file AdcircPy-0.9.1.tar.gz.

File metadata

  • Download URL: AdcircPy-0.9.1.tar.gz
  • Upload date:
  • Size: 74.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for AdcircPy-0.9.1.tar.gz
Algorithm Hash digest
SHA256 4efa7a00e3ff8e32b7f5e815d450feae44b6e38fbf7bcaf5cdfa1a1fb7a7d8e4
MD5 94db71faf53e1cd65db7356845e9ed2b
BLAKE2b-256 7b8b7e9d1ac564ae3c7bcd899984c03dc7d7e39769a9e48086cbf36639cb561f

See more details on using hashes here.

File details

Details for the file AdcircPy-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: AdcircPy-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 106.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for AdcircPy-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b9a0804e5cf3023d094506619b6a0bfc734028d85b9c387c623661b5d381397
MD5 d175d6003926e2c53926ee9277c10bfc
BLAKE2b-256 9a5a047ea75aea1271b096da225fd88705b251a50399faf776c318070e03ba04

See more details on using hashes here.

Supported by

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