Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 63 additions & 63 deletions docs/src/further_topics/lenient_maths.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,26 @@ represents the output of an low-resolution global atmospheric ``experiment``,
.. doctest:: lenient-example

>>> print(experiment)
air_potential_temperature / (K) (model_level_number: 15; grid_latitude: 100; grid_longitude: 100)
Dimension coordinates:
model_level_number x - -
grid_latitude - x -
grid_longitude - - x
Auxiliary coordinates:
atmosphere_hybrid_height_coordinate x - -
sigma x - -
surface_altitude - x x
Derived coordinates:
altitude x x x
Scalar coordinates:
forecast_period: 0.0 hours
forecast_reference_time: 2009-09-09 17:10:00
time: 2009-09-09 17:10:00
Attributes:
Conventions: CF-1.5
STASH: m01s00i004
experiment-id: RT3 50
source: Data from Met Office Unified Model 7.04
air_potential_temperature / (K) (model_level_number: 15; grid_latitude: 100; grid_longitude: 100)
Dimension coordinates:
model_level_number x - -
grid_latitude - x -
grid_longitude - - x
Auxiliary coordinates:
atmosphere_hybrid_height_coordinate x - -
sigma x - -
surface_altitude - x x
Derived coordinates:
altitude x x x
Scalar coordinates:
forecast_period 0.0 hours
forecast_reference_time 2009-09-09 17:10:00
time 2009-09-09 17:10:00
Attributes:
Conventions CF-1.5
STASH m01s00i004
experiment-id RT3 50
source Data from Met Office Unified Model 7.04

Consider also the following :class:`~iris.cube.Cube`, which has the same global
spatial extent, and acts as a ``control``,
Expand All @@ -96,41 +96,41 @@ spatial extent, and acts as a ``control``,

>>> print(control)
air_potential_temperature / (K) (grid_latitude: 100; grid_longitude: 100)
Dimension coordinates:
grid_latitude x -
grid_longitude - x
Scalar coordinates:
model_level_number: 1
time: 2009-09-09 17:10:00
Attributes:
Conventions: CF-1.7
STASH: m01s00i004
source: Data from Met Office Unified Model 7.04
Dimension coordinates:
grid_latitude x -
grid_longitude - x
Scalar coordinates:
model_level_number 1
time 2009-09-09 17:10:00
Attributes:
Conventions CF-1.7
STASH m01s00i004
source Data from Met Office Unified Model 7.04

Now let's subtract these cubes in order to calculate a simple ``difference``,

.. doctest:: lenient-example

>>> difference = experiment - control
>>> print(difference)
unknown / (K) (model_level_number: 15; grid_latitude: 100; grid_longitude: 100)
Dimension coordinates:
model_level_number x - -
grid_latitude - x -
grid_longitude - - x
Auxiliary coordinates:
atmosphere_hybrid_height_coordinate x - -
sigma x - -
surface_altitude - x x
Derived coordinates:
altitude x x x
Scalar coordinates:
forecast_period: 0.0 hours
forecast_reference_time: 2009-09-09 17:10:00
time: 2009-09-09 17:10:00
Attributes:
experiment-id: RT3 50
source: Data from Met Office Unified Model 7.04
unknown / (K) (model_level_number: 15; grid_latitude: 100; grid_longitude: 100)
Dimension coordinates:
model_level_number x - -
grid_latitude - x -
grid_longitude - - x
Auxiliary coordinates:
atmosphere_hybrid_height_coordinate x - -
sigma x - -
surface_altitude - x x
Derived coordinates:
altitude x x x
Scalar coordinates:
forecast_period 0.0 hours
forecast_reference_time 2009-09-09 17:10:00
time 2009-09-09 17:10:00
Attributes:
experiment-id RT3 50
source Data from Met Office Unified Model 7.04

Note that, cube maths automatically takes care of broadcasting the
dimensionality of the ``control`` up to that of the ``experiment``, in order to
Expand Down Expand Up @@ -204,21 +204,21 @@ time perform **strict** cube maths instead,
... difference = experiment - control
...
>>> print(difference)
unknown / (K) (model_level_number: 15; grid_latitude: 100; grid_longitude: 100)
Dimension coordinates:
model_level_number x - -
grid_latitude - x -
grid_longitude - - x
Auxiliary coordinates:
atmosphere_hybrid_height_coordinate x - -
sigma x - -
surface_altitude - x x
Derived coordinates:
altitude x x x
Scalar coordinates:
time: 2009-09-09 17:10:00
Attributes:
source: Data from Met Office Unified Model 7.04
unknown / (K) (model_level_number: 15; grid_latitude: 100; grid_longitude: 100)
Dimension coordinates:
model_level_number x - -
grid_latitude - x -
grid_longitude - - x
Auxiliary coordinates:
atmosphere_hybrid_height_coordinate x - -
sigma x - -
surface_altitude - x x
Derived coordinates:
altitude x x x
Scalar coordinates:
time 2009-09-09 17:10:00
Attributes:
source Data from Met Office Unified Model 7.04

Although the numerical result of this strict cube maths operation is identical,
it is not as rich in metadata as the :ref:`lenient alternative <lenient example>`.
Expand Down
32 changes: 16 additions & 16 deletions docs/src/further_topics/metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,22 @@ For example, given the following :class:`~iris.cube.Cube`,

>>> print(cube)
air_temperature / (K) (time: 240; latitude: 37; longitude: 49)
Dimension coordinates:
time x - -
latitude - x -
longitude - - x
Auxiliary coordinates:
forecast_period x - -
Scalar coordinates:
forecast_reference_time: 1859-09-01 06:00:00
height: 1.5 m
Attributes:
Conventions: CF-1.5
Model scenario: A1B
STASH: m01s03i236
source: Data from Met Office Unified Model 6.05
Cell methods:
mean: time (6 hour)
Dimension coordinates:
time x - -
latitude - x -
longitude - - x
Auxiliary coordinates:
forecast_period x - -
Scalar coordinates:
forecast_reference_time 1859-09-01 06:00:00
height 1.5 m
Cell methods:
mean time (6 hour)
Attributes:
Conventions CF-1.5
Model scenario A1B
STASH m01s03i236
source Data from Met Office Unified Model 6.05

We can easily get all of the associated metadata of the :class:`~iris.cube.Cube`
using the ``metadata`` property:
Expand Down
20 changes: 10 additions & 10 deletions docs/src/userguide/cube_maths.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ but with the data representing their difference:

>>> print(t_last - t_first)
unknown / (K) (latitude: 37; longitude: 49)
Dimension coordinates:
latitude x -
longitude - x
Scalar coordinates:
forecast_reference_time: 1859-09-01 06:00:00
height: 1.5 m
Attributes:
Conventions: CF-1.5
Model scenario: E1
source: Data from Met Office Unified Model 6.05
Dimension coordinates:
latitude x -
longitude - x
Scalar coordinates:
forecast_reference_time 1859-09-01 06:00:00
height 1.5 m
Attributes:
Conventions CF-1.5
Model scenario E1
source Data from Met Office Unified Model 6.05


.. note::
Expand Down
Loading