uxarray
uxarray copied to clipboard
Topological Aggregations: (Node to Edge) and (Node to Face)
Closes #719 #718 #713 #712
Overview
- Link to User Guide section on Topological Aggregations
- Implements localized reductions on top of the standard global reductions provided by Xarray. These reductions utilize connectivity information for perform localized reductions (i.e. the average of all the nodes that surround each face)
-
mean
-
max
-
min
-
prod
-
sum
-
std
-
var
-
median
-
all
-
any
-
@erogluorhan
I'm going to pick this PR back up and address the changes that we've discussed in #724
Below are the following changes I'm going to make
- Use the term "aggregation" instead of "reductions" when referring to functions such as
mean
,max
,any,
etc. - Instead of overloading Xarray's methods, create new ones using names such as
topological_mean()
This would look like the following in our API
# assume some uxds with a `vorticity_200hPa` variable (node-centered)
uxds = ...
# standard xarray mean
uxds['vorticity_200hPa'].mean()
# topological (i.e. grid informed) mean, average of nodes stored on each face
uxds['vorticity_200hPa'].topological_mean(destination='face')
# topological (i.e. grid informed) mean, average of the nodes composed each edge.
uxds['vorticity_200hPa'].topological_mean(destination='edge')
What do you think? I'd like to really move forward with this functionality and get the performance improvements in.
Yes, all sounds good!
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
I'd really appreciate some help proof reading and checking for any typos in the new functions that I added, especially in the docstrings.
While reviewing, I also suggest looking over the user guide section I made for topological reductions. I'm really happy with how it turned out, and hope we can start making these sections for all of our functionality.
https://uxarray--711.org.readthedocs.build/en/711/user-guide/topological-aggregations.html
@rytam2
This is the pull request we briefly discussed last Monday. Whenever you wrap up with some of the other internship tasks, you can get started with reviewing this one!
Looks good! Any reason why we aren't supporting face and edge centered data variables yet though?
Thanks for the review! @rytam2 will be helping get support for those two methods this summer.