I added more testing and documentation to the github branch.
https://github.com/scikit-fmm/scikit-fmm/tree/narrow
As currently written, the narrow parameter is actually half the bandwidth.
Values of the narrow parameter smaller than the grid spacing (which
defaults 1) will result in extra points getting into the narrow band.
This is probably not a bid deal.
I decided it makes the most sense to return a masked array where the
points outside the narrow band are masked off. The mask is only added
if there are points outside the narrowband or if the input is a masked
array.
If you need a signed constant distance outside the narrowband you
could do something like this:
import numpy as np
from skfmm import distance
N = 50
X, Y = np.meshgrid(np.linspace(-1, 1, N), np.linspace(-1, 1, N))
r = 0.5
dx = 2.0 / (N - 1)
phi = (X) ** 2 + (Y) ** 2 - r ** 2
bandwidth = 4*dx
d = distance(phi, dx, narrow=bandwidth)
d.data[d.mask]=np.sign(phi[d.mask])*bandwidth
d=d.data
Could you test this on your application? If everything looks OK I will
push out a release.
Thanks,
Jason
On Tue, Feb 23, 2016 at 2:13 PM, Adrian Butscher
>
https://groups.google.com/d/msgid/scikit-fmm/CABPx5hHgGrhfymuRiE5O4kB%2BY7WbPqmu_mTJtJvykcdS7CPQNg%40mail.gmail.com.