SciTools/iris — pull request #1076 by esc24 (2014-03-26 12:46:16+00:00)
Title: Cube math broadcasting

This PR adds automatic cube broadcasting for a subset of cases. It enables a users to subtract a collapsed cube or a slice of a cube from the original without having to do any manual broadcasting/padding/stacking. Addition, subtraction, multiplication and division are supported. E.g.
```python
import iris
import iris.tests.stock
cube = iris.tests.stock.realistic_4d()
avg_cube = cube.collapsed('model_level_number', iris.analysis.MEAN)
diff = cube - avg_cube
# or
surface_cube = cube[:, 0, ...]
diff = cube - surface_cube
```
Previously this would work if the collapse/slice took place over the leftmost dimensions (via numpy broadcasting rules). This PR extends the behaviour to work over any dimensions.

Note that the collection of test cml files should all be the same give or take the units and dtype. The units vary depending on whether the cubes are added/divided etc. The dtype remains unchanged unless collapsing along all dimensions which resulting in promotion from float32 to float64. This behaviour is unrelated to this PR and is likely to be a feature of collapse and scalar cubes.