computing mean angle #6058
Answered
by
max-sixty
axelschweiger
asked this question in
Q&A
-
is there a way to create a new function to replace the mean function in xarray for example to compute a angle mean (e.g. wind direction). If I have a python function that does this, can I tell xarray to use this in place of the built in mean? Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
max-sixty
Dec 10, 2021
Replies: 1 comment 5 replies
-
Generally the easiest approach is to use functions rather than methods — i.e. |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
max-sixty
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Generally the easiest approach is to use functions rather than methods — i.e.
angle_mean = compute_angle_mean(array)
. It's possible to use duck typing in python to replace methods, but it's a difficult abstraction to manage. Xarray doesn't support swapping out functions.