I have two Cubes which I wish to merge/concatenate, which are as follows:
>>> print c1
toa_outgoing_longwave_flux / (W m-2) (time: 9840; longitude: 40)
Dimension coordinates:
time x -
longitude - x
Scalar coordinates:
latitude: -21.3889 degrees, bound=(-21.6667, -21.1111) degrees
>>> print c2
toa_outgoing_longwave_flux / (W m-2) (time: 9840; latitude: 111; longitude: 40)
Dimension coordinates:
time x - -
latitude - x -
longitude - - x
As you can see, their shapes are incompatible but only because Iris treats a coordinate of length 1 as a scalar coordinate, not a dimension coordinate. It would be perfectly meaningful to concatenate these along the latitude dimension to make a new Cube of shape (9840, 112, 40) but Iris refuses (see below). I know that merging is used for scalar coordinates and concatenating for dimension coordinates, but what about when you have one of each?
>>> iris.cube.CubeList([c1, c2]).merge_cube()
MergeError: failed to merge into a single cube.
cube.shape differs: (9840, 40) != (9840, 111, 40)
>>> iris.cube.CubeList([c1, c2]).concatenate_cube()
ConcatenateError: failed to concatenate into a single cube.
Dimension coordinates differ: longitude, time != latitude, longitude, time
Scalar coordinates differ: latitude != < None >
Data dimensions differ: 2 != 3
Is there a way in which the latitude scalar coordinate in c1 can be "promoted" to a dimension coordinate in order for the concatenation to happen, or is there another solution to this?