I recently got a dataset of water storage in Europe, which is inherently full of spatial gaps because of the waterbodies:
dataset
The goal is to study drought propagation, and I want to find dry area “clusters” emerging from different regions first, optimally like this:
ideal
I’ve been trying with connected components on Python (this package) to find 3D cluster of red voxels (i.e., dry area over time). However, this is the best I could get so far:
actual
With the connectivity of 26, the algorithm never group the British Isles across the channel or Morocco across the strait (because waterbodies were filled with NaN) and rather group the entire continent together retrospectively as single label when red voxels eventually prevail (as clusters get “stuck”).
I’ve adjusted my criteria so only the reddest voxels are grouped, but that didn’t help with that huge continental blob and even made it more difficult to group between water gaps. I’m now looking for a logical solution to solve this, which ideally can group pixels across the Channel or even the Mediterranean together but at the meantime differentiate the two clusters in Poland-Belarus.
The dataset is too large for me to even upload a snippet, so no codes are requested. It would be just great if you could point me to a package or just a thought (I’m using Python for this). Thanks