Skip to main content

gmpas

tests version python license

Fast plotting of MPAS output on its own native mesh — no regridding, so variable resolution is preserved exactly as the model carries it. Plus the other end of the pipeline: designing a mesh, building it with JIGSAW, and looking at either before or after it exists.

import gmpas

ds = gmpas.open_mpas("diag.2019-09-01_00.00.00.nc", mesh="maritime.region.nc")

ds.mpas.plot("mslp")        # cell field, filled Voronoi polygons
ds.mpas.plot("u")           # edge field, drawn on the cell faces themselves
ds.mpas.plot_mesh()         # where the mesh actually refines, in km

mesh= may be omitted when the file carries its own mesh information, or when a mesh file with a matching cell count sits beside it.

Installation

conda env create -f environment.yml && conda activate gmpas && pip install -e . --no-deps

Pure pip works too where wheels exist:

pip install -e ".[dev]"

Two workflows need external programs, which pip cannot provide. Conservative remapping needs ESMF (conda install -c conda-forge esmf nco); mesh generation needs JIGSAW and, for the final step, MPI and PnetCDF. Skip both if you only plot and view.

Check it landed:

gmpas --version && pytest -q

Full detail, including the extras and what each one pulls in: docs/installation.md.

Usage

gmpas info          history.2012-02-25_12.00.00.nc
gmpas plot          history.2012-02-25_12.00.00.nc precipw -o pw.png
gmpas view          /path/to/run/
gmpas remap         history.*.nc -o out/
gmpas prep view     mesh.nc
gmpas prep hfun     hfun.py --check
gmpas prep generate hfun.py -o mesh/     # needs $JIGSAWDIR and $MKGRIDFILE

Any path may be a file, a directory, or a glob; a directory or glob is read as one time series across files, which is how MPAS writes output. Running gmpas with no arguments prints the whole list with examples.

Everything except prep is postprocessing — it opens a run and renders, remaps or exports it. prep is the other end, for work that happens before there is any output.

Documentation

Why gmpas exists the problem with lat-lon tooling, and why this is fast
Installation conda, pip, extras, and the external programs
Command line every command and its flags
In a notebook the accessor, and using the pieces directly
Preprocessing prep view, prep hfun, prep generate — mesh design and JIGSAW
Conservative remapping the whole terminal workflow, and two MPAS traps
On a cluster port forwarding, and the two variables that matter
Configuration GMPAS_CACHE_DIR and GMPAS_DATA_DIR
Examples ready-to-edit hfun.py templates
Tests what the suite covers
Layout what lives in which module
Differences from the MCP server what changed on the way to a package
Status what is implemented and what is not

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gmpas-0.4.2.tar.gz (155.9 kB view details)

Uploaded Source

Built Distribution

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

gmpas-0.4.2-py3-none-any.whl (105.0 kB view details)

Uploaded Python 3

File details

Details for the file gmpas-0.4.2.tar.gz.

File metadata

  • Download URL: gmpas-0.4.2.tar.gz
  • Upload date:
  • Size: 155.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for gmpas-0.4.2.tar.gz
Algorithm Hash digest
SHA256 ed02c387198aff20c44a59da444e5465716e52901d0051d400c4fd6646c44102
MD5 85b14e1d36a9ffa9ae2841a96bd1d417
BLAKE2b-256 d865a6603bfa9f596abf52b9c968d1276fa7e06b2b3727d52dbb771ae9fcc3fe

See more details on using hashes here.

File details

Details for the file gmpas-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: gmpas-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 105.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for gmpas-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 40eec2b966d8a3a40d6db5eaa4d361c2055cc4c3136a2e0064b9e0db47895e8d
MD5 683b1c545fd2b88aa2a55cc73d0ad22b
BLAKE2b-256 22dcd96760044e8fee30ebf159ae2c97b05abc9f5674921cb70224672082acbf

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 Sentry Error logging StatusPage Status page