-
Notifications
You must be signed in to change notification settings - Fork 300
Closed
Description
🐛 Bug Report
The order in which a mathematical operation is applied on a 'iris.coords.AuxCoord' and 'iris.cube.Cube' makes a difference, i.e.
iris.cube.Cube / iris.coords.AuxCoord works fine whereas iris.coords.AuxCoord / iris.cube.Cube returns the error as:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/sarah/anaconda3/envs/iris/lib/python3.8/site-packages/iris/coords.py", line 464, in __truediv__
return self.__binary_operator__(other, self._MODE_DIV)
File "/home/sarah/anaconda3/envs/iris/lib/python3.8/site-packages/iris/coords.py", line 425, in __binary_operator__
raise iris.exceptions.NotYetImplementedError(emsg)
iris.exceptions.NotYetImplementedError: Coord / AuxCoord
A workaround to avoid the error is that the user takes care of the order of "Cubes" and "Auxcoords". However, this can cause a problem in complicated equations including several terms.
How To Reproduce
Steps to reproduce the behaviour:
- please see cube math documentation, section Combining Multiple Phenomena to Form a New One.
- first, load the pressure cube as it is explained.
- then, define P0 as it is explained.
- calculate the new pressure using the equation (pressure / p0): this works fine.
- now make a different equation by changing the order i.e. (p0 / pressure): this returns the error, mentioned above.
- replace the operator " / " with any operators of " + ", " - ", or " * " and repeat steps 3 and 4: the same things happen.
Environment
- OS & Version: Ubuntu 20.04 LTS
- Iris Version: 3.0.1
- environment file is attached iris.txt.