Skip to main content

Python scripts to read MM-PIHM input and output files

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pihm_utils-2.0.3.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PIHM_utils-2.0.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file pihm_utils-2.0.3.tar.gz.

File metadata

  • Download URL: pihm_utils-2.0.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for pihm_utils-2.0.3.tar.gz
Algorithm Hash digest
SHA256 3f1277cc1d1af506831cd0f41f4ca6d4c6a705fde2527ae62176723458dc6cc1
MD5 3b42f746e752d8a031be463ba80ba5b4
BLAKE2b-256 e225e755cc40b97d8fc07960b7f37e834f666b147cc0dba129446a92473cb8ff

See more details on using hashes here.

File details

Details for the file PIHM_utils-2.0.3-py3-none-any.whl.

File metadata

  • Download URL: PIHM_utils-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for PIHM_utils-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b713615ee0bf4defffcc174878d158900d3aadeb231d573d65ff399f2047f22e
MD5 23e8bd93e4a0ddf3e089ac2f2a79bc2d
BLAKE2b-256 2310abe1041e99d0e4d41f147f20623a875fd26dbd210a0fe2eddbdd69eae8d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page