Skip to main content

A collection of tools for converting HDF5 model files to other mesh/model formats

Project description

H5GEARS

A collection of Python tools for converting HDF5 model/mesh files to other mesh/model formats.

Installation

pip install h5gears

Or from source:

pip install -e .

Features

  • h52nc: Convert an SRH-2D mesh file (.h5) to a Delft3D FM (D-Flow FM) UGRID net.nc mesh file
  • h52xyz: Extract node coordinates from an SRH-2D mesh file (.h5) to a <MeshName>_nodes.csv file

Usage

Command-line

# List all available commands
h5gears-info

# Convert every mesh in a single SRH-2D mesh file
h52nc -i mesh.h5

# Convert every mesh in all matching files (glob expansion supported)
h52nc -i *.h5

# Convert only a specific mesh by name
h52nc -i mesh.h5 -n Mesh001

# Write outputs to a specific directory, including node elevation (z)
h52nc -i mesh.h5 -o out/ -d 3

# Extract node coordinates from every mesh in a single SRH-2D mesh file
h52xyz -i mesh.h5

# Extract only a specific mesh by name
h52xyz -i mesh.h5 -n Mesh001

# Write outputs to a specific directory, including node elevation (z)
h52xyz -i mesh.h5 -o out/ -d 3

Python API

from h5gears import h52nc

# List the mesh names contained in an SRH-2D file
h52nc.list_meshes("mesh.h5")

# Convert every mesh in a file to net.nc, returning the output paths
h52nc.convert_file("mesh.h5", out_dir="out/", dim=2)

# Extract node coordinates from every mesh in a file to CSV, returning the output paths
from h5gears import h52xyz
h52xyz.convert_file("mesh.h5", out_dir="out/", dim=2)

Notes

  • h52nc reads mesh geometry from the 2DMeshModule group of SRH-2D HDF5 mesh files (node coordinates and element connectivity) and writes it out as a UGRID-style net.nc file compatible with Delft3D FM / D-Flow FM.
  • h52xyz reads node coordinates from the same 2DMeshModule group and writes a <MeshName>_nodes.csv file with columns NodeID,x,y (or NodeID,x,y,z with -d 3), one row per 1-indexed node id.
  • By default, every mesh found in an input file is converted; use -n/--name to restrict conversion to specific mesh names.
  • Output files are written alongside each input file by default; use -o/--outdir to choose a different destination directory.

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

h5gears-0.2.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

h5gears-0.2.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file h5gears-0.2.0.tar.gz.

File metadata

  • Download URL: h5gears-0.2.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for h5gears-0.2.0.tar.gz
Algorithm Hash digest
SHA256 15c078e176f55bd01ad94d93bf5d58c05dff6bcc252750ba56355c60270b423e
MD5 f22d46f2bdac64263cc23d2b8810624f
BLAKE2b-256 56bc5b1a91c8e8a3b175260f439a305c176bcc4a557c315a7d3966922a41ac82

See more details on using hashes here.

Provenance

The following attestation bundles were made for h5gears-0.2.0.tar.gz:

Publisher: publish.yml on AaronOET/h5gears

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file h5gears-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: h5gears-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for h5gears-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0efd75fdfab2b643aae31a6655a4cb36ccac51bbcb17a51d21054beff9aeddf3
MD5 9f9cce5e5a41426ef7d8b6cc3d251c9b
BLAKE2b-256 48efbad949fd1b96f0fd93bfc3b1330428e6fae44e328e40b7bf9810690dd1bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for h5gears-0.2.0-py3-none-any.whl:

Publisher: publish.yml on AaronOET/h5gears

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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