Skip to main content

xarray extension that supports multiple geometry conventions

Project description

emsarray

Binder Documentation Status Conda Version

The emsarray package provides a common interface for working with the many model geometry conventions 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
from shapely.geometry import Point

dataset = emsarray.tutorial.open_dataset('gbr4')
capricorn_group = Point(151.869, -23.386)
point_data = dataset.ems.select_point(capricorn_group)

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

A number of operations provide further functionality to manipulate datasets, export geometry, and select subsets of data:

from emsarray.operations import geometry
geometry.write_geojson(dataset, './gbr4.geojson')
geometry.write_shapefile(dataset, './gbr4.shp')

Links

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 .[testing]

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

The documentation for the current stable version of emsarray is available on Read The Docs.

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.10.0.tar.gz (102.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

emsarray-0.10.0-py3-none-any.whl (106.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: emsarray-0.10.0.tar.gz
  • Upload date:
  • Size: 102.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for emsarray-0.10.0.tar.gz
Algorithm Hash digest
SHA256 c1f6e2fb498f6b293a17ea483f2fe6df4614fed1b9fe6c26ad3edc46feac61ee
MD5 26c6019985a07a3506bcbeb6c1c9faae
BLAKE2b-256 f11f0f6574770bb84a75c9de20b425128f027efce67e852ea428fd67e61781bb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: emsarray-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 106.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for emsarray-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f84b6e73ca915fa72666fdc4b63b35db1bc3476dd92d3e0fa07b3ba164bc27d9
MD5 4e194ae11de4490effeb670380eefea9
BLAKE2b-256 9b6ca93b020dde7bcfa8f90353c4df8809de543fd3b17f8e36e1dff431041b2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page