Skip to main content

A collection of tools for working with NetCDF files

Project description

NCFTOOLS

A collection of Python tools for working with NetCDF files.

Installation

pip install -e .

Features

  • meshinfo: Display mesh information from FlowFM NetCDF files (node/face/edge counts, element types, spatial extent)
  • nc2shp: Convert a UGRID-compliant NetCDF mesh file to ESRI Shapefiles
  • transzone1: Build a transition zone from triangle mesh faces and select all intersecting faces
  • transzone2: Extract the core transition zone — faces fully within the shrunk zone

Usage

Check version

ncftools --version

List all available commands

ncftools-info

meshinfo

Display mesh information from a FlowFM NetCDF file.

meshinfo -i FlowFM_net.nc
meshinfo -h

nc2shp

Convert a NetCDF mesh file to ESRI Shapefiles. Outputs {stem}_faces.shp and {stem}_dissolved.shp in the output directory.

nc2shp -i FlowFM_net.nc
nc2shp -i mesh.nc -o output --crs EPSG:4326
nc2shp -i mesh.nc -q

transzone1

Buffer triangle mesh faces by +1 m to form a transition zone, then select all faces that intersect it. Outputs trans_zone.shp and trans_zone_extend.shp.

Triangles are identified from the type attribute column when present; otherwise they are detected automatically by vertex count (closed rings with 3 unique vertices).

transzone1 -i SHP_NC/FlowFM_net_faces.shp
transzone1 -i SHP_NC/FlowFM_net_faces.shp -o SHP_TRANS
transzone1 -i SHP_NC/FlowFM_net_faces.shp -q

transzone2

Shrink trans_zone_extend.shp (output of transzone1) by −1 m and select faces fully within the core zone. Outputs trans_zone_core.shp.

transzone2 -i SHP_NC/FlowFM_net_faces.shp -z SHP_TRANS/trans_zone_extend.shp
transzone2 -i SHP_NC/FlowFM_net_faces.shp -z SHP_TRANS/trans_zone_extend.shp -o SHP_TRANS
transzone2 -i SHP_NC/FlowFM_net_faces.shp -z SHP_TRANS/trans_zone_extend.shp -q

Python API

from ncftools import meshinfo

meshinfo.show_mesh_info("FlowFM_net.nc")

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

ncftools-0.6.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

ncftools-0.6.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file ncftools-0.6.1.tar.gz.

File metadata

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

File hashes

Hashes for ncftools-0.6.1.tar.gz
Algorithm Hash digest
SHA256 c9827f407a6155a441379aaf5aa02087393c34760bb9584e37bf8c63e20ee32d
MD5 c411cfda34d2f3f746212f063442c310
BLAKE2b-256 89ae9bfef476bacf24fc26a86d964ae842894adfddf25edf8e8e181aeb02e6ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for ncftools-0.6.1.tar.gz:

Publisher: publish.yml on AaronOET/ncftools

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

File details

Details for the file ncftools-0.6.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for ncftools-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e53e67e3382ed6c320903306f57430f4024077c007ff070183f5a81238eeecbb
MD5 da5300571252d00d5b7ba48858f5d2d4
BLAKE2b-256 6f7fc21028a0557b4c616a658ffa6c29e2591ab298135611fc9862a104218ccb

See more details on using hashes here.

Provenance

The following attestation bundles were made for ncftools-0.6.1-py3-none-any.whl:

Publisher: publish.yml on AaronOET/ncftools

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