Re: display points using log scale

Hi Celine-

I'm travelling and don't have time to do this justice, but
here's my take on it.  I have not been able to follow your
code in detail, but here's my take on it.  You have some
X or Y values.  You can use X or Y for those real types.
For the Log values, you can create a RealType (e.g. LogX,
LogY) which is used for the reference realtype of the
LogCoordinateSystem.  VisAD automatically does the calculations
converting the values to the log values.  What you have below
looks like you are trying to go the other way.  Your Integer1DSet
has index as the reference of the CS so values of 0,1,2,3 will
get converted to the log of those values when index is mapped
to a scale.  I would think you would want it the other way.

Another question is are you removing the non-log scalar maps
when you switch to log displays and vice-versa?

Again, I'm travelling so may not answer until I get back.

Don


Celine Gestas wrote:
Thank you for your answer but there is no change : points are displayed but
not in the log scale, it keeps the default scale. What I changed is :

                       index = RealType.getRealType("index",
CommonUnit.promiscuous);
                       indexLog = RealType.getRealType("indexLog",
CommonUnit.promiscuous);                            // new RealType
                       referenceIndex = new RealTupleType(index);
                       LogCoordinateSystem logCSindex = new
LogCoordinateSystem(referenceIndex, base);
                       rangeIndex = new RealTupleType(indexLog, logCSindex,
null);                                              // use the new RealType
                       index_set = new Integer1DSet(rangeIndex,
x_vals[0].length, logCSindex, null, null);

2007/3/26, Bill Hibbard <hiding@xxxxxxxxx>:

 Hi Celine,

If someone has an idea ...

        RealTupleType rangeIndex = null;

       // create the index
        if (log.equals("logX") || log.equals("logY")
||log.equals("loglog")) {
index = RealType.getRealType("index", CommonUnit.promiscuous);
            RealTupleType referenceIndex = new RealTupleType(index);
            LogCoordinateSystem logCSindex = new
LogCoordinateSystem(referenceIndex, base);
            rangeIndex = new RealTupleType(index, logCSindex, null);
            index_set = new Integer1DSet(rangeIndex, x_vals[0].length,
logCSindex, null, null);
        }

I think the problem is that the RealTupleTypes referenceIndex and
rangeIndex are both
defined as (index), that is they are both a RealTupleType of the same
single RealType.
This may also explain the very mysterious Exception you reported in your
other recent
message to the list. Try using different RealTypes in the constructors for
referenceIndex
and rangeIndex.

Good luck,
Bill


--

 <http://a8-asy.a8ww.net/a8-ads/adftrclick?redirectid=en-mail_a_01>



--
*************************************************************
Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************


==============================================================================
To unsubscribe visad, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================


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