Re: Questions about Contour2D class

Hi David,

>       My name is David Hladky.  I am an Air Force contractor working on an
> interactive, web based meteorological data viewer.  We have been adapting
> NCAR/RAP's ADDS software for use here at AFWA.  We have successfully
> integrated an EJB data interface to ADDS for connection to AFWA's extensive
> meteorological data sources.  Geo locatable point data has been pretty
> straight forward.  Enough about what I am doing though.  In the ADDS code
> they are using VisAD utilities, in particular Contour2D to draw contours.
> They are feeding a proprietary data set called MDV into the Contour2D class
> so it is nothing like it appears to be in your VisAD source.  I would like
> to redo it so that it uses your (more generalized) mode of data collection.
> I am a little confused with the public constructor for Contour2D though.

First, VisAD is copyrighted under the LGPL, which means a
non-freeware package can use it as a library but cannot use
bits of code taken from VisAD. Thus if you are digging into
the details of Contour2D in order to modify it, you can only
do that if all the software that will use the modified code
is copyrighted under the LGPL or GPL.

But it sounds like you want to use VisAD closer to the way
it is intended, than the way ADDS uses it. To use VisAD as
intended you don't have to know about Contour2D. When you
say "your (more generalized) mode of data collection" it
sounds like you are referring to getting your proprietary
MDV data into equivalent VisAD Data objects (probably
construct FlatFields or FieldImpls of FlatFields from your
MDV data). Ugo's tutorial and our other documents can
probably help you. Also, you can address specific questions
to this mailing list.

I will take a crack at your specific questions about Contour2D:

> . . .
>   public static void contour( float g[], int nr, int nc, float interval,
>                       float lowlimit, float highlimit, float base,
>                       float vx1[][], float vy1[][],  int[] maxv1, int[]
> numv1)
>
>    The way I understand this is that "g" is the array of values to contour,
>     I am not quite sure what nr and nc are though.  If g is a one
> dimensional array, why
>     do I care how many rows and columns it has?  Am I reading to much into
> this?

The g array is 2-D data laid out in a 1-D array - VisAD does a
lot of explicit indexing of 2-D and 3-D arrays. So the 'ic'
column and 'ir' row in g is g[ (ic) * nr + (ir) ], which you
can see in the Contour2D code.

>     vx1, vy1 two dimensional arrays mystify me though.  What are they?  I
> assume it has something to
>     do with geolocation.  Does the order go in lock step with g, per say (g,
> x,y) when you build the arrays?
>     That's what confuses me.  I don't understand why it's a two dimensional
> array if that's the case.

vx1 and vy1 are 2-D arrays to allow the contour() method to
change their sizes and return the variable-sized arrays back
to the caller. They are dimensioned float[1][numv1[0]]. Note
numv1 is dimensioned int[1] so it can be used to return an
int value to the caller.

My best advice is to do things in the standard VisAD way, as
described in Ugo's tutorial, and forget about Contour2D.

Good luck,
Bill


  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: