Hello all,
I have written a code in which the final aim is to provide contour map outlining frost depth on Alaska sate. For each weather station having specific lat. and long., I have estimated the probability that frost depth exceeds 1, 2 ,3, 4, and 5 feet (The first and second columns of "POFDE" are latitude and longitude respectively and columns 3 to 7 are showing the probability that frost depth exceeds 1 to 5 feet respectively) . Hence, I want to draw 5 contour maps, each showing the probabilties exceeding the mentioned depths. To do this, it is required to create a mesh on Alaska map and use scatteredInterpolant function to do interpolation between all existing weather station for which I estimated the probabilities. Can anyone help me in this regard?
In the code below, I created a mesh on a rectangular extending from minimum longitude to maximum longitude in the X direction, and from minimum latitude to maximum latitude in Y direction. However, that would cause to have contour lines in the water which is not acceptable.
Please use 'tl_2018_02_anrc.shp' file located in the shared zip folder for superimposing Alaska map. POFDE is also attached here.
S=shaperead('tl_2018_02_anrc.shp','UseGeoCoords',true);
X=linspace(-179.148909,-130.1,1500);
Y=linspace(51.214183,71.365162,1500);
[lon,lat] = meshgrid(X,Y);
for i = 1:(size(data, 2)-2)
geoshow(S,"DisplayType","multipoint")
xlim([-179.148909,-130.1]);
ylim([51.214183,71.365162]);
I = scatteredInterpolant(data(:,[1 2]), data(:,i+2));
I.ExtrapolationMethod='linear';
contourm(lat,lon,min(1,max(0,I(lat,lon))))
title(['The probability of frost depth exceedance of \Omega_{\delta} = ' num2str(i) ' feet'])
exportgraphics(gca, sprintf('FrostPlot_%d_feet.png', i))