Re: [idvdevelopers] converting units

Hi Stuart-

Use the TextDisplayable.setDisplayUnit(Unit) method.  You can use
ucar.visad.Util.parseUnit("Celsius") to create the unit.  Just
remember that "C" is Coulomb. ;-)

Don

Stuart Maclean wrote:
I am am reading a netcdf model grid into a GeoGrid, and then on via a GeoGridAdapter into a IDV Displayable object. My data is t,y,x -> temperature, where the raw values are in Kelvin.

I am using IDV's TextDisplayable to do an IDV like 'Value Plot'. I would like to display some other unit, i.e Celsius, for the text values.

I suspect there is a very simple way to do this, I just cannot find it in the javadocs ;)

A brute force way would be to construct a new FlatField, populate its domain with that from the original, build a new realType for tempCelsius and scale over from the original tempKelvin, and use the second FlatField for the TextDisplayable...

Any help appreciated

Stuart
_______________________________________________
idvdevelopers mailing list
idvdevelopers@xxxxxxxxxxxxxxxx
For list information, to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/

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



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