Skip to main content

Read MITgcm mds binary files into xarray

Project description

pypi package travis-ci build status code coverage documentation status DOI

xmitgcm is a python package for reading MITgcm binary MDS files into xarray data structures. By storing data in dask arrays, xmitgcm enables parallel, out-of-core analysis of MITgcm output data.

Installation

Requirements

xmitgcm is compatible with python >=3.7. It requires xarray (>= version 0.11.0) and dask (>= version 1.0). These packages are most reliably installed via the conda environment management system, which is part of the Anaconda python distribution. Assuming you have conda available on your system, the dependencies can be installed with the command:

conda install xarray dask

If you are using earlier versions of these packages, you should update before installing xmitgcm.

Installation via pip

If you just want to use xmitgcm, the easiest way is to install via pip:

pip install xmitgcm

This will automatically install the latest release from pypi.

Installation from github

xmitgcm is under active development. To obtain the latest development version, you may clone the source repository and install it:

git clone https://github.com/MITgcm/xmitgcm.git
cd xmitgcm
python setup.py install

Users are encouraged to fork xmitgcm and submit issues and pull requests.

Quick Start

First make sure you understand what an xarray Dataset object is. Then find some MITgcm MDS data. If you don’t have any data of your own, you can download the xmitgcm test repositories To download the some test data, run the shell commands:

$ curl -L -J -O https://ndownloader.figshare.com/files/6494718
$ tar -xvzf global_oce_latlon.tar.gz

This will create a directory called global_oce_latlon which we will use for the rest of these examples. If you have your own data, replace this with the path to your mitgcm files.

To open MITgcm MDS data as an xarray.Dataset, do the following in python:

from xmitgcm import open_mdsdataset
data_dir = './global_oce_latlon'
ds = open_mdsdataset(data_dir)

data_dir, should be the path (absolute or relative) to an MITgcm run directory. xmitgcm will automatically scan this directory and try to determine the file prefixes and iteration numbers to read. In some configurations, the open_mdsdataset function may work without further keyword arguments. In most cases, you will have to specify further details.

Consult the online documentation for more details.

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

xmitgcm-0.5.2.tar.gz (6.3 MB view details)

Uploaded Source

Built Distribution

xmitgcm-0.5.2-py3-none-any.whl (100.0 kB view details)

Uploaded Python 3

File details

Details for the file xmitgcm-0.5.2.tar.gz.

File metadata

  • Download URL: xmitgcm-0.5.2.tar.gz
  • Upload date:
  • Size: 6.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for xmitgcm-0.5.2.tar.gz
Algorithm Hash digest
SHA256 7dda45fdf6182a859f5c441cd5928a7c99d41c8bcea9fccf471b7011791b1131
MD5 95274879591f6193285288e435d3d17a
BLAKE2b-256 06bdf966993301ed8adcde36599ae0a80c673b96dc04b82d0d9035dd95071f3d

See more details on using hashes here.

File details

Details for the file xmitgcm-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: xmitgcm-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 100.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for xmitgcm-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b1df166111d49079b53b6e5925059daa2babef46445bc6350cdfbaf9603cd8b
MD5 e345c931f80660c2a547379531e40762
BLAKE2b-256 dbffadca3079aab6bf6aec0e0b259f3c5afbe0d1b3af83b53af5b165a9535b9e

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