You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The dimension coordinates ``x`` and ``y`` are explicitly defined on
341
+
an a *transverse mercator* grid via the ``crsOSGB`` variable.
342
+
343
+
However, with the extended grid syntax, it is also possible to define
344
+
a second coordinate system on a standard **latitude_longitude** grid
345
+
and associate it with the auxiliary ``lat`` and ``lon`` coordinates:
346
+
347
+
::
348
+
349
+
pres:grid_mapping = "crsOSGB: x y crsWGS84: lat lon" ;
350
+
351
+
352
+
Note, the *order* of the axes in the extended grid mapping specification is
353
+
significant, but only when used in conjunction with a
354
+
`CRS Well Known Text (WKT)`_ representation of the coordinate system where it
355
+
should be consistent with the ``AXES ORDER`` specified in the ``crs_wkt``
356
+
attribute.
357
+
358
+
359
+
Effect on loading
360
+
^^^^^^^^^^^^^^^^^
361
+
362
+
When Iris loads a NetCDF file that uses the extended grid mapping syntax
363
+
it will generate an :class:`iris.coord_systems.CoordSystem` for each
364
+
coordinate system listed and attempt to attach it to the associated
365
+
:class:`iris.coords.Coord` instances on the cube. Currently, Iris considers
366
+
the ``crs_wkt`` supplementary and builds coordinate systems exclusively
367
+
from the ``grid_mapping`` attribute.
368
+
369
+
The :attr:`iris.cube.Cube.extended_grid_mapping` property will be set to
370
+
``True`` for cubes loaded from NetCDF data variables utilising the extended
371
+
``grid_mapping`` syntax.
372
+
373
+
Effect on saving
374
+
^^^^^^^^^^^^^^^^
375
+
376
+
To maintain existing behaviour, saving an :class:`iris.cube.Cube` to
377
+
a netCDF file will default to the "simple" grid mapping syntax, unless
378
+
the cube was loaded from a file using the extended grid mapping syntax.
379
+
If the cube contains multiple coordinate systems, only the coordinate
380
+
system of the dimension coordinate(s) will be specified.
381
+
382
+
To enable saving of multiple coordinate systems with ordered axes,
383
+
set the :attr:`iris.cube.Cube.extended_grid_mapping` to ``True``.
384
+
This will generate a ``grid_mapping`` attribute using the extended syntax
385
+
to specify all coordinate systems on the cube. The axes ordering of the
386
+
associated coordinate variables will be consistent with that of the
387
+
generated ``crs_wkt`` attribute.
388
+
389
+
Note, the ``crs_wkt`` attribute will only be generated when the
390
+
extended grid mapping is also written, i.e. when
391
+
``Cube.extended_grid_mapping=True``.
392
+
393
+
394
+
.. _CRS Well Known Text (WKT): https://cfconventions.org/Data/cf-conventions/cf-conventions-1.12/cf-conventions.html#use-of-the-crs-well-known-text-format
Copy file name to clipboardExpand all lines: docs/src/whatsnew/latest.rst
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,31 @@ This document explains the changes made to Iris for this release
40
40
now preserved when it was not previously. See also: :ref:`load-problems`.
41
41
(:pull:`6465`, :pull:`6529`)
42
42
43
+
#. `@wjbenfold`_ and `@trexfeathers`_ added ``crs_wkt`` to the attributes when
44
+
saving a :class:`~iris.coord_systems.CoordSystem` to a NetCDF file. Note that
45
+
``crs_wkt`` is considered *supplementary* by the CF conventions, with
46
+
``grid_mapping`` being the primary source of information, and ``crs_wkt`` not
47
+
expected to contain conflicting information. Because of this, Iris generates
48
+
:class:`~iris.coord_systems.CoordSystem` exclusively from ``grid_mapping``
49
+
when loading, and writes a fresh ``crs_wkt`` whenever a
50
+
:class:`~iris.coord_systems.CoordSystem` is saved. If your use case goes
51
+
beyond the CF conventions, you can modify the save and load process for your
52
+
needs by using the `Ncdata`_ package.
53
+
See `CRS WKT in the CF Conventions`_ for more. (:issue:`3796`, :pull:`6519`)
54
+
55
+
#. `@ukmo-ccbunney`_ and `@trexfeathers`_ added support for
56
+
**multiple coordinate systems** and **ordered coordinates** when loading
57
+
and saving NetCDF files.
58
+
This allows for coordinates to be explicitly associated with a coordinate
59
+
system via an extended syntax in the ``grid_mapping`` attribute of a NetCDF
60
+
data variable. This extended syntax also supports specification of multiple
61
+
coordinate systems per data variable. Setting the property
62
+
``cube.extended_grid_mapping = True`` will enable extended grid mapping
63
+
syntax when saving a NetCDF file and also generate an associated **well known
64
+
text** attribute (``crs_wkt``; as described in :issue:`3796`).
65
+
See `CRS Grid Mappings and Projections`_ for more information.
66
+
(:issue:`3388`:, :pull:`6536`:)
67
+
43
68
#. `@ESadek-MO`_ made MeshCoords immutable. :class:`iris.MeshCoord`s are now updated automatically when
44
69
changing the attached mesh. All changes to the :class:`iris.MeshCoord` should instead be done to
45
70
the relevant :class:`iris.Coord` located on the attached :class:`iris.MeshXY`. This change also affects
@@ -166,4 +191,7 @@ This document explains the changes made to Iris for this release
166
191
.. comment
167
192
Whatsnew resources in alphabetical order:
168
193
194
+
.. _CRS WKT in the CF Conventions: https://cfconventions.org/Data/cf-conventions/cf-conventions-1.12/cf-conventions.html#use-of-the-crs-well-known-text-format
195
+
.. _CRS Grid Mappings and Projections: https://cfconventions.org/Data/cf-conventions/cf-conventions-1.12/cf-conventions.html#grid-mappings-and-projections
0 commit comments