extrapolate to min point between grid points using slope trends

2 vues (au cours des 30 derniers jours)
Nina
Nina le 23 Juin 2012
I have a lat/lon grid with height values at each evenly spaced grid point. My grid has a minimum height value at its center grid point, but I want to extrapolate to the minimum height (and associated lat/lon) that lies somewhere between grid points based on the slope trends about the minimum central point.
My first thought was to use surf(lon,lat,height) to fit a surface and then find where the second derivative is >0 for the local min, though as I understand the surf function would use the minimum height of my grid as the minimum height of the surface and not extrapolate to a lower value than what appears on the grid.
Is there a matlab function or recommended process to extrapolate to a minimum point on a grid based on the surrounding slope trends? Thank you.

Réponse acceptée

Jamie Rodgers
Jamie Rodgers le 24 Juin 2012
Do You have the curve fitting toolbox?
If so:
Possible Strategy: use 'fit' to create a 'fit object' using a suitable input array and a selected fit type, then apply this to an output array ofthe required precision in the Region of interest. (You could arrive at this by a coarse uninterpolated min) Then simply take the 'min' and index
e.g. here is a surface with a minimum - at lowish resolution
[lat,lon]=meshgrid([-10:1:10],[-5:1:5]);
height=((lat-3.65).^2+(lon+2.22).^2+lat.*2)+0.251;
surf(lat,lon,height);
hold on
Now create a surface fit object to the surface
myfit = fit( [lat(:), lon(:)], height(:), 'poly23', 'Robust', 'LAR' );
I have selected a poly23 interpolation
There are other options. Use 'doc fit' to explore
now apply 'myfit' in the region you want to interpolate at high resolution: in this case between where lat =1 and 3 and lon = -3 and -1
[Newlat,Newlon]=meshgrid(1:1e-3:3,-3:1e-3:-1);
newheight=myfit([Newlat],[Newlon]);
Take the minimim from this interpolation
minheight=min(min(newheight));
index to find lat and lon that correspond,
[r,c]=find(newheight==min(minheight));
interpolated_min=[Newlat(r,c),Newlon(r,c),minheight];
bullseye!
scatter3(interpolated_min(1),interpolated_min(2),interpolated_min(3),'ro','filled')
  4 commentaires
Walter Roberson
Walter Roberson le 24 Juin 2012
somehow it got flipped back again. I fixed it again.
Nina
Nina le 24 Juin 2012
Thanks, Jamie. Will give it a go. Just to verify, this approach should allow me to obtain an extrapolated of the surface minimim that could be lower than my lowest gridpoint value?

Connectez-vous pour commenter.

Plus de réponses (2)

Nina
Nina le 29 Juin 2012
Here is how I actually ended up solving this problem and interpolating to values lower than the range of my gridded data. Used function griddata and a cubic interpolation. As I am new to this forum, I do not know how the formatting works, apologies! Just wanted to share this solution for anyone else who may need it!
figure
[loni,lati]=meshgrid(lonmin:0.25:lonmax,latmin:0.25:latmax); %where lonmin, latmin are the min,max values of original gridded data and 0.25 is the step between them used to create the finer scale grid [loni,lati]
heighti=griddata(testplot(:,1),testplot(:,2),testplot(:,3), loni,lati,'cubic'); %heighti=interpolated height values; testplot(:, 1, 2, and 3) are lon, lat, height values
surf(loni,lati,heighti); %creates surface from interpolated values
xlabel('Longitude'),ylabel('Latitude'),zlabel('Height (gpm)');
minz=min(testplot(:,3)); %min value of gridded height field=5370 gpm in this example
minzi=min(min(heighti)); % min value of interp height field=5336 gpm
[a,b]=find(heighti==minzi); %find indicies of (lon,lat) for min height on interpolated grid

Jamie Rodgers
Jamie Rodgers le 24 Juin 2012
Nina,
Yes it most certainly can - BUT this will depend upon the type of surface fit you employ: Also you need to be aware that if you do higher polynomial fits based on inputs that are too far away from the ROI, strange results may be seen. Choose a fit that gives good agreement (see documentation) and be sensible in creating the fit from the data near the ROI... Not much point in trying to extrapolate the height of Everest from a contour map of Scotland!

Catégories

En savoir plus sur Interpolation dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by