A python package for model visualization.
Project description
ModVis
A python package for model visualization.
- Free software: GPL license
- Documentation: https://pinshuai.github.io/modvis
Features
- Visualize model outputs from hydrologic models including ATS, PFLOTRAN, and etc.
- Plot unstructured meshes with variables such as groundwater table, saturation, and evapotranspiration.
- Evaluate model performance using different metrics.
Installation
ModVis is available on PyPI. To install, run the following command:
pip install modvis
If you want to run the latest version of the code, you can install from git:
pip install -U git+https://github.com/pinshuai/modvis.git
Alternatively, if you want to debug and test the code, you can clone the repository and install from source:
git clone https://github.com/pinshuai/modvis.git
cd modvis
pip install -e .
Quick start
Plot variables on triangular meshes:
import modvis.ats_xdmf as xdmf
import modvis.plot_vis_file as pv
# import visdump file
surface_vis = xdmf.VisFile(model_dir='.', domain='surface')
subsurface_vis = xdmf.VisFile(model_dir='.', domain=None, columnar=True)
# plot surface ponded depth
pv.plot_surface_data(surface_vis, var_name="surface-ponded_depth", log=True,
time_slice="2019-05-01", vmin=0.01, vmax=4)
# plot subsurface saturation. Note layer index is ordered from top to bottom (0--top).
pv.plot_layer_data(subsurface_vis, var_name = "saturation_liquid",
layer_ind = 0, time_slice= 0,
cmap = "coolwarm")
Plot variables on mixed-element meshes:
import modvis.ats_xdmf as xdmf
import modvis.plot_vis_file as pv
# import visdump file
surface_vis = xdmf.VisFile(model_dir='.', domain='surface', mixed_element=True)
subsurface_vis = xdmf.VisFile(model_dir='.', domain=None, mixed_element=True)
# plot surface ponded depth
pv.plot_surface_data(surface_vis, var_name="surface-ponded_depth",
time_slice="2019-05-01", mixed_element=True)
# plot subsurface saturation. Note layer index is ordered from top to bottom (0--top).
pv.plot_layer_data(subsurface_vis, var_name = "saturation_liquid",
layer_ind = 0, time_slice= 0, mixed_element=True)
Examples
Jupyter notebook examples can be found under examples/notebooks
Credits
This work is supported by LDRD funding from PNNL, with continuing support from the Utah Water Research Laboratory.
This package was created with Cookiecutter and the giswqs/pypackage project template.
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
File details
Details for the file modvis-0.0.9.tar.gz.
File metadata
- Download URL: modvis-0.0.9.tar.gz
- Upload date:
- Size: 67.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c9e27dd7409ce2b23eb6b3e5d1385a79f3326bacb78650304f4dfaf6b51e53c
|
|
| MD5 |
b405043ca7b7901638a2dee5d15a9f8a
|
|
| BLAKE2b-256 |
00486dc2e22066b73b26d9cd20850de1060eda5d6512043bc94585c5ad40047f
|