20001108: vector fields - locarithmic scale

>From: Bill Hibbard <hibbard@xxxxxxxxxxxxxxxxx>
>Organization: SSEC
>Keywords: 200011081434.eA8EY2427156

Hi Bill and Patrick-

>There are examples of this in the MetApps source that Unidata
>recently released.  Perhaps someone from Unidata can point you
>into the code more specifically.

Look at the source for ucar.unidata.view.geoloc.MapProjectionDisplay. 
(available at
http://www.unidata.ucar.edu/community/committees/metapps/SoftwareDownload.html)

In the private method setDisplayTypes(), the DisplayTupleType
is created. In this class, a new one is created every time a new map
projection (CoordinateSystem) is created. If you always knew which
axis you wanted to be logarithmic, then you would just create the
coordinate system once that did the appropriate transformation to
logarithmic values, create the new DisplayRealTypes and make the
DisplayTupleType with the coordinate system. Then map your RealTypes to
the DisplayRealTypes accordingly.

One class that might help is visad.CartesianProductCoordinateSystem (CPCS)
which allows you to "combine" coordinate systems.  So you could
create a LogarithmicCoordinateSystem that would just take the log
of the input values, and use that in creating the CS to use with
the DisplayTupleType.  So, if you wanted the Z axis to be logarithmic,
you could create a TrivialCoordinateSystem that would take an array
of xy values and return those back as is (toReference and fromReference
just return the input array), create a CartesianProductCoordinateSystem
with TrivialCS and LogCS, create new DisplayRealTypes for the
X, Y and Z axis (calling them something other than XAxis, YAxis and ZAxis),
and then create the new DisplayTupleType with the CPCS.  Then map
whatever RealType you want to be logarithmic to the new Z DisplayRealType,
and whatever you don't want to be logarithmic to the new Y and X axis
DisplayRealTypes.

You could make this more general so you could pass in which Axis you
wanted logarithmic (or an array of DisplayRealTypes for more than
one) and have the CPCS created with the appropriate combinations of
TrivialCS's and LogarithmicCS's. Even better, you could create a
class (subclass of DisplayImpl) that would automatically generate the
appropriate DisplayTupleType given inputs of spatial DisplayRealTypes
and the CoordinateSystems you want associated with each axis.  

VisAD should probably have a TrivialCoordinateSystem in the core.  In my
copious amounts of spare time, maybe I'll code that up. ;-)

If you still have questions about this, let me know.

Don
*************************************************************
Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307
*************************************************************
Unidata WWW Server               http://www.unidata.ucar.edu/
McIDAS Demonstration Machine  http://mcdemo.unidata.ucar.edu/
*************************************************************


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