RE: determining if field is "index"

Hi Curtis,

The problem is that I can't tell which integer value the input field
called "index" has. If I knew what integer value represented the input
field "index" (the field called index *not* an index into an array),
then I would be able to just check if it was mapped to the range value
of "iso-contour." So the problem is that I can't tell what integer numer
represents the field called "index". 

This is all before I've ever set up a ScalarMap of a RealType and
DisplayRealType. I'm wondering if there is such a way to know what
integer value "index" is once the data file is loaded in or sometime
before the scalar map is constructed.

Thanks,
Michelle

Michelle Kam           (408) 742-2881
Lockheed Martin Space Systems Co. SSM/ATC/MSIS
B/153 O/L922 
1111 Lockheed Martin Way, Sunnyvale, CA 94089




-----Original Message-----
From: Curtis Rueden [mailto:curtis@xxxxxxxxxxxxx]
Sent: Thursday, July 31, 2003 2:22 PM
To: Kam, Michelle C
Subject: RE: determining if field is "index"


Hi Michelle,

Let me get this straight: you have an array of ScalarMaps, and you want
to
know which ScalarMap in the array is a mapping from "index" to
something?

What is wrong with iterating through your array, looking for the correct
map?  This is only O(N) complexity where N is the number of mappings,
and
I highly doubt you have more than 10-15 mappings at most!

If you *must* determine the index in advance, then when you are creating
the mappings, save an integer indicating where the index mapping is.

Unless I am misunderstanding your question, this is a basic programming
problem with a very simple solution; not a VisAD problem.

-Curtis

At 12:52 PM 7/30/2003, Kam, Michelle C wrote:
>I setup an array of mappings of input fields like q1, q2, x, to a
>corresponding integer value for a Visad parameter like flow1azimuth,
>xoffset, etc. Do you know of a way to determine which array index in my
>array of mappings the "index" field would be? This may not be possible,
>but is there a way to extract the MathType of the input field "index"
in
>VisadAPI before my other method in a different class is called? If I
can
>somehow determine that integer number, I can then index into that spot
>in my array of mappings and check if the value there matches the
integer
>value for "iso-contour".
>
>Thanks,
>Michelle


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