Enter a ZIP code to get a forecast:
Setup Location

WRN Logo

Unit Conversion File (unit.lup)

WXP offers the ability to change the units of a variable prior to plotting.  Each variable has a specific unit associated with it when it is read in from the raw or converted data file.  When a new unit is specified, the units.lup file is searched for a combination of the old and new units and performs the appropriate conversion.


 Each line in the file represents a different unit conversion. The format of each line is:

old_unit   new_unit  conversion


  • old_unit -- The original units (ie F)
  • new_unit -- The final units (ie C)
  • conversion -- The conversion factor to use (ie *.55555-17.7777)

The old and new units are specified as character strings typical for those units such as "m/s" and "C".  The units are case insensitive.  Once the conversion is done, the variable now has the new units label attached to it which is carried to new computations.

The conversion is a "y=mx+b" setup.  The slope is preceded by a "*" and the intercept is preceded with a "+" or "-". Only one of the two are necessary.  If the slope is missing, it is assumed to be 1 and the intercept is assumed to be 0. For example a conversion from Fahrenheit to Celsius (C=.55555*F-17.77777) would look like:

   F    C    *.55555-17.77777

The units file is then a set of possible conversions.  More may be added if needed.  If a conversion is not listed, the units are changed but the value remains the same.


A sample of the file is as follows (comment lines are preceded with a "#"):

#  Temperature
#    F - fahrenheit
#    C - Celsius
#    K - Kelvin
F       C       *.55555-17.77777
F       K       *.55555+255.37222
C       F       *1.8+32
C       K       +273.15
K       F       *1.8-459.67
K       C       -273.15
dF      dC      *.55555
dF      dK      *.55555
dC      dK      *1
dC      dF      *1.8
dK      dC      *1
dK      dF      *1.8              

NOTE: there is a distinction between C and dC.  dC values represent difference values such as dewpoint depression or lifted index.  The conversion to difference in K (dK) would be different from the conversion of C to K.  This is reflected in this notation.


For further information about WXP, email technical-support@weather.unisys.com
Last updated by Dan Vietor on August 11, 1998