-
Notifications
You must be signed in to change notification settings - Fork 0
added masking of erroneous values #13
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
added masking of erroneous values #13
Conversation
lib/iris/analysis/cartography.py
Outdated
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.
Only a tiny point, but I think this would all look simpler with some renames, so that these 2 lines would read (something like):
sqmag_10 = u_10_t**2 + v_10_t**2
sqmag_01 = u_01_t**2 + v_01_t**2
|
The logic of this looks solid to me, but I don't really know how to justify the valid "magnitude accuracy limit" I guess the accuracy masking also itself needs a new test 😣 |
|
This is not really in scope, but I just realised that the code is committing a serious inefficiency with repetition over slices... Within the core code of 'transform_vectors', we derive 4 value arrays which define a '2x2 matrix' at each location, and apply these as the basic transform But these last two lines are the only use of the U and V values. So the '_inter_cs_differentials' results (dx2_x1, dy2_x1, dx2_y1, dy2_y1) only depend on X and Y. So all of those arrays, which are actually the costly part of the calculation, are independent of Us and Vs, will be the same for each slice and so could in fact be computed just once, instead of once per slice. |
|
Thanks @esc24 . Unfortunately, I'm still not sure we are done when we've conquered those points. I'd like to investigate the magnitude of the errors in some practical cases first, but perhaps you already have some examples, so we should confer on it.. |
|
Happy to confer. I have a few ipython notebooks with data I can show you. |
|
I've left the optimisation out. It can be done at a future date if it proves to be an issue. After looking at a few different CRSs @pp-mo and I agreed to up the tolerance to 0.1%, and at the same time up the note in the docstring to a warning. |
added masking of erroneous values
|
Thanks @esc24 |
No description provided.