Grdfilter : Edge/Corner Handling

Respected Sirs,

Is the edge handling in the grdfilter module being done through -N i |p |r option? Which would mean that at the edges and corners when a part of the filtering window goes past the given grid bounds when sampling points near the corners/edges of the given grid, It would leave the portion which went outside the grid region i.e. “NaN values” will be ignored and the filtering convolution or calculation will only be done with the rest of the points that have “non-NaN” values. Eg of grid file being used :


The bounds of the gridfile being filtered is the red&blue part of the image outside of which all values will be NaN. The N option being used is -Nr

DOUBT: Is this the only way of edge handling implemented in the GMT grdfilter where effectively the total number of points used for calculation will decrease (or will it?) at the corners and edges than the given width of the filter window???

Yes, nothing magical happens when the filter circle gets towards the edges of your non-NaN grid and the number of nodes inside that are used goes down. It simply computes that weighted average based on what data it finds inside the circle. There are no boundary conditions applied since that would be very complicated. This is a spatial convolution.

I hoped for some Magic … (just joking :smiley:); actually needed to explain all aspects of the methodology being used here to Professor (My Ph.D. Thesis Supervisor) next week, so just needed to get a little confident about it.
Grateful for your constant replies.