Questions about Contour2D class

Hello,

        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.

public class Contour2D {

  /**
   * Compute contour lines for a 2-D array.  If the interval is negative,
   * then contour lines less than base will be drawn as dashed lines.
   * The contour lines will be computed for all V such that:<br>
   *           lowlimit <= V <= highlimit<br>
   *     and   V = base + n*interval  for some integer n<br>
   * Note that the input array, g, should be in column-major (FORTRAN)
order.
   *
   * @param    g         the 2-D array to contour.
   * @param    nr        size of 2-D array in rows
   * @param    nc        size of 2-D array in columns.
   * @param    interval  contour interval
   * @param    lowlimit  the lower limit on values to contour.
   * @param    highlimit the upper limit on values to contour.
   * @param    base      base value to start contouring at.
   * @param    vx1       array to put contour line vertices (x value)
   * @param    vy1       array to put contour line vertices (y value)
   * @param    maxv1     size of vx1, vy1 arrays
   * @param    numv1     pointer to int to return number of vertices in
vx1,vy1
   */
  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?

   interval, lowlimit, highlimit, and base are all self explanatory.

    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.

    maxv1 is understandable if I know what vx1,vy1 are.
    numv1 I believe is the total number of rows in vx1 and vy1?

    If someone could just give a good definition of these things I am sure I
can make this work on my own.  I 
    am more of a meteorologist than a programmer, however I have been
programming Java for several years.
    So, be gentle.
   

        Thanks is advance for the great wisdom that will be dispensed.

Dave Hladky
AFWA / DNXT


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