Skip to content

Commit 2717e66

Browse files
committed
Final tweaks to merge and concat userguide.
1 parent 08c5280 commit 2717e66

File tree

8 files changed

+28
-28
lines changed

8 files changed

+28
-28
lines changed

docs/iris/src/userguide/concat.png

19.6 KB
Loading

docs/iris/src/userguide/concat.svg

Lines changed: 0 additions & 1 deletion
Loading

docs/iris/src/userguide/merge.png

21.3 KB
Loading

docs/iris/src/userguide/merge.svg

Lines changed: 0 additions & 1 deletion
Loading
12.9 KB
Loading

docs/iris/src/userguide/merge_and_concat.rst

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,28 @@ issues from occurring.
1616
Both ``merge`` and ``concatenate`` take multiple cubes as input and
1717
result in fewer cubes as output. The following diagram illustrates the two processes:
1818

19-
.. image:: merge_and_concat.svg
19+
.. image:: merge_and_concat.png
2020
:alt: Pictographic of merge and concatenation.
2121
:align: center
2222

23-
There is one major difference between the ``merge`` and ``concatenate`` processes.
24-
The ``merge`` process combines multiple input cubes into a
25-
single resultant cube with new dimensions created from the
26-
*scalar coordinate values* of the input cubes.
27-
The ``concatenate`` process process combines multiple input cubes into a
28-
single resultant cube with the same *number of dimensions* as the input cubes,
29-
but with the length of one or more dimensions extended by *joining together
30-
sequential dimension coordinates*.
23+
There is one major difference between the ``merge`` and ``concatenate`` processes.
24+
25+
* The ``merge`` process combines multiple input cubes into a
26+
single resultant cube with new dimensions created from the
27+
*scalar coordinate values* of the input cubes.
3128

29+
* The ``concatenate`` process combines multiple input cubes into a
30+
single resultant cube with the same *number of dimensions* as the input cubes,
31+
but with the length of one or more dimensions extended by *joining together
32+
sequential dimension coordinates*.
3233

3334
Let's imagine 28 individual cubes representing the
34-
temperature at a location ``(y, x)``, one cube for each day of February. We can use
35+
temperature at a location ``(y, x)``; one cube for each day of February. We can use
3536
:meth:`~iris.cube.CubeList.merge` to combine the 28 ``(y, x)`` cubes into
3637
a single ``(t, y, x)`` cube, where the length of the ``t`` dimension is 28.
3738

3839
Now imagine 12 individual cubes representing daily temperature at a time and
39-
location ``(t, y, x)``, one cube for each month in the year. We can use
40+
location ``(t, y, x)``; one cube for each month in the year. We can use
4041
:meth:`~iris.cube.CubeList.concatenate` to combine the 12
4142
``(t, y, x)`` cubes into a single ``(t, y, x)`` cube, where the length
4243
of the ``t`` dimension is now 365.
@@ -125,7 +126,7 @@ make a new ``z`` dimension coordinate:
125126

126127
The following diagram illustrates what has taken place in this example:
127128

128-
.. image:: merge.svg
129+
.. image:: merge.png
129130
:alt: Pictographic of merge.
130131
:align: center
131132

@@ -193,11 +194,11 @@ into a single cube:
193194
cube.attributes keys differ: 'Conventions'
194195

195196
Note that :meth:`~iris.cube.CubeList.merge` returns two cubes here.
196-
All the cubes that can be merged have been. Any cubes that can't be merged are
197+
All the cubes that can be merged have been merged. Any cubes that can't be merged are
197198
included unchanged in the returned :class:`~iris.cube.CubeList`.
198199
When :meth:`~iris.cube.CubeList.merge_cube` is called on ``cubes`` it raises a
199200
descriptive error that highlights the difference in the ``attributes`` dictionaries.
200-
It is this difference that is preventing ``cube`` being merged into a
201+
It is this difference that is preventing ``cubes`` being merged into a
201202
single cube. An example of fixing an issue like this can be found in the
202203
:ref:`merge_concat_common_issues` section.
203204

@@ -207,22 +208,24 @@ Merge in Iris load
207208

