Hello dear ferret user community,
I see there is a great function "samplexy" for sampling point data from a 2D gridded field.
After looking around in the documentation for a little while, I couldn't find an example showing how one might perform the same sampling from a 3D field. I understand that this might be more complicated because interpolation becomes tricky in 3 dimensions.
Is there a similar function, or capability using a combination of functions, that allows the user to sample point data in 3D space?
Let's say I have three 1D columns of data, each holding lon (x), lat (y) and depth (z) coordinates. Because these are 1D columns corresponding to every location that I have sampled, they are x*y*z long. Now I have a gridded data set A that is in 3D at different coordinates. I understand that we can easily retrieve data from A at x and y points at each z level using "samplexy". Then I have a new data set, on a x*y by z grid, with data points that do not correspond to my x and y locations very usefully masked out. What I am finding difficult is to place this x*y by z dataset onto a x*y*z grid, which is equivalent to my 1D arrays of lon (x), lat (y) and depth (z).
I have tried "reshape", as per the example in the user guide documentation. This gives me my 1D column of x*y*z length, masked out at the right places. However, for some reason this command converts all the gridded data of A into zeros.
Any help would be very much appreciated. I'm sure someone out there has tried this before.