Open ehogan opened 8 years ago
Have been reviewing some historic records elsewhere - this problem has also been experienced by @rcomer, so this is not an isolated issue.
In order to maintain a backlog of relevant issues, we automatically label them as stale after 500 days of inactivity.
If this issue is still important to you, then please comment on this issue and the stale label will be removed.
Otherwise this issue will be automatically closed in 28 days time.
This stale issue has been automatically closed due to a lack of community activity.
If you still care about this issue, then please either:
@SciTools/iris-devs
who will re-open on your behalf.I have the same issue. The responses acknowledge the issue has been highlighted before but does provide any solutions or alternatives.
@SciTools/peloton We have not forgotten about this, there are many merge/concatenate problems and we hope to be able to get to them in a future sprint.
cubelist or cube? return cube, not cubelist! 0: sea_water_potential_temperature / (degree_C) (-- : 3606; -- : 4322) 1: sea_water_potential_temperature / (degree_C) (-- : 3606; -- : 4322) 2: sea_water_potential_temperature / (degree_C) (-- : 3606; -- : 4322) 3: sea_water_potential_temperature / (degree_C) (-- : 3606; -- : 4322) 4: sea_water_potential_temperature / (degree_C) (-- : 3606; -- : 4322) Unequal lengths. Cube dimension 0 => 5; metadata 'cell_area' dimension 0 => 3606. Traceback (most recent call last): File "/net/home/h03/orca12/repositories/BB-FrontFinding/code_base/front_finder.py", line 335, in make_extended_mask_cube d3mask_cube = slice_list_mask.merge_cube() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/h03/orca12/.conda/envs/geovista-env/lib/python3.11/site-packages/iris/cube.py", line 442, in merge_cube (merged_cube,) = proto_cube.merge() ^^^^^^^^^^^^^^^^^^ File "/home/h03/orca12/.conda/envs/geovista-env/lib/python3.11/site-packages/iris/_merge.py", line 1325, in merge merged_cube = self._get_cube(merged_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/h03/orca12/.conda/envs/geovista-env/lib/python3.11/site-packages/iris/_merge.py", line 1606, in _get_cube cube = iris.cube.Cube( ^^^^^^^^^^^^^^^ File "/home/h03/orca12/.conda/envs/geovista-env/lib/python3.11/site-packages/iris/cube.py", line 1031, in init self.add_cell_measure(cell_measure, dims) File "/home/h03/orca12/.conda/envs/geovista-env/lib/python3.11/site-packages/iris/cube.py", line 1336, in add_cell_measure data_dims = self._check_multi_dim_metadata(cell_measure, data_dims) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/h03/orca12/.conda/envs/geovista-env/lib/python3.11/site-packages/iris/cube.py", line 1218, in _check_multi_dim_metadata raise iris.exceptions.CannotAddError( iris.exceptions.CannotAddError: Unequal lengths. Cube dimension 0 => 5; metadata 'cell_area' dimension 0 => 3606.
The same issue still presents itself when trying to merge horizontal slices of orca12 ocean data. Is there a work around available anywhere? Cheers!
I am unable to merge cubes with cell measures when using a time constraint (discovered in #2048). The problem can be reproduced by executing the code below (I can send the netCDF files directly to the person investigating the issue, if required).
If I try to load the netCDF files using
iris.load_cube
and I don't use a time constraint,iris.load_cube
fails with aConstraintMismatchError: failed to merge into a single cube. Coordinates in cube.dim_coords differ: time.
, which is what I expect (I can instead useiris.load
then concatenate the resulting cubes).However, when I use a time constraint, the
time
coordinate in each cube is demoted to a scalar coordinate, which means it should be possible to merge the cubes. Butiris.load_cube
fails with aUnequal lengths. Cube dimension 0 => 3; metadata u'area of T grid cells' dimension 0 => 1020.
. Dimension 0 corresponds to thetime
coordinate (the constraint selects 3 months of monthly data) and thearea of T grid cells
is the long name of the variable specified as the value of thecell_measures
attribute of the data variable in the netCDF file I am trying to load. However, the cell measures is described only by thelatitude
andlongitude
auxiliary coordinates, so I don't understand why it's trying to compare thetime
dimension with the cell measures?