Skip to content

MITgcm/xmitgcm

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0e330f2 · May 2, 2019
Mar 28, 2019
May 2, 2019
Oct 27, 2015
May 2, 2019
Jul 17, 2018
Oct 12, 2016
Jul 23, 2015
Feb 21, 2018
Mar 28, 2019
Oct 12, 2016
Jul 30, 2018
Feb 14, 2017
May 1, 2019
Jan 30, 2016
Jul 17, 2018

Repository files navigation

xmitgcm: Read MITgcm mds binary files into xarray

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.

Links

Installation

Requirements

xmitgcm is compatible with python 3 and python 2.7. It requires xarray (>= version 0.8.2) and dask (>= version 0.11.2). 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/xgcm/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 opean 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.