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 interactive 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.1.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.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pihm_utils-2.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 fe4304201e44ef002f5bc7955ce4915050ca60f945155c764c0245d1301576f6
MD5 b113695a088c1458098f0edeed11669c
BLAKE2b-256 8ed0a22cc9dce32ee63a9fc94d550b90dc2e879a77838f72fc29b3819f3e69aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PIHM_utils-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1661f320ff75a044324f35e8b5ac98e09c851a28fe185ab43d6f2d45d3b55d69
MD5 087cc7498823c72975d05658e4c491ec
BLAKE2b-256 9bf335e96e6e44d6eda13c39470a5d182ad5f876aa7b95a1993086b5b2f99b94

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