I do seismic processing, and recently have been moving into doing contours.
I have watered down my problem so that I can understand from 'first principles'. I have checked out Creating contours for specific elevations as well, since it is similar.
Input: I have a uniformly sampled 2-dimensional (x,y) spatial grid, of size M by N. I have P random points within the grid, making up say, 1% of all the M*N points. Each of those points has a positive z value. All the rest of the points are at z=0.
Output: Based on this information, I would like to know, from an algorithmic / signal processing perspective, the steps needed to make a contour plot.
My problem is somewhat nested:
My questions are the following:
Do I need to first perform a 2D interpolation of my data, so as to fill up all those z=0 values, as a necessary pre-processing step before being able to make a basic contour plot?
1a. If that is the case, then how does one do this 2D interpolation? I am familiar with linear regression, but it seems from my trials that this was not adequate. Nearest neighbours interpolation also does not seem like it would yield good looking contours.
If a 2D interpolation is not a necessary pre-processing step before being able to make a contour, then how exactly, from an algorithmic perspective, are those z=0 values being filled? It seems to me that this is totally necessary first, and if so, I would like to know how this is done.
I am very new to contouring.