Skip to main content

Python scripts to read MM-PIHM input and output files

Project description

PIHMutils

Library for reading MM-PIHM input and output files.

Installation

To install:

pip install PIHM-utils

Usage

The read_mesh function reads mesh information from MM-PIHM .mesh input files:

from pihm import read_mesh

num_elem, num_nodes, tri, x, y, zmin, zmax = read_mesh(pihm_dir, simulation)

where num_elem is the number of triangular elements, num_nodes is the number of nodes, tri is an array of triangles consisted of nodes, x, y, zmin, and zmax are arrays of the x and y coordinates, and bottom and surface elevations of nodes, respectively. pihm_dir is the MM-PIHM directory, with input and output directories inside, and simulation is the name of simulation.

The read_river function reads river information from MM-PIHM .river input files:

from pihm import read_river

num_rivers, from_nodes, to_nodes, outlets = read_river(pihm_dir, simulation)

where num_rivers is the number of river segments, from_nodes and to_nodes are arrays of from and to nodes of river segments, and outlets is an array of river outlets.

The read_output function reads MM-PIHM simulation output files:

from pihm import read_output

sim_time, sim_val, varname, unit = read_output(pihm_dir, simulation, outputdir, var)

where sim_time is an array of simulation time steps, sim_val is an array of output values, and varname and unit are strings containing description and unit of the specific output variable. 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 script in the MM-PIHM code.

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-1.0.0.tar.gz (5.1 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-1.0.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file PIHM-utils-1.0.0.tar.gz.

File metadata

  • Download URL: PIHM-utils-1.0.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

File hashes

Hashes for PIHM-utils-1.0.0.tar.gz
Algorithm Hash digest
SHA256 14396995bbdd3bbb210193701054c0ff660be120de04da3f7a711931ba19e93e
MD5 bb8693df602e8773f444250c3d01e5ff
BLAKE2b-256 43f7d75fd5dcd39f4327634c88d541b689800320ec172c33df9629c9e8acffbb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PIHM_utils-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

File hashes

Hashes for PIHM_utils-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abb997464009bdef1ea2e01d68a91065b8ed30f3a7e885989aedb24a7f968475
MD5 aba5f58632b35043bf5ad6942b3581f6
BLAKE2b-256 1aa3a08cb5acc33535b012eb09b53fe0468aedb540e0a846d613dd46ff41742b

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