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 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/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 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.

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.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

xmitgcm-0.5.0-py3-none-any.whl (97.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xmitgcm-0.5.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0

File hashes

Hashes for xmitgcm-0.5.0.tar.gz
Algorithm Hash digest
SHA256 f6caa8f0b077341f2870a5f0b95c9c49e5cec89e027ebb4105ddf7a25f39a8c3
MD5 b778838cfc4e5a371a19f51fe292c6f8
BLAKE2b-256 43ff8cbc99dff2199cc216a54cfe620d4405233abab5693e066e6188e378a88c

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: xmitgcm-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 97.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0

File hashes

Hashes for xmitgcm-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 644c7b14dd4c511fa866d2e8357248540eba9e37c1c08eb6bfe3a59b28ebd9f3
MD5 f1c75be28a2e7674207f44a62e4a1f52
BLAKE2b-256 cdb9ded4572d601212e43f830148d9abe9e736af4359a48e1b3f8a1de6429675

See more details on using hashes here.

Provenance

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