Skip to main content

Python module for working with geophysical data from atmospheric and ocean models

Project description

Nereus

Fast visualization and diagnostics for unstructured climate model data

CI PyPI version Documentation Status License: MIT Python 3.10+

Nereus is a Python library for quick data exploration of unstructured atmospheric and ocean model output in Jupyter notebooks. Plot global maps, compute diagnostics, and visualize transects from models like FESOM, ICON, and others — all with minimal code.

✨ Features

  • One-line plotting — Visualize unstructured mesh data on publication-quality maps
  • Fast regridding — KD-tree based interpolation with automatic caching
  • Multiple projections — Robinson, Mollweide, stereographic, orthographic, and more
  • Ocean & sea ice diagnostics — Ice area/volume/extent, heat content, volume-weighted means
  • Vertical transects — Cross-section plots along great circle paths
  • Hovmöller diagrams — Time-depth and time-latitude visualizations
  • Region masking — Built-in support for ocean basins, NINO regions, MOC basins

Installation

pip install nereus

Quick Start

import nereus as nr
import xarray as xr

# Load your unstructured model output
ds = xr.open_dataset("model_output.nc")
mesh = xr.open_dataset('model_grid.nc')

# Plot sea surface temperature in one line
fig, ax, interp = nr.plot(
    ds.temp.isel(time=0, nz1=0),
    mesh.lon, mesh.lat,
    projection="rob",
    cmap="RdBu_r",
    vmin=-2, vmax=30
)

# Reuse interpolator for another variable
fig, ax, _ = nr.plot(ds.salt.isel(time=0, nz1=0), ds.lon, ds.lat, interpolator=interp)

Regridding

# Regrid to a regular 0.5° grid
regridded, interp = nr.regrid(data, lon, lat, resolution=0.5)

# Reuse interpolator for efficiency
regridded_salt, _ = nr.regrid(salinity, lon, lat, interpolator=interp)

Working with FESOM

# Load mesh once, reuse for multiple operations
mesh = nr.fesom.load_mesh("/path/to/mesh/")

# Compute sea ice extent
extent = nr.ice_extent(ds.a_ice, mesh.area, threshold=0.15)

# Ocean heat content (total in Joules)
ohc = nr.heat_content(ds.temp, mesh.area, mesh.layer_thickness)

# Ocean heat content map (J/m² at each point)
ohc_map = nr.heat_content(ds.temp, mesh.area, mesh.layer_thickness, output="map")

# Volume-weighted mean temperature
mean_temp = nr.volume_mean(ds.temp, mesh.area, mesh.layer_thickness)

Vertical Transects

# Plot a transect from point A to point B
nr.transect(
    ds.temp,
    mesh.lon, mesh.lat, mesh.depth,
    start=(-30, -60),  # (lon, lat)
    end=(30, 60),
    cmap="thermal"
)

Supported Models

Model/mesh Status
FESOM2 ✅ Full support
ICON-O 🔧 In development
ICON-A 🔧 In development
HEALPix 📋 Planned

Documentation

📖 Full documentation: nereus.readthedocs.io

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

# Clone and install in development mode
git clone https://github.com/koldunovn/nereus.git
cd nereus
pip install -e ".[dev]"

# Run tests
pytest tests/

License

MIT License — see LICENSE for details.


Named after the Greek god of the sea, the "Old Man of the Sea."

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

nereus-0.2.1.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

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

nereus-0.2.1-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file nereus-0.2.1.tar.gz.

File metadata

  • Download URL: nereus-0.2.1.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for nereus-0.2.1.tar.gz
Algorithm Hash digest
SHA256 55190c4334d122262129165508e4c551fbe096c1c267a75c756f9c7aa421d763
MD5 57c828c4e2338ea07a745cdddd4948b7
BLAKE2b-256 c5cfb8f78d2c8b93f07537ff7dd759aaf93666c35fc66ac254cfd18b9e83e4c8

See more details on using hashes here.

File details

Details for the file nereus-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: nereus-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for nereus-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 46df0b58d37692692108f703478963511bc151f81fad9e1bd597a6065d524951
MD5 68b425d4263a77a76136c3d9bcff1f68
BLAKE2b-256 f2b994f2ce40a877eb4089c6512d2deed63849cd0b881b9aadde8918c758be52

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