-
Notifications
You must be signed in to change notification settings - Fork 24
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
Order of filter dimensions matters #125
Comments
We have to work on this issue to make progress toward publication in JOSS. Any ideas for elegant coding solutions? |
In the short term, I see no way around the user having to write filtered = filter.apply(field, dims=['y', 'x']) The reason is that there is know way for gcm-filters to know a-priori whether the order is "wrong". In the code above, the user is saying, the dimensions I want to filter are In the longer term, there are two ways we could do better.
|
(@rabernat you tagged the wrong @TomNicholas!)
I'm not sure I understand why rewriting as a grid ufunc would solve this dimension order issue. If the filter kernel is ultimately a (numpy universal) function which operates over two axes (x and y), then calling |
Because I think the |
Thanks for your perspectives and ideas, @rabernat and @TomNicholas! I will try to put in a PR soon for a short-term solution (i.e., more documentation). |
For most of our filter kernels, it matters whether the user does
versus
This came up in this issue in the context of filtering on a tripole grid. Our code needs the user to specify the correct order
['y', 'x']
because the tripolar exchanges are coded by assuming thaty
(latitude) is the second to last dimension:gcm-filters/gcm_filters/kernels.py
Lines 32 to 39 in 75f172c
Similarly, other Laplacians compute wet masks for the southern (and western) cell edges:
gcm-filters/gcm_filters/kernels.py
Lines 279 to 281 in 75f172c
This also assumes that latitude is the second to last dimension.
We should do either of the following two things:
['x', 'y']
.The text was updated successfully, but these errors were encountered: