Skip to main content

xarray extension that supports EMS model formats

Project description

emsarray

Binder Documentation Status Conda Version

The emsarray package provides a common interface for working with the many model formats used at CSIRO. It enhances xarray Datasets and provides a set of common operations for manipulating datasets.

To use, open the dataset using the emsarray.open_dataset() function and use the dataset.ems attribute:

import emsarray
import json

dataset = emsarray.tutorial.open_dataset('gbr4')
with open("geometry.geojson", "w") as f:
	json.dump(dataset.ems.make_geojson_geometry(), f)

Some methods take a DataArray as a parameter:

# Plot the sea surface temperature for time = 0
temp = dataset['temp'].isel(time=0, k=-1)
dataset.ems.plot(temp)

Plot of sea surface temperature from the GBR4 example file

Examples

Examples of using emsarray are available in the emsarray-notebooks repository. You can explore these notebooks online with Binder.

Developing

To get set up for development, make a virtual environment and install the dependencies:

$ python3 -m venv
$ source venv/bin/activate
$ pip install --upgrade pip>=21.3
$ pip install -e . -r continuous-integration/requirements.txt

Tests

To run the tests, install and run tox:

$ python3 -m venv
$ source venv/bin/activate
$ pip install --upgrade pip>=21.3 tox
$ tox

Documentation

To build the documentation, install the development requirements as above and invoke Sphinx:

$ make -C docs/ html

While updating or adding to the documentation, run the live target to automatically rebuild the docs whenever anything changes. This will serve the documentation via a livereload server.

$ make -C docs/ live

You can the view the docs at http://localhost:5500

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

emsarray-0.2.0.tar.gz (62.8 kB view details)

Uploaded Source

Built Distribution

emsarray-0.2.0-py3-none-any.whl (71.2 kB view details)

Uploaded Python 3

File details

Details for the file emsarray-0.2.0.tar.gz.

File metadata

  • Download URL: emsarray-0.2.0.tar.gz
  • Upload date:
  • Size: 62.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for emsarray-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9b2729753bd3dc57758889f1fc3b9c4ca3193f838aaef820b2a677e361b555f9
MD5 7432bdf70eec988201574bf12399f764
BLAKE2b-256 04800bf0f66081870b19fad0f455eb8f721c1b535bfb7328b54445607aac6fc7

See more details on using hashes here.

File details

Details for the file emsarray-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: emsarray-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 71.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for emsarray-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1edc3011899037941f2fec45b55757f590538972d991c476a0b6447929eadf62
MD5 cd391488b1e986c1766b91bf0e636249
BLAKE2b-256 a8398695a81b506f36460c00340eacabe51f11771e30b52c34a1a5baaa9a227a

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