csiro-coasts / emsarray

xarray extension that supports EMS model formats
BSD 3-Clause "New" or "Revised" License
13 stars 2 forks source link

Handle latitude/longitude bounds properly when making polygons #49

Closed mx-moth closed 1 year ago

mx-moth commented 1 year ago

Previously the bounds were ignored, with polygons being constructed by finding midpoints between face centres. This approach is still used as a fallback, but if a dataset defines bounds for a coordinate, those bounds are used to construct the polygons.

This means CF grid topologies with 2D coordinates can have properly defined edge cells, if the bounds are defined in the dataset.