Skip to main content

Utilities for working with non-CF grid datasets

Project description

emsarray

Documentation Status

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

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 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.1.0a1.tar.gz (202.7 kB view details)

Uploaded Source

Built Distribution

emsarray-0.1.0a1-py3-none-any.whl (67.6 kB view details)

Uploaded Python 3

File details

Details for the file emsarray-0.1.0a1.tar.gz.

File metadata

  • Download URL: emsarray-0.1.0a1.tar.gz
  • Upload date:
  • Size: 202.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for emsarray-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 ff9660f8952cf9692f7e664ed1624e8cf78fb923b0377b847c217b1e298170ef
MD5 193f73d7475dafb5ffc230b74e379ac3
BLAKE2b-256 9dd52d300e0d2b5a22068ceede8822db87da22bc1a568ab1d941bac99975e346

See more details on using hashes here.

File details

Details for the file emsarray-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: emsarray-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 67.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for emsarray-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 69458989faf528dfdc4726830864d85b62b5b17ebf04f44d3f334559e993329c
MD5 1f2cb5f00e85525aeb39e52826827a11
BLAKE2b-256 6538a1d8d8ea5c1b9d613d4941f6459e25f2368dc770dfee99bb83d143611b3f

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