I want to recover a "buffer" around a given value in a 2-D numpy array in python. The idea is to select all the values comprised within a given radius and then mask them. It would be something like:
- select a "cell" in the matrix, like
matrix[x, y]
- get the cells comprised in the neighborhood, where the distance from
x, y
is less than the radiusr
I would like to implement a fast function for doing so, since I have a big array for processing (shape is 7000 x 10000).