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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pihm_utils-2.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 cb118da2a073d062f7ff99e1ac7111cc43e3f7fd2e678f22441f33eb6cf1a0f9
MD5 7a27e66c3ba946fa9dc9b98e858f2c39
BLAKE2b-256 cb77bfbaa1e58b7231db658a4309730f5a2cc20f0ec8c935e3fd8aa627fc103d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PIHM_utils-2.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8aa224368d9ecef9141e2e684af98657dcb7e5854c1db3fefd6a99a0e230b084
MD5 ada18ae0a372152e2ef8f71085fd1ca3
BLAKE2b-256 5122431aa9fe4bbef3df8fabf89b47750e6037c50a11ead3960ca3e6a4e53e16

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