208209
The CubeList's :meth:`~iris.cube.CubeList.merge` method is used internally
209210
by the three main Iris load functions introduced in :doc:`loading_iris_cubes`.
210-
For file formats such as GRIB and PP, which intrinsically store fields as many
211+
For file formats such as GRIB and PP, which store fields as many
211212
individual 2D arrays, Iris loading uses the ``merge`` process to produce a
212-
more intuitive higher dimensional cube of each phenomenon.
213+
more intuitive higher dimensional cube of each phenomenon where possible.
213214

214215
Sometimes the ``merge`` process doesn't behave as expected. In almost all
215216
cases this is due to the input cubes containing unexpected or inconsistent metadata.
216217
For this reason, a fourth Iris file loading function, :func:`iris.load_raw`, exists.
217218
The :func:`~iris.load_raw` function is intended as a diagnostic tool that can be used to
218219
load cubes from files without the ``merge`` process taking place. The return value of
219220
:func:`iris.load_raw` is always a :class:`~iris.cube.CubeList` instance.
221+
You can then call the :meth:`~iris.cube.CubeList.merge_cube` method on this returned
222+
:class:`~iris.cube.CubeList` to help identify merge related load issues.
220223

221224

222225
Concatenate
223226
-----------
224227

225-
We've seen that the ``concatenate`` process process combines multiple input cubes into a
228+
We've seen that the ``concatenate`` process combines multiple input cubes into a
226229
single resultant cube with the same *number of dimensions* as the input cubes,
227230
but with the length of one or more dimensions extended by *joining together
228231
sequential dimension coordinates*.
@@ -284,7 +287,7 @@ cubes to form a new cube with an extended ``t`` coordinate:
284287

285288
The following diagram illustrates what has taken place in this example:
286289

287-
.. image:: concat.svg
290+
.. image:: concat.png
288291
:alt: Pictographic of concatenate.
289292
:align: center
290293

@@ -351,11 +354,11 @@ concatenate into a single cube:
351354

352355

353356
Note that :meth:`~iris.cube.CubeList.concatenate` returns two cubes here.
354-
All the cubes that can be concatenated have been. Any cubes that can't be concatenated are
357+
All the cubes that can be concatenated have been concatenated. Any cubes that can't be concatenated are
355358
included unchanged in the returned :class:`~iris.cube.CubeList`.
356359
When :meth:`~iris.cube.CubeList.concatenate_cube` is called on ``cubes`` it raises a
357360
descriptive error that highlights the difference in the ``attributes`` dictionaries.
358-
It is this difference that is preventing ``cube`` being concatenated into a
361+
It is this difference that is preventing ``cubes`` being concatenated into a
359362
single cube. An example of fixing an issue like this can be found in the
360363
:ref:`merge_concat_common_issues` section.
361364

@@ -529,17 +532,18 @@ error highlighting the presence of the duplicate cube.
529532
**Single value coordinates**
530533

531534
Coordinates containing only a single value can cause confusion when
532-
combining input cubes. In Iris' terminology a **scalar** coordinate is a
533-
coordinate of length 1 *which does not describe a data dimension*. Remember:
535+
combining input cubes. Remember:
534536

535537
* The ``merge`` process combines multiple input cubes into a
536538
single resultant cube with new dimensions created from the
537539
**scalar** *coordinate values* of the input cubes.
538-
* The ``concatenate`` process process combines multiple input cubes into a
540+
* The ``concatenate`` process combines multiple input cubes into a
539541
single resultant cube with the same *number of dimensions* as the input cubes,
540542
but with the length of one or more dimensions extended by *joining together
541543
sequential* **dimension** *coordinates*.
542544

545+
In Iris terminology a **scalar** coordinate is a
546+
coordinate of length 1 *which does not describe a data dimension*.
543547

544548
Let's look at two example cubes to demonstrate this.
545549

@@ -640,6 +644,6 @@ the input cubes using :meth:`~iris.cube.CubeList.concatenate_cube`:
640644
**Attributes Mismatch**
641645

642646
The ``concatenate`` process is affected by attributes mismatch on input cubes
643-
in the same way that the ``merge`` process.
647+
in the same way that the ``merge`` process is.
644648
The :ref:`Attributes Mismatch <merge_issues_attrs_mismatch>` section earlier in this
645649
chapter gives further information on attributes mismatch.

docs/iris/src/userguide/multi_array.svg

Lines changed: 0 additions & 1 deletion
Loading

docs/iris/src/userguide/multi_array_to_cube.svg

Lines changed: 0 additions & 1 deletion
Loading

0 commit comments

Comments
 (0)