iris.analysis.stats.pearsonr metadata error #4786
-
Hello,
I tried to search through the source code, the error seems to be in the module resolve.py but the code there is a bit hard to navigate for me. Could anyone point me to how I could fix the error? EDIT:
cube2 print:
cube1 coords print:
cube2 coords print:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Obviously, can't say a whole lot without more details. However, it sounds like it can't identify which dimension in cube A matches that in cube B. |
Beta Was this translation helpful? Give feedback.
-
I assume you do some subsetting so that the time dimensions are the same length. The problem resolve is flagging is that your time coordinates have different units. You could fix this with something like import cf_units
# Make sure both cubes have the same calendar, otherwise convert_units doesn't work.
new_unit = cf_units.Unit(cube2.coord("time").units.origin, calendar="gregorian")
cube2.coord("time").units = new_unit
cube2.convert_units(cube1.coord("time")) However, you will still get an error if the time coordinate points and bounds don't match, so it may be easier to replace the whole coordinate:
|
Beta Was this translation helpful? Give feedback.
-
Archiving "answered" Q+As |
Beta Was this translation helpful? Give feedback.
I assume you do some subsetting so that the time dimensions are the same length. The problem resolve is flagging is that your time coordinates have different units. You could fix this with something like
However, you will still get an error if the time coordinate points and bounds don't match, so it may be easier to replace the whole coordinate: