You are viewing the latest unreleased documentation 3.9.0.dev5. You can switch to a stable version.

v2.3 (19 Dec 2019)#

This document explains the changes made to Iris for this release (View all changes.)


Support for CF 1.7

We have introduced several changes that contribute to Iris’s support for the CF Conventions, including some CF 1.7 additions. We are now able to support:

You can read more about each of these below.

Additionally, the conventions attribute, added by Iris when saving to NetCDF, has been updated to CF-1.7, accordingly.

Climatological Coordinate Support

Iris can now load, store and save NetCDF climatological coordinates. Any cube time coordinate can be marked as a climatological time axis using the boolean property: climatological. The climatological bounds are stored in the coordinate’s bounds property.

When an Iris climatological coordinate is saved in NetCDF, the NetCDF coordinate variable will be given a ‘climatology’ attribute, and the contents of the coordinate’s bounds property are written to a NetCDF boundary variable called ‘<coordinate-name>_bounds’. These are in place of a standard ‘bounds’ attribute and accompanying boundary variable. See below for an example adapted from CF conventions:

  float temperature(time,lat,lon);
    temperature:long_name="surface air temperature";
    temperature:cell_methods="time: minimum within years time: mean over years";
  double time(time);
    time:units="days since 1960-1-1";
  double time_climatology(time,bnds);
data:  // time coordinates translated to date/time format
  time="1960-4-16", "1960-7-16", "1960-10-16", "1961-1-16" ;
  time_climatology="1960-3-1",  "1990-6-1",
                   "1960-6-1",  "1990-9-1",
                   "1960-9-1",  "1990-12-1",
                   "1960-12-1", "1991-3-1" ;

If a climatological time axis is detected when loading NetCDF - indicated by the format described above - the climatological property of the Iris coordinate will be set to True.

New Chunking Strategy

Iris now makes better choices of Dask chunk sizes when loading from NetCDF files: If a file variable has small, specified chunks, Iris will now choose Dask chunks which are a multiple of these up to a default target size.

This is particularly relevant to files with an unlimited dimension, which previously could produce a large number of small chunks. This had an adverse effect on performance.

In addition, Iris now takes its default chunk size from the default configured in Dask itself, i.e. dask.config.get('array.chunk-size').

Lazy Statistics

Several statistical operations can now be done lazily, taking advantage of the performance improvements offered by Dask:

Bugs Fixed#

  • Cube equality of boolean data is now handled correctly.

  • Fixed a bug where cell measures were incorrect after a cube transpose() operation. Previously, this resulted in cell-measures that were no longer correctly mapped to the cube dimensions.

  • The AuxCoord disregarded masked points and bounds, as did the DimCoord. Fix permits an AuxCoord to contain masked points/bounds, and a TypeError exception is now raised when attempting to create or set the points/bounds of a DimCoord with arrays with missing points.

  • iris.coord_systems.VerticalPerspective coordinate system now uses the CF Vertical perspective definition; had been erroneously using Geostationary.

  • CellMethod will now only use valid NetCDF name tokens to reference the coordinates involved in the statistical operation.

  • The following var_name properties will now only allow valid NetCDF name tokens to reference the said NetCDF variable name. Note that names with a leading underscore are not permitted.

  • Rendering a cube in Jupyter will no longer crash for a cube with attributes containing \n.

  • NetCDF variables which reference themselves in their cell_measures attribute can now be read.

  • quiver() now handles circular coordinates.

  • The names of cubes loaded from abf/abl files have been corrected.

  • Fixed a bug in UM file loading, where any landsea-mask-compressed fields (i.e. with LBPACK=x2x) would cause an error later, when realising the data.

  • iris.cube.Cube.collapsed() now handles partial collapsing of multidimensional coordinates that have bounds.

  • Fixed a bug in the PROPORTION aggregator, where cube data in the form of a masked array with array.mask=False would cause an error, but possibly only later when the values are actually realised. ( Note: since netCDF4 version 1.4.0, this is now a common form for data loaded from netCDF files ).

  • Fixed a bug where plotting a cube with a iris.coord_systems.LambertConformal coordinate system would result in an error. This would happen if the coordinate system was defined with one standard parallel, rather than two. In these cases, a call to as_cartopy_crs() would fail.

  • iris.cube.Cube.aggregated_by() now gives correct values in points and bounds when handling multidimensional coordinates.

  • Fixed a bug in the iris.cube.Cube.collapsed() operation, which caused the unexpected realization of any attached auxiliary coordinates that were bounded. It now correctly produces a lazy result and does not realise the original attached AuxCoords.


  • Iris now supports Proj4 up to version 5, but not yet 6 or beyond, pending fixes to some cartopy tests.

  • Iris now requires Dask >= 1.2 to allow for improved coordinate equality checks.