Skip to content

PSUmodeling/PIHM-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PIHM-utils

Library for reading MM-PIHM input and output files.

Installation

To install:

pip install PIHM-utils

Usage

The read_grid function reads domain setup from MM-PIHM .mesh and .riv input files:

from pihm import read_grid

element_df, river_df, node_df = read_grid(pihm_dir, simulation)

pihm_dir is the path to the MM-PIHM directory, which should contain input and output directories, and simulation is the name of the simulation. element_df, river_df, and node_df are pandas.DataFrames that contain grid elements, river segments, and grid nodes information.

The read_output function reads MM-PIHM simulation output files:

from pihm import read_output

desc, df = read_output(pihm_dir, simulation, outputdir, var)

desc is strings containing description and unit of the specific output variable, df is a pandas.DataFrame containing the simulation output. outputdir is the name of the output directory, and var is name of output variable. For a complete list of available output variables, please refer to the MM-PIHM User's Guide.

Examples

Please check out the Python notebook for a visualization example.

About

Python scripts to read MM-PIHM output files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages