A residual is the difference between the Z value in a data file and the interpolated Z value on a gridded surface.