Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

WG: How get range info from certain objects?

Hi Charles,

> I want to use the setRange method of ScalarMap to reverse the polarity

> of an axis, but first I need to know the max and min values of that 
> axis before I can reverse them. I have a GriddedSet being passed 
> into my procedure, which I assign to a DataReference, etc. If I then 
> do a System.out.println on the DataReference, I get a list 
> "DomainDimension 
> 1..."etc.
> that has the information I need, but I couldn't find what method 
> to call to extract the specific range in the form to use it in code,
> i.e. to alter and pass on to setRange.

You can get the ranges of your GriddedSet via its
computerRanges(RealType[] reals). This method is defined in Data so
every visad data objects contains it. It returns a double[][] whose
first index stands for the corresponding RealType in your reals array
and whose second index marks the min and max values.

Another way would be to get the ranges directly from your ScalarMap:

double[] range = scalarMap.getRange();
scalarMap.setRange(range[1], range[0]);

Hope that helps, Mathias


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690