Skip to content

MPAS-viewer: A Python package for an efficient visualization of the Spherical Centroidal Voronoi Tessellation mesh of MPAS-Atmosphere

License

Notifications You must be signed in to change notification settings

ElsevierSoftwareX/SOFTX-D-25-00729

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌐 MPAS-Viewer

A Python package for efficient visualization of the MPAS-Atmosphere unstructured mesh


🎯 Key Features

  • ⚡ Fast rendering on native unstructured MPAS mesh
  • 🌍 Supports both global and regional domains
  • 📦 Lightweight and easy to install (minimal dependencies)
  • 📈 Accurate representation of MPAS-A data without resampling
  • 🧩 Compatible with NetCDF outputs from MPAS-A
  • 💻 Portable across platforms (Linux, macOS, Windows)

📦 Installation

You can install MPAS-Viewer directly from GitHub:

uv add "mpasviewer @ https://github.com/jhbravo/mpasviewer.git"
pip install git+https://github.com/jhbravo/mpasviewer.git

🛠️ Prerequisites

To use MPAS-Viewer, you’ll need the following Python packages:

Optional (for remote access or cloud workflows):

  • fsspec — abstract file system layer (e.g. S3, GCS, HTTPS)
  • zarr — for chunked, compressed, cloud-optimized data

🧪 Examples of Use

Below are a few basic examples showing how to use MPAS-Viewer to load and visualize MPAS-Atmosphere data.


📈 Example 1: Load and Plot a Variable

# Initialize the main object by providing the mesh file (grid or static)
# and the diagnostic output data (single file or directory)
from mpasviewer import scvtmesh

mpasd = scvtmesh(
    grid_file='/path/to/some/file.grid.nc', 
    diag_list='/path/to/some/list/of/files/diag'
)

# Load dataset metadata and variable structure
mpasd.dataset()

# (Optional) Compute rain rate from output variables, if applicable
mpasd.rain_rate()


# Load the full dataset (with Dask support if enabled)
dta = mpasd.load()

# Plot a specific variable as a spatial map at a given time index
mpasd.show(dta, var_name='refl10cm_max', time_index='2021-09-02T00')

About

MPAS-viewer: A Python package for an efficient visualization of the Spherical Centroidal Voronoi Tessellation mesh of MPAS-Atmosphere

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%