Skip to main content

Pure Python generation of ICON-style triangular grids

Project description

ICON Grid Generator

Pure Python generation of ICON-style triangular grids.

The package provides spherical RxxByy grids, planar doubly periodic torus grids, limited-area grids extracted from generated global grids, and optional NetCDF export. It has no dependency on model runtimes or stencil frameworks.

Installation

From a local checkout:

python -m pip install -e .

Install optional NetCDF and xarray support with:

python -m pip install -e ".[netcdf,xarray]"

Usage

Generate a global spherical grid:

from grid_generator import GlobalGridSpec, generate_grid

grid = generate_grid(GlobalGridSpec(root=2, bisections=3))
print(grid.dims)

Generate a planar torus grid:

from grid_generator import TorusGridSpec, generate_grid

grid = generate_grid(TorusGridSpec(nx=32, ny=16, edge_length=1_000.0))
print(grid.metadata["grid_geometry"])

Extract a limited-area grid from a generated global parent:

from grid_generator import LimitedAreaGridSpec, generate_grid

spec = LimitedAreaGridSpec(
    "R02B03",
    lon_min=-20.0,
    lon_max=20.0,
    lat_min=35.0,
    lat_max=60.0,
    boundary_depth=2,
)
grid = generate_grid(spec, options={"max_cells": None})

For global grids, the compact RxxByy string remains available as shorthand:

grid = generate_grid("R02B03")

Write an ICON-style NetCDF file:

grid.to_netcdf("grid.nc")

NetCDF export requires the netcdf optional extra.

Release History

See CHANGELOG.md.

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

icon_grid_generator-0.1.0.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

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

icon_grid_generator-0.1.0-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file icon_grid_generator-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for icon_grid_generator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b2dd6d1120ff7381638388caaec169c7eea87fb42bf52d7d0c2bd98c666d75ef
MD5 b4c914f5277701c419f33b99717c23aa
BLAKE2b-256 ec60447c256907f80c8c832fceadb2ffb528b0c8c2a4dab8df80b0f15a90d767

See more details on using hashes here.

Provenance

The following attestation bundles were made for icon_grid_generator-0.1.0.tar.gz:

Publisher: release.yml on ofuhrer/icon-grid-generator

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

File details

Details for the file icon_grid_generator-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for icon_grid_generator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bde18984b1f679dd63a69a0e9149f4cd39cde3f87ef48db44f8831e4ed359bae
MD5 ed9a17a34ebc32293f8de44b599d91f1
BLAKE2b-256 80d6904dcd141b53796ac261ce0d0e31d4e4dc4e27ffb4eca4608714f34e0b4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for icon_grid_generator-0.1.0-py3-none-any.whl:

Publisher: release.yml on ofuhrer/icon-grid-generator

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