0

I have Lat, Lon, and NO2 data that are gridded. I'm trying to select a few points from this data and interpolated out some data/a plot, comparing how this interpolated data/plot improves as I interpolate it.

My data is as follows:

Lat is size 336x264 Lon is size 336x264 NO2(:,:,1,12) (the variable I'll be using) is size 336x264, with the first two dimensions being lat and lon respectively.

As an example lat(1,1), lon(1,1), and NO2(1,1,1,12) correspond.

Currently, to interpolate this data I'm using the code:

plot(interpn(lat(100:130),lon(100:130),no2(100:130,100:130,1,12),lat,lon,'cubic interpolation'))

Currently, to interpolate this data I'm using the following code to try to interpolate an entire figure using only the data in the grid in locations 100 to 130 in both axes.

plot(interpn(lat(100:130),lon(100:130),no2(100:130,100:130,1,12),lat,lon,'cubic interpolation'))

My current result is the following figure:

enter image description here

I would prefer to yield something similar to this figure, which is an actual map of the correct plot of

 geoshow(lat,lon,NO2(:,:,1,12),'DisplayType','Surface')

enter image description here

I have two serious questions:

  1. Am I selecting the data right? Probably not, so if not how would I specify only 100->130 of all of the gridded data and interpolate from those?
  2. How can I interpolate to yield a similar result? Am I using the wrong commands for this purpose?

Thank you!

Taylor
  • 89
  • 1
  • 11
  • 1
    Have you tried `interp2` instead of `interpn`? That's the function for interpolation of 2-D gridded data, which is what it looks like you've got here. – Andrew Janke Apr 21 '19 at 12:38
  • I have! Interp2 yields the same result. I'm kind of interested in using interp3... potentially? But I'm not entirely sure what "v" stands for in Vq = interp3(X,Y,Z,V,Xq,Yq,Zq) – Taylor Apr 21 '19 at 15:06
  • 1
    It stands for "Value", I think: X, Y, and Z are the independent variables in the 3-D space, and V contains the dependent variable's value at the points of the grid defined by X, Y, and Z. – Andrew Janke Apr 21 '19 at 15:09
  • 1
    Any chance you could post a MAT file with your `lat`, `lon`, and `NO2` data so we can play along and help to debug this? – Andrew Janke Apr 21 '19 at 15:10
  • @AndrewJanke Thank you for your help. I forgot to mention you helped me resolve my issue with your comments. Thank you for sending me down the right path. – Taylor Apr 30 '19 at 18:25

0 Answers0