0

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?

AaronJPung
  • 1,105
  • 1
  • 19
  • 35
  • Why is the X,Y grid `more regular`? Is there no linear dependency between the latitude and the X? Even if the formula is nonlinear, you should be able to calculate backwards from each X to each latitude. – roadrunner66 Mar 30 '16 at 22:49
  • You may want to look at both `basemap` and `pyresample`. As a note, `pyresample` also makes use of `basemap`. – Vorticity Mar 30 '16 at 22:50
  • Roadrunner - the lat,lon data comes from detector position, so there's no dependence. Plus, it means I'm working with scattered data. This is tge reason for the interpolation. – AaronJPung Mar 30 '16 at 23:13

0 Answers0