Coastal Environment Modelling dataset helper
Contents
Coastal Environment Modelling dataset helper#
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 either xarray.open_dataset()
or emsarray.open_dataset()
and use the dataset.ems attribute:
import emsarray
import json
dataset = emsarray.tutorial.open_dataset('gbr4')
# Export dataset geometry as geojson
with open("geometry.geojson", "w") as f:
json.dump(dataset.ems.make_geojson_geometry(), f)
# Plot the sea surface temperature for time = 0
temp = dataset['temp'].isel(time=0, k=-1)
dataset.ems.plot(temp)