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

udunits2 Program Guide

Table of Contents


Next: , Previous: (dir), Up: (dir)

udunits2

This manual describes how to use the udunits2 program. This program allows you to discover the definition of a unit as well as convert numeric values between compatible units.

CVS keywords: $Date: 2007/07/23 19:09:36 $, Revision: 1.3 $

Copyright © 2007 University Corporation for Atmospheric Research

Permission to use, copy, modify, and distribute this software and its documentation for any purpose without fee is hereby granted, provided that the above copyright notice appears in all copies, that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the University Corporation for Atmospheric Research (UCAR) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. UCAR makes no representations about the suitability of this software for any purpose. It is provided “as is” without express or implied warranty. It is provided with no support and without obligation on the part of UCAR to assist in its use, correction, modification, or enhancement.


Next: , Previous: Top, Up: Top

1 Synopsis

     udunits2 [-A|-L|-U] [-hr] [XML_file]


Next: , Previous: Synopsis, Up: Top

2 Options

The following options and arguments are supported:

-A
Use the ASCII character-set.
-L
Use the ISO Latin-1 (ISO-8859-1) character-set.
-U
Use the full Unicode character-set with UTF-8 encoding.
-h
Print a help message.
-r
Reveal any problems with the units database (by default, no error messages are printed during import of the database).
XML_file
The pathname of the XML-formatted units database. If not specified, then the default, compile-time pathname is used.


Next: , Previous: Options, Up: Top

3 Description

When successfully started, the program will print the prompt

     You have:

At this point you can exit the program by entering the end-of-file character (usually control-D) or continue by entering either a value or a unit. (a value comprises a numerical value and a unit. For example,

     You have: 80 km/h
     You want:

At this point, if you enter a blank line, then the program will assume that you entered a unit in the previous line and will print the definition of that unit in terms of the base units of the unit-system that it imported on startup. For example,

     You have: 80 km/h
     You want:
         22.2222222222222 m.s-1
     You have:

Details of the formatting depend on the character-set being used. See Options.

Alternatively, at the “You want:” prompt you can enter the unit in which you want the previously-entered value. For example,

     You have: 80 km/h
     You want: mi/h
         80 km/h = 49.7097 mi/h
         x/(mi/h) = 0.621371*(x/(km/h))
     You have:

The first line after “You want:” shows the “have” value in the desired “want” unit.

The second line shows the transformation between numerical values in the “have” unit to numerical values in the “want” unit. The symbol “x” represents the physical quantity in question. See http://physics.nist.gov/Pubs/SP811/sec07.html.


Next: , Previous: Description, Up: Top

4 See Also

See UDUNITS-2, for information on the UDUNITS-2 library, which is used by this program.


Previous: See Also, Up: Top

Index

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of 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