
7.8 COMPARISON OF METHODS AND POTENTIAL ARTIFACTS 213
7 SPATIAL DATA
[XI,YI] = meshgrid(420:0.25:470,70:0.25:120);
ZI = griddata(data(:,1),data(:,2),data(:,3),XI,YI,'v4');
v = -40 : 10 : 20;
contourf(XI,YI,ZI,v), colorbar, hold on
plot(data(:,1),data(:,2),'o'), hold off
e contours suggest an extremely smooth surface. In many applications,
this solution is very useful, but the method also produces a number of ar-
tifacts. As we can see from the next plot, the estimated values at the grid
points are o en beyond the range of the measured z-values.
plot(XI,ZI,'k'), hold on
plot(data(:,1),data(:,3),'o')
text(data(:,1)+1,data(:,3),labels)
title('Biharmonic Spline Interpolation'), hold off
is can sometimes be appropriate and does not smooth the data in the way
that bilinear gridding does. However, introducing very close control points
with di erent z-values can cause serious artifacts. As an example, we intro-
duce one reference point with a z-value of +5 close to a reference point with
a negative z-value of around –26.
data(79,:) = [450 105 5];
labels = num2str(data(:,3),2);
ZI = griddata(data(:,1),data(:,2),data(:,3),XI,YI,'v4');
v = -40 : 10 : 20;
contourf(XI,YI,ZI,v), colorbar, hold on
plot(data(:,1),data(:,2),'ko')
text(data(:,1)+1,data(:,2),labels), hold off
e extreme gradient at the location (450,105) results in a paired low and
high (Fig. 7.8). In such cases, it is recommended that one of the two control
points be deleted and the z-value of the remaining control point be replaced
by the arithmetic mean of both z-values.
Extrapolation beyond the area supported by control points is a common
feature of spline interpolation (see also Section 5.5). Extreme local trends
combined with large areas with no data o en result in unrealistic estimates.
To illustrate these edge e ects we eliminate all control points in the upper-
le corner.
[i,j] = find(data(:,1)<435 & data(:,2)>105);
data(i,:) = [];
labels = num2str(data(:,3),2);
plot(data(:,1),data(:,2),'ko'), hold on
text(data(:,1)+1,data(:,2),labels), hold off