I’m looking at performing a pixel-aligned to node-aligned transformation in a program of mine, so i thought I’d first look at how GMT does it (since it does so many things well). My test script is
The results look good, in fact too good – the default interpolation is bicubic right? so I’d expect a lot more NaN propagation than that. Possibly grdsample -T uses a different default? I had a look around the source but couldn’t see anything obvious. Could anyone enlighten me (a reference to the literature and/or location in the source code)? Thanks in advance!
Yes, by default grdsample does a bicubic interpolation (man says so).
When I want to see what a program does I fire the debugger and hit F10 & F11 many times. For present case I think a good entry point is
Thanks Joaquim, that leads here, there is a link in that file (but it 404s), but it all looks pretty standard convolution kernel stuff, still I’m a bit puzzled by the lack of NaN propagation, possibly this is the reason:
Because of the size of the convolution kernels, these routines assume that
the grid is padded with appropriate (periodic or natural) boundary conditions
that assumption seems to be applied non-explicitly, would that be a reasonable summary?
Your case is probably caught up in an ongoing bug situation you can read about here. I can certainly see why you might get a NaN on the right side. I would use another interpolator tha nbicubic here, say bilinear.