On 2010-04-19 22:21-0500 Maurice LeBrun wrote:

> On Monday, April 19, 2010 at 15:22:14 (-0700) Alan W. Irwin writes:
> > On 2010-04-19 13:47-0700 Ed Zaron wrote:
> >
> > > Hi All,
> >
> > > I've been using plplot for a project where we have to plot so-called
> > "co-tidal charts" which display the amplitude and phase of the tide in the
> > ocean. The amplitude is normally shown with a color image (made with
> > plimage), and the phase is shown with contours (using the fortran interface,
> > plcon1).
> >
> > > As you may know, contours of phase data have jumps where the phase wraps
> > around, say, the 0/360 degree reference phase. This leads to situations in
> > contour plots where the phase is contoured nicely, except where these jumps
> > occur. Within the jump, all the contour lines are packed into the jump. This
> > is an unavoidable consequence of trying to contour phase in 2-d, whenever
> > the field has zero amplitude points (so-called, amphidromes, in the tidal
> > context) where the phase is undefined.
> >
> > > I've attached a little patch to plplot/src/plcont.c from a freshly checked
> > out source distribution (r10926). I wonder if you might consider adding a
> > new subroutine to the plplot library, say, plcont_phase, which would
> > correctly represent phase contours without the jumps?
> >
> > Hi Ed:
> >
> > I haven't looked at your patch, but I assume it processes phase data to
> > impose phase continuity so that after processing you end up (in general)
> > with a continous phase range from -M*360 deg to N*360 deg which is easy to
> > contour.
> >
> > Assuming your patch does something like that, the question which I would
> > like you to discuss further is whether this is of sufficient usefulness to
> > PLplot users to add this functionality to our API for all the languages we
> > support or whether this straightforward processing to impose phase
> > continuity should be done by individual users before they call PLplot with
> > their (now) continuous phase data.
>
> I agree with Alan, AFAICT the phase transformation can & therefore should be
> done in user space.  I suggest a suitable wrapper function on your end, to
> copy and transform the data as necessary.
>
> Note, people doing polar plots (shades or contours) have to similarly massage
> their data before passing it to plplot in order to pick up the continuity
> condition at angle 0 = 2pi.  One could claim this is an important effect for
> the library to handle natively, but frankly I've never seen the need,
> preferring a leaner and more easily maintained API.  This is illustrated
> (rather quietly) in the final (polar) plot of example 16, where the angle
> coordinate value runs from 0 to 2pi inclusive -- providing a duplicated data
> point to enforce continuity.

Hi Ed:

Let me add a bit more to what Maurice said by talking about a specific
example. Suppose the function you are plotting is theta(x,y), where theta =
arctan2(y, x) In this (simple) case, there is obviously a 2 pi discontinuity
in theta at +/- pi.  For lack of a better term, let's call that an
angle range discontinuity.

I don't have a lot of experience with the plcont API, but I know it is quite
general and the "Contour and Shade PLot" section of our documentation at
http://plplot.sourceforge.net/docbook-manual/plplot-html-5.9.5/contour-plots.html
says the following:

"Examples of the use of these transformation routines are given in
examples/c/x09c.c, examples/c/x14c.c, and examples/c/x16c.c. These same
three examples also demonstrate a user-defined transformation function
mypltr which is capable of arbitrary translation, rotation, and/or shear. By
defining other transformation subroutines, it is possible to draw contours
wrapped around polar grids etc."

It appears to me that last sentence is stating the user-defined
transformation function is the proper way to deal with contouring of angular
data with range discontinuities like the simple example above.  The same
approach may allow you to deal properly with your more general case of a
phase range discontinuity occuring at arbitrary curves in the x, y, plane.
Maurice, do you agree or was there something else you had in mind?

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to