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 .
plot_mesh /path/to/hgrid.gr3 --plot-boundaries --plot-elements
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'))
"
from pyschism.mesh import Hgrid
hgrid = Hgrid.open('hgrid.gr3')
hgrid.make_plot(show=True)
# 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)
# 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: Jaime.Calzada@noaa.gov