Python package for working with SCHISM input and output files.
Project description
PySCHISM
A Python interface for SCHISM model runs.
Installation:
It is highly recommended that you run this software using a Python virtual environment, and that you use Python>=3.6 (preferrably, using the latest available Python version is encouraged). You may use conda or venv to satisfy this dependency.
To install, clone this repository, and navigate into it:
git clone https://github.com/schism-dev/pyschism
cd pyschism
Then make sure to activate the target Python environment (this step is not necessary if you chose not to use a virtual environment). After making sure your target environment is active, you can install the package using pip:
pip install .
If you are a developer, you may install in developer mode instead:
pip install -e .
Usage examples:
Using the CLI
Example 1: Full domain hgrid plot from the terminal.
plot_mesh /path/to/hgrid.gr3 --plot-boundaries --plot-elements
Using the Library
Hint: You can test the library functions from the command line (without having to write a .py file) by using python -c
and wrapping the commands between a pair of quotes, for example:
python -c "
from pyschism.mesh import Hgrid
print(Hgrid.open('/path/to/hgrid.gr3'))
"
Example 1: Full domain Hgrid plot:
from pyschism.mesh import Hgrid
hgrid = Hgrid.open('hgrid.gr3')
hgrid.make_plot(show=True)
Example 2: Write boundaries to shapefile
# open mesh as example above
from pyschism.mesh import Hgrid
hgrid = Hgrid.open('hgrid.gr3', crs="EPSG:3395") # For shapefile output, coordinate reference system should be specified.
hgrid.write_boundaries("/path/to/output/dir", overwrite=True)
Example 3: Write mesh to QGIS friendly format
# NOTE: 2dm files can be read by QGIS > 3.0
from pyschism.mesh import Hgrid
hgrid = Hgrid.open('hgrid.gr3')
hgrid.write("/path/to/output/file.2dm", fmt='2dm')
Questions, comments and suggestions are welcome. Please follow the instructions on the CONTRIBUTING.md
file for contributions. For bug reports and feature requests, please open an issue using the issue tracker.
Author contact: jrcalzada@wm.edu
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyschism-0.0.2.tar.gz
.
File metadata
- Download URL: pyschism-0.0.2.tar.gz
- Upload date:
- Size: 369.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35b1455317f68ce20d7cfebbae2efff72e1fc13e45f1625e943b63fa1bb91fa3 |
|
MD5 | 2a48ed7309b3670d56c29f4793c9742b |
|
BLAKE2b-256 | a75e26d86b0e0326a2d2217794a8ed40d7b5b636fe377ab664fcd5be7e77d214 |
File details
Details for the file pyschism-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: pyschism-0.0.2-py3-none-any.whl
- Upload date:
- Size: 121.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5625106745d3a9c5315316532563400285a7a3c7db0ddbe18a822eada7be70c |
|
MD5 | f736020d08436596e9b95a0afa167232 |
|
BLAKE2b-256 | 10dcc3743b79888022bc6e4cb0e708089781e365e5c2baad9a08f1fa7d2fa39a |