[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: syntax for expressing millibar (fwd)



------- Forwarded Message

Date:    Tue, 27 May 2003 16:28:55 -0600
From:    Russ Rew <address@hidden>
To:      Janine Goldstein <address@hidden>
Subject: Re: syntax for expressing millibar 

Janine,

> I have scoured the udunits page, and it is unclear to me how to add
> magnitudes to a unit, i.e. millibars. Should it be mbar, millibar, m_bar?

Any of the following are acceptable and they are all equivalent: 
 mbar
 mbars
 millibar
 millibars
 hectopascal
 hectopascals
 100 kilogram meter-1 second-2

One way to easily try out udunits syntax and see what is acceptable is
to use the "udunits" utility program that comes with the package.
When you invoke udunits, it prompts with "You have:" and then with
"You want:", expecting you to give it units specifications.  You can
just hit Return for the "You want:" prompt and it will give you the
standard interpretation of the units specification you typed in or an
error message.  So, for example, here's how I determined the units
specs above were OK, and that "m_bar" was not legal:

 $ udunits
 You have: mbar
 You want: 
     Definition: "100 kilogram meter-1 second-2"
 You have: millibar
 You want: 
     Definition: "100 kilogram meter-1 second-2"
 You have: m_bar
 udunits: Don't recognize `m_bar'
 You have: mbars
 You want: 
     Definition: "100 kilogram meter-1 second-2"
 You have: millibars
 You want: 
     Definition: "100 kilogram meter-1 second-2"
 You have: hectopascals
 You want: 
     Definition: "100 kilogram meter-1 second-2"
 You have: hectopascal
 You want: 
     Definition: "100 kilogram meter-1 second-2"
 You have: 100 kilogram meter-1 second-2
 You want: 
     Definition: "100 kilogram meter-1 second-2"

Note: to get this useful udunits program, you need to build it from
the udunits sources.  If you are on a Unix or Linux platform, this is
pretty easy, but I'm not sure if we have a prebuilt executable
available for a Windows system.  If that's what you need, I'll try to
find someone who's built it.

As far as acceptable prefixes for units, they are documented in the
man page reference documentation for the library

  http://www.unidata.ucar.edu/cgi-bin/man-cgi?udunits+-s3 

near the end:

                  Factor     Prefix     Abbreviation
                  ______   __________   ____________
                  1e24     yotta             Y
                  1e21     zetta             Z
                  1e18     exa               E
                  1e15     peta              P
                  1e12     tera              T
                  1e9      giga              G
                  1e6      mega              M
                  1e3      kilo              k
                  1e2      hecto             h
                  1e1      deca, deka        da
                  1e-1     deci              d
                  1e-2     centi             c
                  1e-3     milli             m
                  1e-6     micro             u
                  1e-9     nano              n
                  1e-12    pico              p
                  1e-15    femto             f
                  1e-18    atto              a
                  1e-21    zepto             z
                  1e-24    yocto             y

and udunits understands both the full prefix or the abbreviation.

--Russ

------- End of Forwarded Message