I am looking at implementing an alternative to the current version of pop_tools.lateral_fill that uses a SOR solution of the Laplace equation to do the filling. It has the potential advantage of being easily implemented in array syntax without looping or conditionals in the iteration loop (other than checking for convergence). First step is to figure out how to wrap an old F90 version of this algorithm to be callable from python (question posted in the jupyter channel). Next will be an implementation in pure xarray.
it may be easier to port the loopy Fortran version to pure python and then compile with numba rather than convert to array syntax
Agreed. This is the way that the current smoother is implemented
https://github.com/matt-long/pop-tools/blob/master/pop_tools/fill.py
@Frank Bryan, note that this provides a generic xarray
interface, so your task would be confined to a pure numpy implementation.
Last updated: May 16 2025 at 17:14 UTC