Skip to main content

Interface to open NEMO global circulation model output dataset and create a xgcm grid.

Project description

xnemogcm

DOI python versions ci documentation status pypi anaconda badge Project Status: Active – The project has reached a stable, usable state and is being actively developed. pyOpenSci

Interface to open NEMO ocean global circulation model output as an Xarray Dataset and create a xgcm grid. NEMO 3.6, 4.0, 4.2.0, and 5.0 are tested and supported. Any version between 3.6 and 5.0 should work, but in case of trouble, please open an issue.

If you wish to contribute but don't have a github account, send me an email with your questions or comments: romain [dot] caneill [at] ens-lyon [.] org

Installation

For conda

conda install --channel conda-forge xnemogcm

for pip

pip install xnemogcm

Usage

from pathlib import Path
from xnemogcm import open_nemo_and_domain_cfg

ds = open_nemo_and_domain_cfg(
    nemo_files='/path/to/output/files',
    domcfg_files='/path/to/domain_cfg/mesh_mask/files'
)

# Interface with xgcm
from xnemogcm import get_metrics
import xgcm
grid = xgcm.Grid(ds, metrics=get_metrics(ds), periodic=False)

The full documentation is hosted online: https://xnemogcm.readthedocs.io/

Differences with existing tools

There exist tools in Fortran that ship with NEMO that are used to create domain files, input fields, etc. They are however more used to produce configurations with the necessary input files, than to analyse the outputs. So there is only one overlap with xnemogcm, which is recombining the mesh_mask / domaincfg files, when they have been outputted by different processors.

NEMO output files are outputted as netcdf so they can directly be opened by xarray. However, what is missing is all grid information in the shape needed by xgcm (COMODO convention). To solve this problem, another python package exists: xorca. However, xorca is not developed any more and is less flexible than xnemogcm. xnemogcm is meant to replace xorca, in addition to extending its functionality.

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

xnemogcm-0.5.0.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

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

xnemogcm-0.5.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file xnemogcm-0.5.0.tar.gz.

File metadata

  • Download URL: xnemogcm-0.5.0.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.1 Linux/6.8.0-1017-azure

File hashes

Hashes for xnemogcm-0.5.0.tar.gz
Algorithm Hash digest
SHA256 68e9d91e756cf12d6aa07268ac4dc81fc64ef3cc1051be5dff54d0c9dc51392a
MD5 46fff047641306b807bc69f6ecc57df0
BLAKE2b-256 06f8fd75ed537a31e373228c9e3db41d9b31d62f37868a16b7dda429fd97a14b

See more details on using hashes here.

File details

Details for the file xnemogcm-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: xnemogcm-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.1 Linux/6.8.0-1017-azure

File hashes

Hashes for xnemogcm-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 197402933655b41c6080021a1f135d27da093d5c66c15a74ead3903d8b11e85c
MD5 f10ce170b867e3579e4aa0b1d592d3ec
BLAKE2b-256 a14561e2bd73d4ffffafda28c84e4541fb64ff5db52a70182b166b21760ab250

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