Skip to main content

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')

Examples

The examples/ directory contains examples of making many different plots. These are included in the documentation under 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

Metadata

Release files for emsarray 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for emsarray 1.0.0
File Size Uploaded
emsarray-1.0.0.tar.gz 99.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for emsarray 1.0.0
File Interpreter ABI Platform
emsarray-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 217.5 kB

Release files / emsarray-1.0.0.tar.gz

Download URL emsarray-1.0.0.tar.gz
Size 99.3 kB
Tags Source
SHA-256 checksum
How to use checksums
accb96a6f27128d8a61f66ca92938cdc1c0d9109548860ccefeaf338e07a7c43
BLAKE2b-256 checksum
How to use checksums
72293895b08c04483de7bc48af69393ad9486b106adc8bbad3a4c6fda01b2ebb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / emsarray-1.0.0-py3-none-any.whl

Download URL emsarray-1.0.0-py3-none-any.whl
Size 118.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10ac067b052634d43a05606460e14f4736c65d7cb6b77a47cdc855f759b5f8ac
BLAKE2b-256 checksum
How to use checksums
31ad23edacd8f3294f2ce172083003271bf7f3ecaeb14dc00b8adc1881eb66ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page