mdsview

Browse, plot, and compare MITgcm MDS (.data/.meta) binary output. CLI for clusters, optional GUI for your laptop or PC.

Install

pip install mdsview              # CLI (headless)
pip install "mdsview[gui]"       # + desktop GUI

Requires Python 3.9+, NumPy, matplotlib, MITgcmutils, cmocean, Pillow, and netCDF4 (for export).

Quick start

mdsview info -d /path/to/run
mdsview plot -v T -i 480 -l 4 -d /path/to/run
mdsview plot -v T -i 480 -l 4 --save-figure t.png --no-show
mdsview gui -d /path/to/run

-d is the run directory. -v is the field name (T, S, Eta, …). Run mdsview COMMAND --help for options.

CLI highlights

# Diff two snapshots (one level at a time)
mdsview diff -v T --later 2520 --earlier 0 -l 20 --plot --no-show

# Cross-run diff (later -d, earlier --dir-b)
mdsview diff -v T --later 2520 --earlier 2520 -l 20 -d /warm --dir-b /ref

# NetCDF export (T and S must share the same MDS shape)
mdsview export -v T,S -o run.nc --iterations all --levels 0

# Subset to a smaller MDS folder
mdsview extract -v T -o subset/ --iterations 0:1200:120 --levels 0:10

# Time series with plot + CSV
mdsview timeseries -v T -l 4 --iterations all --at 40,30 -o point.csv

GUI

mdsview main window
Catalog, field plots, grid overlay, playback, and GIF export. Use the CLI for diff and export.

Features

Sample data

mdsview generate-sample -o sample_data --preset demo

The repository includes a bundled sample/ directory for quick tests.