Open-EO / openeo-processes-dask

Python implementations of many OpenEO processes, dask-friendly by default.
Apache License 2.0
19 stars 14 forks source link

re-implement apply_kernel based on xarray rolling + dot #222

Open clausmichele opened 7 months ago

clausmichele commented 7 months ago

@VincentVerelst the convolution operation has been added to xarray (I wasn't aware of it). We can adapt the apply_kernel implementation and simplify the code. https://github.com/pydata/xarray/issues/4196#issuecomment-1924112218

Let me know if you would have time looking into it.

VincentVerelst commented 7 months ago

Hi @clausmichele , I had a look at the rolling + dot approach via xarray. Is it not more difficult to handle borders via this approach? According to the spec, the following options are available: "numeric value, replicate, reflect, reflect_pixel, wrap". These are readily available in scipy.ndimage.convolve, but apparently not in xarray.DataArray.rolling.

What are your thoughts on this?

clausmichele commented 6 months ago

I started trying to re-implement it but it's not that easy as you expected. It doesn't have high priority at the moment, but when I'll have time I want to benchmark the two implementations.