next up previous
Next: Side-effects of Changing the Unit attribute
Up: The Unit Attribute
Previous: The Unit Attribute

The Syntax for Unit Strings  

Conversion between units systems relies on the use of a specific syntax for the Unit attribute. If the value of the Unit attribute does not conform to this syntax, then an error will be reported if an attempt is made to use it to determine an inter-unit Mapping (this will never happen if the Unit attribute is passive ).

The adopted syntax is that described in FITS-WCS paper I "Representation of World Coordinate in FITS" by Greisen & Calabretta. We distinguish here between ``basic'' units and ``derived'' units: derived units are defined in terms of other units (either derived or basic), whereas basic units have no such definitions. Derived units may be represented by their own symbol (e.g. ``Jy''--the Jansky) or by a mathematical expression which combines other symbols and constants to form a definition of the unit (e.g. ``km/s''--kilometres per second). Unit symbols may be prefixed by a string representing a standard multiple or sub-multiple.

In addition to the unit symbols listed in FITS-WCS Paper I, any other arbitrary unit symbol may be used, with the proviso that it will not be possible to convert between Frames using such units. The exception to this is if both Frames refer to the same unknown unit string. For instance, an axis with unknown unit symbol "flop" could be converted to an axis with unit "Mflop" (Mega-flop).

Unit symbols (optionally prefixed with a multiple or sub-multiple) can be combined together using a limited range of mathematical operators and functions, to produce new units. Such expressions may also contain parentheses and numerical constants (these may optionally use ``scientific'' notation including an ``E'' character to represent the power of 10).

The following tables list the symbols for the basic and derived units which may be included in a units string, the standard prefixes for multiples and sub-multiples, and the strings which may be used to represent mathematical operators and functions.

 
Figure: An over-complex compound Mapping, consisting of PermMaps, ZoomMaps and a UnitMap, which can be simplified to become a single UnitMap. The enclosing nested CmpMaps have been omitted for clarity.
Basic units
Quantity Symbol Full Name
length m metre
mass g gram
time s second
plane angle rad radian
solid angle sr steradian
temperature K Kelvin
electric current A Ampere
amount of substance mol mole
luminous intensity cd candela

Derived units
Quantity Symbol Full Name Definition
area barn barn 1.0E-28 m**2
area pix pixel  
area pixel pixel  
electric capacitance F Farad C/V
electric charge C Coulomb A s
electric conductance S Siemens A/V
electric potential V Volt J/C
electric resistance Ohm Ohm V/A
energy J Joule N m
energy Ry Rydberg 13.605692 eV
energy eV electron-Volt 1.60217733E-19 J
energy erg erg 1.0E-7 J
events count count  
events ct count  
events ph photon  
events photon photon  
flux density Jy Jansky 1.0E-26 W /m**2 /Hz
flux density R Rayleigh 1.0E10/(4*PI) photon.m**-2 /s/sr
flux density mag magnitude  
force N Newton kg m/s**2
frequency Hz Hertz 1/s
illuminance lx lux lm/m**2
inductance H Henry Wb/A
length AU astronomical unit 1.49598E11 m
length Angstrom Angstrom 1.0E-10 m
length lyr light year 9.460730E15 m
length pc parsec 3.0867E16 m
length solRad solar radius 6.9599E8 m
luminosity solLum solar luminosity 3.8268E26 W
luminous flux lm lumen cd sr
magnetic field G Gauss 1.0E-4 T
magnetic flux Wb Weber V s
mass solMass solar mass 1.9891E30 kg
mass u unified atomic mass unit 1.6605387E-27 kg
magnetic flux density T Tesla Wb/m**2
plane angle arcmin arc-minute 1/60 deg
plane angle arcsec arc-second 1/3600 deg
plane angle mas milli-arcsecond 1/3600000 deg
plane angle deg degree pi/180 rad
power W Watt J/s
pressure, stress Pa Pascal N/m**2
time a year 31557600 s
time d day 86400 s
time h hour 3600 s
time yr year 31557600 s
time min minute 60 s
  D Debye 1.0E-29/3 C.m

Prefixes for multiples & sub-multiples
Sub-multiple Name Prefix Sub-multiple Name Prefix
10-1 deci d 10 deca da
10-2 centi c 102 hecto h
10-3 milli m 103 kilo k
10-6 micro u 106 mega M
10-9 nano n 109 giga G
10-12 pico p 1012 tera T
10-15 femto f 1015 peta P
10-18 atto a 1018 exa E
10-21 zepto z 1021 zetta Z
10-24 yocto y 1024 yotta Y

Mathematical operators & functions
String Meaning
sym1 sym2 multiplication (a space)
sym1*sym2 multiplication (an asterisk)
sym1.sym2 multiplication (a dot)
sym1/sym2 division
sym1**y exponentiation (y must be a numerical constant)
sym1^y exponentiation (y must be a numerical constant)
log(sym1) common logarithm
ln(sym1) natural logarithm
exp(sym1) exponential
sqrt(sym1) square root


next up previous
Next: Side-effects of Changing the Unit attribute
Up: The Unit Attribute
Previous: The Unit Attribute

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
R.F. Warren-Smith & D.S. Berry
30th April 2003
E-mail:ussc@star.rl.ac.uk

Copyright (C) 2003 Central Laboratory of the Research Councils