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, and 4.2.0 are tested and supported. Any version between 3.6 and 4.2.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.4.3.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

xnemogcm-0.4.3-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xnemogcm-0.4.3.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.1 Linux/6.5.0-1017-azure

File hashes

Hashes for xnemogcm-0.4.3.tar.gz
Algorithm Hash digest
SHA256 246dd1d2bcd1f9a4927d6a6e698701038605d1f633a59a750b67d0e03ec3b208
MD5 cc12db934e235237637843a4f808a23e
BLAKE2b-256 d04a4f8c7ad93b93b644f5ee39dd195c58df2de749751424ecc82e19966b8cdd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for xnemogcm-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7b5604823202929c7e61aa5f8f7f45e8d57d38bc688ac8ccad8c518e2629a72a
MD5 c7f356bf1b0f746225e6f0f622155b6c
BLAKE2b-256 f3c8de83de4c72724169f4230a5f277e3d5681c43d0a7655a52c91ec0dc9b2a9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page