-
Notifications
You must be signed in to change notification settings - Fork 39
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
Adding hurs (realtive humidity) derivation script #2397
base: main
Are you sure you want to change the base?
Conversation
tdps_cube = cubes.extract_cube(NameConstraint(var_name='tdps')) | ||
tas_cube = cubes.extract_cube(NameConstraint(var_name='tas')) | ||
|
||
cubes_difference = iris.analysis.maths.subtract(tas_cube, tdps_cube) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubes_difference = iris.analysis.maths.subtract(tas_cube, tdps_cube) | |
cubes_difference = tas_cube - tdps_cube |
Would this also work? Did you read the section on cube maths in the iris documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, so when I was trying it with simple tas_cube-tdps_cube
the issue was that I was running out of memory, while it wasn't a case with subtract
. I will test it again with the time diagnostic and will let you know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be surprising because it should do the same thing, i.e. the minus operator on an Iris cube is implemented using the exact same function:
https://github.com/SciTools/iris/blob/c5e0353da11c263656c6c77e5e56eafefcede077/lib/iris/cube.py#L3968
This could probably be done with code like this: import dask.array as da
hurs_cb.data = da.ma.where(hurs_cb.core_data() > 100., hurs_cb.core_data(), 100.) |
If you would like a quicker response in the future, it usually helps if you tag people so they get a notification, e.g. @bouweandela |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2397 +/- ##
==========================================
- Coverage 94.96% 94.89% -0.07%
==========================================
Files 253 254 +1
Lines 14701 14724 +23
==========================================
+ Hits 13961 13973 +12
- Misses 740 751 +11 ☔ View full report in Codecov by Sentry. |
Hi folks,
Following the April 2024 monthly meeting, I'm adding the relative humidity derivation (
hurs
). Before being able to open a real PR, I would need to add filtering in case thehurs_cb.data
>100%. Also need to write test. Will do it before the workshop.This PR is related to #2254 .