I have (lonvec, latvec, altvec) data, extracted from an dataset based on an equirectangular projection. I am converting the coordinates to (xvec, yvec, altvec). I'm using this data for an interpolation using:
X = np.linspace(xvec.min(), xvec.max(), 300)
Y = np.linspace(yvec.min(), yvec.max(), 300)
Z = np.linspace(zvec.min(), zvec.max(), 300)
X2, Y2 = np.meshgrid(X, Y)
interp = scipy.interpolate.LinearNDInterpolator(cartcoord, mesvec0, fill_value=0)
Z0 = interp(X2, Y2)
At this point, I have a meshgrid of (xvec,yvec) points, and interpolated dataset (Z0). Each of these variables (X2, Y2, and Z0) are two dimensional.
I want to keep the interpolated points (and their corresponding x,y location), while transforming the x,y coordinates back to lat,lon coordinates before displaying the final image. The final image should be (lat, lon, alt). The reason for doing the transform from (lat,lon) to (x,y), is to provide a more regular grid for the LinearNDInterpolator to take place over. What would be a good way to do this?