xarray extension that supports multiple geometry conventions
Project description
emsarray
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)
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 . -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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file emsarray-0.4.0.tar.gz
.
File metadata
- Download URL: emsarray-0.4.0.tar.gz
- Upload date:
- Size: 77.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb8d00a103934b325fb3b18ac126998f932c4412dcd4fe6c2df0fb1cad2095fa |
|
MD5 | 6722cdeb163b478722f1e6b803107e3c |
|
BLAKE2b-256 | 9ef10c7da385f404c5218172d964748d97b4cb3dbd7eb36af64646d39a61fba0 |
File details
Details for the file emsarray-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: emsarray-0.4.0-py3-none-any.whl
- Upload date:
- Size: 83.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2519537e8f942a36c49ab54816221042cce7dff51d51a4ec50381489ffba15b4 |
|
MD5 | 9b7fa5d0d37d5407209b2f3e86189197 |
|
BLAKE2b-256 | d41403bd8cfbf8c7eb60eafad7c1250919d8fb3fb80b94391d00fc11b772f203 |