Efficiently calculating neighbourhood stats around many locations in a 2D xarray grid #8429
Unanswered
jgomezdans
asked this question in
Q&A
Replies: 1 comment
-
Also, note that while going through this, I came across some weird memory usage pattern calculating the std (set |
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
-
I have been trying to find the best way to optimise the following task:
da
. Say of size 10 000 x 10 000x_loc_idx
andy_loc_idx
. N ~ 20 000da[n_samps]
based on the statsI thought that I could use
rolling
to do this efficiently. I have a dask Gateway cluster (actually, I want to run this on MS's PlanetaryComputer). I thought that if I do anisel
after the mean/std calculations to only fish out the required pixels would be a good idea. However, even for a small number of selected pixels and a smallish window size, I run into out of memory issues.This kind of works, but only with a beefy dask cluster behind. I don't really know whether this is the fastest way of performing these calculations. I have also implemented this as a function that operates on a subset of the original data, which I run as a dask.delayed function. It works, but I was wondering what the best approach is.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions