PyFlowline: a mesh-independent river network generator for hydrologic models.
Please refer to the quickstart documentation for details on how to get started using the PyFlowline package.
PyFlowline is mesh independent, meaning you can apply it to both structured
and unstructured mesh systems
This package generates the mesh cell-based conceptual river networks using the following steps:
Flowline simplification
: PyFlowline checks the vector dataset and corrects undesired flowlines, such as braided rivers.Mesh generation
: PyFlowline generates structured meshes (e.g., rectangle, hexagon) or imports user-provided unstructured meshes into the PyFlowline-compatible GEOJSON format.Topological relationship reconstruction
: PyFlowline reconstructs the topological relationship using the mesh and flowline intersections.PyFlowline depends on the following packages
numpy
gdal
netCDF4
PyFlowline also has three optional dependency packages
cython
for performance matplotlib
for visualizationcartopy
for visulizationsimplekml
for Google Earth KML supportPlease refer to the official documentation for details on how to install the PyFlowline package.
We provide several examples in the examples
folder to demonstrate the model capability. We also recommend starting with the notebooks/mpas_example.ipynb
notebook, after following the Quickstart and Installation instructions.
This work was supported by the Earth System Model Development program areas of the U.S. Department of Energy, Office of Science, Office of Biological and Environmental Research as part of the multi-program, collaborative Integrated Coastal Modeling (ICoM) project and the Interdisciplinary Research for Arctic Coastal Environments (InteRFACE) project.
This research was supported as part of the Next Generation Ecosystem Experiments-Tropics, funded by the U.S. Department of Energy, Office of Science, Office of Biological and Environmental Research at Pacific Northwest National Laboratory. The study was also partly supported by U.S. Department of Energy Office of Science Biological and Environmental Research through the Earth and Environmental System Modeling program as part of the Energy Exascale Earth System Model (E3SM) project.
This research was supported by the Next Generation Ecosystem Experiments-Tropics project, funded by the U.S. Department of Energy, Office of Science, Office of Biological and Environmental Research at Pacific Northwest National Laboratory.
BSD 3-Clause License
Copyright © 2022, Battelle Memorial Institute
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Other than as used herein, neither the name Battelle Memorial Institute or Battelle may be used in any form whatsoever without the express written consent of Battelle.
Several publications describe the algorithms used in PyFlowline
in detail. If you make use of PyFlowline
in your work, please consider including a reference to the following:
Liao et al., (2023). pyflowline: a mesh-independent river network generator for hydrologic models. Journal of Open Source Software, 8(91), 5446, https://doi.org/10.21105/joss.05446
Liao. C. Cooper, M (2022) Pyflowline: a mesh-independent river network generator for hydrologic models. Zenodo. https://doi.org/10.5281/zenodo.6407298
Liao, C., Zhou, T., Xu, D., Cooper, M. G., Engwirda, D., Li, H.-Y., & Leung, L. R. (2023). Topological relationship-based flow direction modeling: Mesh-independent river networks representation. Journal of Advances in Modeling Earth Systems, 15, e2022MS003089. https://doi.org/10.1029/2022MS003089