From: sloan@cis.uab.edu (Kenneth Sloan)
Subject: Re: Contouring of curvilinear gridded data
Organization: CIS, University of Alabama at Birmingham
Date: Thu, 12 Nov 1992 21:07:17 GMT

In article <BxLy4q.C7M@news.cso.uiuc.edu> e-sink@uiuc.edu writes:
>OK, we've seen lots of messages about how to contour scatter data
>by gridding it first.

Indeed.  This is the "reduce it to a problem I already know how to
solve" method.  Alas - it's not at all clear that it's *easier* to
calculate the value of the surface at the regular grid points than it is
to simply contour the scattered data.  Note: many people already have a
large investment in software (which they may not have written, and may
not have source code for, nor time to rewrite the code) which only
understands regular gridded data.  They are completely justified in
taking the "reduce....solve" approach.

>..  My question now is about data that is
>already on a grid, but that grid is NOT rectilinear.
>...
>The idea behind a warped grid is that each data point can have an
>arbitrary X,Y position.  The X and Y values for adjacent data points
>on the grid should probably have some relationship, but they need not
>be rectilinear at all.

Clearly, the neighborhood information helps, and can be exploited.
Usually, such a grid consists of 4-sided patches, with the same
connectivity as a regular grid.  If so, It should be "easy" to generalize
"regular grid" code to work with the warped grid.  One cheap trick is to
ignore the X,Y values of the vertices and pretend that all of the grid
points *do* lie on a regular grid.  Produce the contours, and then warp
the contours back.  Whether this is useful or not depends on the
internal structure of the "contour a regular grid" code.  You may also
lose precision along the way - but that's the way "cheap tricks" go.
You could invent a fancy name for it...how about "parametric contouring"?

>...
>It would also be possible to represent this dataset as three columns,
>X, Y, and datavalues.  This would eliminate the spatial ordering and
>neighbor information, reducing it to scatter data.  However, then we
>could place the data on a uniform grid (assumedly with some loss of
>something) and contour it with normal methods.

Or...use a scattered data contouring program.

A middle ground is to resample your warped grid with a regular grid
pattern.  If you can do that for scattered data, you can certainly do it
(perhaps faster) using the warped grid as a guide.

>
>What is gained by contouring on the actual warped grid, rather than
>making scatter data out of it, and contouring the uniformly gridded
>version ?  Is this done very often ?  Is the algorithm difficult ?

Contouring on the warped grid is a variant of contouring on a
triangulated network constructed using scattered data.  The main
advantage is that you don't have to *construct* the neighborhood
information, and there may (I said *may*) be useful information in the
connectivity of the warped grid which will not be the same as, nor as
easy to find, if you throw it away and ask the scattered data code to
reconstruct the neighborhood info.  You may get different neighborhoods
for some points, and thus slightly different contours.  Which
neighborhoods are "best" depends on the particular problem.

Contouring the uniformly gridded data derived from either scattered data
or from the warped grid data has the advantage that you can re-use
MacContour(tm).  It has the disadvantage that you have to actually
produce the regular grid data values. 

Of course...if you *work* for MacContour(tm), you can take the recent flurry
of messages as "market demand" for a product which produces the same
pretty pictures from scattered data and warped grids as it does for
regular, rectangular grids.



-- 
Kenneth Sloan                   Computer and Information Sciences
sloan@cis.uab.edu               University of Alabama at Birmingham
(205) 934-2213                  115A Campbell Hall, UAB Station 
(205) 934-5473 FAX              Birmingham, AL 35294-1170