extrapolate to min point between grid points using slope trends
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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.
0 Commenti
Risposta accettata
Jamie Rodgers
il 24 Giu 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 Commenti
Più risposte (2)
Jamie Rodgers
il 24 Giu 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!
0 Commenti
Vedere anche
Categorie
Scopri di più su Interpolation in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!