gmpas
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gmpas-0.4.3.tar.gz.
File metadata
- Download URL: gmpas-0.4.3.tar.gz
- Upload date:
- Size: 193.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68812e0dec273593d7eb8db8407f6872643d2262ecff3391fbab77d8dbc918ad
|
|
| MD5 |
12457ab9787e8d82c31fe5b742145cc3
|
|
| BLAKE2b-256 |
d17d6b6e7b57694c1dfabd431adf690f3aed86ccea8d1fec73806c8360fbd680
|
File details
Details for the file gmpas-0.4.3-py3-none-any.whl.
File metadata
- Download URL: gmpas-0.4.3-py3-none-any.whl
- Upload date:
- Size: 128.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53b3f87cec018107222f96da16615d2b329cb5f9f3803dd73f1eb5bceea98a22
|
|
| MD5 |
afdd1fecca5c0e32ba045ca3293cb2ae
|
|
| BLAKE2b-256 |
b2841d5227885ea2dfd4521c51af1f1f7cba847e44503991684660a6602c08e5
|