iris.Load inconsistantly merging cubes on load
🐛 Bug Report
How To Reproduce
Steps to reproduce the behaviour:
I've sent the path to the example data via email - if you run the following code snippet
iris.util.equalise_attributes(cubes)
for count,cube in enumerate(cubes):
if cube.coord("forecast_period") is not None:
cube.remove_coord("forecast_period")
if len(cube.shape) == 2:
cubes[count] = iris.util.new_axis(cube,scalar_coord="time")
print(cubes)
you'll see the following output
0: surface_air_pressure / (Pa) (time: 1; projection_y_coordinate: 732; projection_x_coordinate: 607)
1: surface_air_pressure / (Pa) (time: 8; projection_y_coordinate: 732; projection_x_coordinate: 607)
2: surface_air_pressure / (Pa) (time: 8; projection_y_coordinate: 732; projection_x_coordinate: 607)
...
16: surface_air_pressure / (Pa) (time: 8; projection_y_coordinate: 732; projection_x_coordinate: 607)
17: surface_air_pressure / (Pa) (time: 16; projection_y_coordinate: 732; projection_x_coordinate: 607)
18: surface_air_pressure / (Pa) (time: 8; projection_y_coordinate: 732; projection_x_coordinate: 607)
...
26: surface_air_pressure / (Pa) (time: 8; projection_y_coordinate: 732; projection_x_coordinate: 607)
27: surface_air_pressure / (Pa) (time: 8; projection_y_coordinate: 732; projection_x_coordinate: 607)
28: surface_air_pressure / (Pa) (time: 8; projection_y_coordinate: 732; projection_x_coordinate: 607)
29: surface_air_pressure / (Pa) (time: 7; projection_y_coordinate: 732; projection_x_coordinate: 607)
A few inconsistancies there - the 3-hourly files have been automatically merged into daily files, but not perfectly - the 1/7 cubes are due to midnight at either ends of the month, and in the middle one cube (17:) has two days of data merged together rather than one. These are non-contigious days as well, (17th and 19th), so when one goes to run cubes.concatenate, you get two output cubes instead of one due to the 18th interleafing between the cubes.
Running this with load_raw fixes the immediate problem by not merging any cubes, but the broader issue of "why does this bug happen?" remains.
Environment
- OS & Version: RHEL (Old SPICE)
- Iris Version: 3.11.1
@acchamber Has kindly provided example data for this issue which has been archived under ${DATADIR}/iris-issue-6436-data for the MO team account 👍