Replies: 1 comment
-
Okay, I think I found a method to do it. I'm leaving this open because I still feel like there must be a nicer way to do it (or so someone can explain what I don't understand about how The logic is that we use the Demo:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I feel like I'm missing something super obvious here, but, for the life of me, I can't figure out how to pass a spatial rolling window over data and average the data in that window across time. Hopefully the examples below will make what I'm trying to do clear.
Given what I've tried, I think the issue might be that I just don't understand how
.rolling()
works. My assumption was that it would work basically like.sel()
for the coords of each window. So in my case, the.rolling()
(essentially) return a bunch of DataArrays, with the subset of spatial coords, but all the time coords. Then when you do.mean()
it would take all that data and reduce it down to a single mean value, and then it would construct a new dataarray with a shape equivalent to the dimensions being rolled over, and with whatever dimensions were remaining after the.mean()
(depending on which dims you performed the mean over etc.).Below are the main things I've tried so far. I want to get an output that is shaped (100,100), having averaged over the time dimension.
And the outputs are:
Beta Was this translation helpful? Give feedback.
All reactions