The following exercise is designed to give you experience of identifying why two cubes are not merging. Work is underway to make this identification process more automatic, but the resolution of the identified differences will still be a necessary process.
There are 6 problems, each of which are not merging into a single cube as desired. In no particular order the problems are:
The files can be found in the repository along with this course in exercises/iris/merge/
. There are two files to be loaded for each exercise: merge_exercise.{problem_number}.f1.nc
and merge_exercise.{problem_number}.f2.nc
.
Identify, and correct, the reason that the two cubes are not merging for all 6 sets of files.
In [1]:
import iris
In [2]:
cube1 = iris.load_cube('../resources/merge_exercise.1.f1.nc')
cube2 = iris.load_cube('../resources/merge_exercise.1.f2.nc')
merged = iris.cube.CubeList([cube1, cube2]).merge_cube()
In [3]:
cube1 = iris.load_cube('../resources/merge_exercise.2.f1.nc')
cube2 = iris.load_cube('../resources/merge_exercise.2.f2.nc')
merged = iris.cube.CubeList([cube1, cube2]).merge_cube()
In [4]:
cube1 = iris.load_cube('../resources/merge_exercise.3.f1.nc')
cube2 = iris.load_cube('../resources/merge_exercise.3.f2.nc')
print(cube1.coord('time'))
print(cube2.coord('time'))
merged = iris.cube.CubeList([cube1, cube2]).merge_cube()
In [5]:
cube1 = iris.load_cube('../resources/merge_exercise.4.f1.nc')
cube2 = iris.load_cube('../resources/merge_exercise.4.f2.nc')
merged = iris.cube.CubeList([cube1, cube2]).merge_cube()
In [6]:
cube1 = iris.load_cube('../resources/merge_exercise.5.f1.nc')
cube2 = iris.load_cube('../resources/merge_exercise.5.f2.nc')
merged = iris.cube.CubeList([cube1, cube2]).merge_cube()
In [7]:
cube1 = iris.load_cube('../resources/merge_exercise.6.f1.nc')
cube2 = iris.load_cube('../resources/merge_exercise.6.f2.nc')
merged = iris.cube.CubeList([cube1, cube2]).merge_cube()