-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smarter area weighted sum #1613
Comments
Would also provide a solution to #708 if solved I think |
Was some discussion in #418 already |
Maybe it would be good to raise this issue with the iris developers too. We're using iris to compute area statistics and iris is supposed to handle metadata correctly for you (this is one of the big advantages of using iris over xarray), but apparently it doesn't. |
With regards to Iris, the thing is that the function takes the weights as an array, not as a cube or similar (coordinate, cell measure, ancillary variable), so they don't come with units and indeed Iris has no way of knowing that these particular weights happen to be areas. Of course, that could (and perhaps should?) be changed. Why not accept all those things I mentioned above and integrate proper unit handling? |
Or maybe it could even be just a string: if the cube has a cube.collapsed(['latitude', 'longitude'], iris.analysis.SUM, weights='cell area') shouldn't that just work? Instead of having to do: cube.collapsed(['latitude', 'longitude'], iris.analysis.SUM, weights=cube.cell_measures('cell area').core_data()) |
I opened an issue in iris about this, already have a working solution 👍 |
Follows comment made here (other issues could also be spun out of that comment).
Is your feature request related to a problem? Please describe.
Currently, when doing an area-weighted sum, the units are not changed. They should be multiplied with area ** 2.
Would you be able to help out?
Yes, but this would not be a backwards compatible change so I would need guidance.
The text was updated successfully, but these errors were encountered: