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

Re: [idvusers] issue

Hi Luis-

What version of the IDV are you using?

Luis Del Castillo wrote:
I have a variable  tgk is ground temperature in kelvins how can i change the 
values from kelvin to celcius if I havent a value in the Change display unit.

Was this from a newCDF file or some other source?  It sounds like
the unit was not specified in the file if there is no Change Unit
menu.

If it is a netCDF file, you could wrap it with NcML like the following:

<?xml version="1.0" encoding="UTF-8"?>
<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2"; location="your_filename_here">
  <variable name="tgk">
    <attribute name="units" value="K" />
  </variable>
</netcdf>

Put that in a text file with an extension of .ncml (e.g. fixunits.ncml),
change "your_filename_here" to the name of the file and place it in the
same directory as the file.  Then open the NcML file in the IDV.

Alternatively, you can use the Miscellaneous->Change unit formula to
set the initial unit on the field.  Select the Formulas Data Source,
then the Miscellaneous->Change unit formula and the type of display
you want.  Then when prompted, give the name of the field (tgk) and
the unit (K) and when prompted, select the field from the list.
Then you can use the Edit->Change Unit menu in the display control
to change it to Celsius.  You'd have to do this for each display,
so the NcML solution is more global.

Or, if you have control over the writing of the file, make
sure the units are specified in the file.

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



 
 
  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