Re: unit conversion in VisAD

Stuart,

I think that, in general, it's a good idea to know beforehand what the
output or display units of a quantity should be.  With this information,
one can set the display to use those units -- regardless of the actual
units of the values being displayed.  Also, it allows for the
possibility of user-input on desired output units.  It means, however,
that you must know the quantity that's being displayed -- something
that's not always possible, especially if the quantity was derived from
others via a mechanism that doesn't preserve such information.

>From: Stuart Wier <wier@xxxxxxxxxxxxxxxx>
>Organization: UCAR/Unidata
>To: Don Murray <dmurray@xxxxxxxxxxxxxxxx>
>Subject: unit conversion in VisAD
>Keywords: 200205161436.g4GEaAa17742

The above message contained the following:

> Making some computations in VisAD, for example in part
> dtdp = (FlatField) (dtdp.multiply( ((FlatField)absvor.getSample(i))) );
> 
> The results have values such as .002 and "units" 0.001 K m2 s-1 kg-1.
> 
> How can I get the results to have value 2 and "units" 0.000001 K m^2 s-1 kg-1?
> 
> Or values 2E-6 and units K m^2 s-1 kg-1?

Regards,
Steve Emmerson   <http://www.unidata.ucar.edu>