/[volute]/trunk/projects/std-vounits/VOUnits.tex
ViewVC logotype

Diff of /trunk/projects/std-vounits/VOUnits.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2439 by norman.x.gray@gmail.com, Fri Feb 28 17:52:32 2014 UTC revision 2440 by norman.x.gray@gmail.com, Wed Mar 5 16:02:24 2014 UTC
# Line 396  Line 396 
396  A \textbf{symbol} is either a base symbol or a base symbol with a  A \textbf{symbol} is either a base symbol or a base symbol with a
397  scaling prefix.  scaling prefix.
398    
399  For example, in the unit of \unit{1.663e-1mm.s**-1}, the scalefactor  For example, in the unit of \unit{1.663e-1mm.s**-1}, the scale-factor
400  is $1.663\times10^{-1}$, the two unit-components are \texttt{mm}  is $1.663\times10^{-1}$, the two unit-components are \texttt{mm}
401  and \texttt{s**-1}; the first symbol has base symbol \texttt{m} and  and \texttt{s**-1}; the first symbol has base symbol \texttt{m} and
402  prefix \texttt{m} (for `milli'), and the second has base  prefix \texttt{m} (for `milli'), and the second has base
# Line 414  Line 414 
414  The purpose of this document is to provide a reference specification of how  The purpose of this document is to provide a reference specification of how
415  to write VOUnits, in order to maximize interoperability within the VO;  to write VOUnits, in order to maximize interoperability within the VO;
416  the intention is that VOUnit strings should be reliably  the intention is that VOUnit strings should be reliably
417  parseable by humans \emph{and} computers, with a single interpretation.  parsable by humans \emph{and} computers, with a single interpretation.
418  This is broadly the case for the other existing  This is broadly the case for the other existing
419  unit-string syntaxes, although there are some slight ambiguities in  unit-string syntaxes, although there are some slight ambiguities in
420  the specifications of these syntaxes (cf \prettyref{appx:grammar}).  the specifications of these syntaxes (cf \prettyref{appx:grammar}).
# Line 537  Line 537 
537  compare units for equivalence; for example, an application may or may  compare units for equivalence; for example, an application may or may
538  not wish to deem \unit{m/s} and \unit{km/s} to be `equivalent'.  not wish to deem \unit{m/s} and \unit{km/s} to be `equivalent'.
539  This Recommendation, similarly, does not specify how to compare units  This Recommendation, similarly, does not specify how to compare units
540  with scalefactors (cf \prettyref{sec:scaleFactors}).  with scale-factors (cf \prettyref{sec:scaleFactors}).
541  \end{itemize}  \end{itemize}
542    
543  \section{The VOUnits syntax (normative)\label{sec:proposal}}  \section{The VOUnits syntax (normative)\label{sec:proposal}}
# Line 639  Line 639 
639  \end{table}  \end{table}
640    
641  For masses, the SI unit is \unit{kg}. However, existing specifications  For masses, the SI unit is \unit{kg}. However, existing specifications
642  recommend not using scale factors with \unit{kg}, but attaching them  recommend not using scale-factors with \unit{kg}, but attaching them
643  only to \unit{g} instead.  only to \unit{g} instead.
644    
645  Recognising a known unit takes priority over parsing for prefixes.  Recognising a known unit takes priority over parsing for prefixes.
# Line 724  Line 724 
724    
725  \subsection{Scale factors\label{sec:scaleFactors}}  \subsection{Scale factors\label{sec:scaleFactors}}
726    
727  Units \norm{may} be prefixed by any of the 20 SI scale factors,  Units \norm{may} be prefixed by any of the 20 SI scale-factors,
728  and a subset \norm{may} be prefixed by the eight binary scale factors.  and a subset \norm{may} be prefixed by the eight binary scale-factors.
729  The SI scale factors -- provided in \prettyref{tab:vouscalefactors}a --  The SI scale-factors -- provided in \prettyref{tab:vouscalefactors}a --
730  are the same as those of \citet{si-brochure},  are the same as those of \citet{si-brochure},
731  of \citet[\S6.5.4]{std:iso80000-1},  of \citet[\S6.5.4]{std:iso80000-1},
732  and of \citet[Table~5]{pence10}  and of \citet[Table~5]{pence10}
# Line 785  Line 785 
785  The SI prefixes of \prettyref{tab:vouscalefactors}a \emph{\norm{must}  The SI prefixes of \prettyref{tab:vouscalefactors}a \emph{\norm{must}
786  always refer to multiples of 1000}, even when applied to binary units  always refer to multiples of 1000}, even when applied to binary units
787  such as bit or byte; this follows the stipulations (and clarifying note) of  such as bit or byte; this follows the stipulations (and clarifying note) of
788  \citet[\S3.1]{si-brochure}, and the proscription  \citet[\S3.1]{si-brochure}, and of \citet[\S6.5.4]{std:iso80000-1}.
 of \citet[\S6.5.4]{std:iso80000-1}.  
789  If data providers wish to use multiples of 1024 (ie, $2^{10}$) for  If data providers wish to use multiples of 1024 (ie, $2^{10}$) for
790  units such as bytes or bits, they \norm{must} use the the binary prefixes  units such as bytes or bits, they \norm{must} use the the binary prefixes
791  of \citet[\S4]{std:iec80000-13}, reproduced in \prettyref{tab:vouscalefactors}b  of \citet[\S4]{std:iec80000-13}, reproduced in \prettyref{tab:vouscalefactors}b
# Line 1132  Line 1131 
1131  The aspiration of the VOUnits work was that the syntax should be as  The aspiration of the VOUnits work was that the syntax should be as
1132  much as possible in the intersection of the various pre-existing  much as possible in the intersection of the various pre-existing
1133  syntaxes, so that a unit string which conformed to the VOUnits syntax  syntaxes, so that a unit string which conformed to the VOUnits syntax
1134  would be parseable in each of those other syntaxes.  This has not been  would be parsable in each of those other syntaxes.  This has not been
1135  possible in fact, for four reasons.  possible in fact, for four reasons.
1136  \begin{enumerate}  \begin{enumerate}
1137  \item The CDS syntax permits only a dot to indicate a product, and the  \item The CDS syntax permits only a dot to indicate a product, and the
# Line 1151  Line 1150 
1150  unavoidable in practice; the others are VOUnit extensions which a data  unavoidable in practice; the others are VOUnit extensions which a data
1151  provider may of course decline to take advantage of.  provider may of course decline to take advantage of.
1152    
1153  The scalefactor and quoted-units extensions are intended to support  The scale-factor and quoted-units extensions are intended to support
1154  the case where the data provider wishes to distribute data including a  the case where the data provider wishes to distribute data including a
1155  unit which is `unknown', but which the provider nonetheless feels is  unit which is `unknown', but which the provider nonetheless feels is
1156  necessary or useful; this should be done only after weighing the  necessary or useful; this should be done only after weighing the
# Line 1161  Line 1160 
1160  units to take scaling prefixes; this is not often likely to be a good idea.  units to take scaling prefixes; this is not often likely to be a good idea.
1161    
1162  A VOUnits string which avoids the three extensions above will be  A VOUnits string which avoids the three extensions above will be
1163  parseable, with the same meaning, in the CDS and FITS syntaxes, and  parsable, with the same meaning, in the CDS and FITS syntaxes, and
1164  will be parseable by an OGIP parser if dots are replaced by stars.  will be parsable by an OGIP parser if dots are replaced by stars.
1165    
1166  \subsubsection{Restrictions to ASCII}  \subsubsection{Restrictions to ASCII}
1167    
# Line 1278  Line 1277 
1277    
1278  \subsection{Query languages}  \subsection{Query languages}
1279    
1280  Including VOUnits in queries is not an easy task. Some guidelines were defined in the  Including VOUnits in queries is not an easy task. Some guidelines were
1281  reflexion on ADQL.  articulated during the development of the ADQL standard.
1282    
1283  \begin{enumerate}  \begin{enumerate}
1284  \item All data providers should be encouraged to supply units for each column  \item All data providers should be encouraged to supply units for each column
# Line 1390  Line 1389 
1389    
1390  \subsection{Other usages}  \subsection{Other usages}
1391    
1392  \begin{itemize}  \begin{description}
1393  \item  \item[\url{http://arxiv.org/pdf/astro-ph/0511616}]
 \violet{\footnotesize{\url{http://arxiv.org/pdf/astro-ph/0511616}}}\\  
1394  Dimensional Analysis applied to spectrum handling in VO context~\citep{osuna05}  Dimensional Analysis applied to spectrum handling in VO context~\citep{osuna05}
1395  offers a mathematical framework to guess and recompute  offers a mathematical framework to guess and recompute
1396  SI units for any quantity in astronomy.  SI units for any quantity in astronomy.
1397  \item  
1398  \violet{\footnotesize{\url{http://www.mel.nist.gov/msid/sima/07_ndml.htm}}}\\  \item[\url{http://unitsml.nist.gov}]
1399  NIST (National Institute of Standards \& Technology) project  The NIST (National Institute of Standards \& Technology) project
1400  UnitsXML builds up an XML representation of units at the granularity  UnitsML builds up an XML representation of units at the granularity
1401  level of a simple symbol string  level of a simple symbol string.
1402  \item \violet{\footnotesize{\url{https://jsr-275.dev.java.net/}}}\\  
1403    \item[\url{https://www.jcp.org/en/jsr/detail?id=275}]
1404  JAVA JSR-275 specifies Java packages for the programmatic  JAVA JSR-275 specifies Java packages for the programmatic
1405  handling of physical quantities and their expression as numbers of  handling of physical quantities and their expression as numbers of
1406  units.  units.
1407  \item  \texttt{aips++}  \item[\texttt{aips++} and \texttt{casacore}]
1408  \violet{\footnotesize{\url{http://aips2.nrao.edu/docs/aips++.html}}} and\\  These systems (see \url{http://aips2.nrao.edu/docs/aips++.html} and
1409   \texttt{casacore} \violet{\footnotesize{\url{http://code.google.com/p/casacore/}}}\\ contain modules handling units and   \url{http://code.google.com/p/casacore/}) contain modules handling
1410  quantities with high precision. The packages are mainly in use for   units and quantities with high precision. The packages are mainly in use for
1411  radio astronomy but are designed to be modular and adaptable.  (NB  radio astronomy but are designed to be modular and adaptable (NB:
1412  contrary to the statement on the casacore link, aips++ is still very much in  contrary to the statement on the casacore link, aips++ is still very much in
1413  use as the toolkit behind the {\sc casa} package.)  use as the toolkit behind the \textsc{casa} package).
1414  %\item  IAU SOFA  %\item  IAU SOFA
1415  %\violet{\footnotesize{\url{http://www.iau-sofa.rl.ac.uk/}}} and\\    %\violet{\footnotesize{\url{http://www.iau-sofa.rl.ac.uk/}}} and\\  
1416  %USNO NOVAS  %USNO NOVAS
1417  %\violet{\footnotesize{\url{http://aa.usno.navy.mil/software/novas/novas_info.php}}}\\  %\violet{\footnotesize{\url{http://aa.usno.navy.mil/software/novas/novas_info.php}}}\\
1418  %implement the IAU 2000 recommendations.  %implement the IAU 2000 recommendations.
1419  \end{itemize}  \end{description}
1420    
1421  \clearpage  \clearpage
1422  \section{History: Comparison of syntaxes (informative)\label{appx:comparisons}}  \section{History: Comparison of syntaxes (informative)\label{appx:comparisons}}
# Line 1426  Line 1425 
1425  In this section, we compare the existing unit-string syntaxes and the  In this section, we compare the existing unit-string syntaxes and the
1426  proposed standard.  We have included these comparisons for  proposed standard.  We have included these comparisons for
1427  more-or-less historical reasons, to try to highlight the variations  more-or-less historical reasons, to try to highlight the variations
1428  between syntaxes, and so illustrate the motivation motivation for this  between syntaxes, and so illustrate the motivation for this
1429  Recommendation, namely that the current practice, though it may at  Recommendation, namely that the current practice, though it may at
1430  first appear to have rough consensus, is disturbingly heterogeneous.  first appear to have rough consensus, is disturbingly heterogeneous.
1431    
# Line 1446  Line 1445 
1445  \begin{tabular}{|L{0.2\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|}  \begin{tabular}{|L{0.2\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|}
1446  \hline  \hline
1447      & IAU & OGIP  & StdCats & FITS  & VOUnits\\\hline      & IAU & OGIP  & StdCats & FITS  & VOUnits\\\hline
1448      %\multicolumn{6}{|c|}{Base units} \\\hline      The 6+1 base & \multicolumn{5}{c|}{\unit{m, s, A, K, mol, cd}} \\
     The 6+1 base & \multicolumn{4}{c|}{\unit{m, s, A, K, mol, cd}} & idem \\  
1449      \cline{2-6}      \cline{2-6}
1450       SI units (use \unit{s}, not sec, for seconds) & (1) & \unit{kg} & \unit{g} & \unit{kg}, but \unit{g} allowed & \unit{g}\\       SI units (use \unit{s}, not sec, for seconds) & (1) & \unit{kg} & \unit{g} & \unit{kg}, but \unit{g} allowed & \unit{g}\\
1451       \hline       \hline
1452      Dimensionless & \multicolumn{4}{c|}{\unit{rad, sr}} & idem \\      Dimensionless planar and solid angle
1453      \cline{2-5}          & \multicolumn{3}{c|}{\unit{rad}, \unit{sr}}
1454      planar and solid angle&  &  &  & (2) & \\\hline          & \unit{rad}, \unit{sr}, \unit{deg} (2)
1455      Derived units & \multicolumn{4}{c|}{\unit{Hz, N, Pa, J, W, C, V,}} & \\          & \unit{rad}, \unit{sr}\\ \hline
1456      with symbols & \multicolumn{4}{c|}{\unit{S, F, Wb, T, H, lm, lx}} & idem \\      Derived units & \multicolumn{5}{c|}{\unit{Hz, N, Pa, J, W, C, V,}} \\
1457        with symbols  & \multicolumn{5}{c|}{\unit{S, F, Wb, T, H, lm, lx}} \\
1458       & \unit{$\Omega$} & \unit{ohm} & \unit{Ohm} & \unit{Ohm} & \unit{Ohm}\\\hline       & \unit{$\Omega$} & \unit{ohm} & \unit{Ohm} & \unit{Ohm} & \unit{Ohm}\\\hline
1459  \end{tabular}  \end{tabular}
1460    \caption[Comparison of base units]{Comparison of base units.  Notes: (1) unit is \unit{kg}, but use \unit{g} with prefixes; (2) \unit{deg} preferred for decimal angles}    \caption[Comparison of base units]{Comparison of base units.  Notes: (1) unit is \unit{kg}, but use \unit{g} with prefixes; (2) \unit{deg} preferred for decimal angles}
# Line 1468  Line 1467 
1467  \begin{tabular}{|L{0.2\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|}  \begin{tabular}{|L{0.2\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|L{0.12\linewidth}|}
1468  \hline  \hline
1469      & IAU & OGIP & StdCats sec.~3.2.3 & FITS & VOUnits\\\hline      & IAU & OGIP & StdCats sec.~3.2.3 & FITS & VOUnits\\\hline
1470      Scale factors,   & \multicolumn{4}{c|}{\unit{d, c, m, n, p, f, a}} & idem \\      Scale factors,   & \multicolumn{5}{c|}{\unit{d, c, m, n, p, f, a}} \\
1471      (multiple) & \multicolumn{4}{c|}{\unit{da, h, k, M, G, T, P, E}}  & \\      (multiple) & \multicolumn{5}{c|}{\unit{da, h, k, M, G, T, P, E}}   \\
1472      prefixes & \unit{\micro} & \multicolumn{3}{c|}{\unit{u}} & \unit{u}\\      prefixes & \unit{\micro} & \multicolumn{3}{c|}{\unit{u}} & \unit{u}\\
1473       &  & \multicolumn{3}{c|}{\unit{z, y, Z, Y}} & \unit{z, y, Z, Y}\\\hline       &  & \multicolumn{3}{c|}{\unit{z, y, Z, Y}} & \unit{z, y, Z, Y}\\\hline
1474      Prefix--symbol concatenation & (1) & (2) & no space & no space (implicit) & no space\\\hline      Prefix--symbol concatenation & (1) & (2) & no space & no space (implicit) & no space\\\hline
1475      Prefix-able symbols  & Not \unit{kg}: use \unit{g} & (3) & all & all & (4) \\\hline      Prefix-able symbols  & Not \unit{kg}: use \unit{g} & (3) & all & all & (4) \\\hline
1476      Use compound prefixes & should not & should never & must not & must not & must not\\\hline      Use compound prefixes & should not & should never & must not & must not & must not\\\hline
1477  \end{tabular}  \end{tabular}
1478    \caption[Comparison of scale factors]{Comparison of scale factors.    \caption[Comparison of scale-factors]{Comparison of scale-factors.
1479    Notes: (1) no space, regarded as single symbol;    Notes: (1) no space, regarded as single symbol;
1480    (2)~no space, regarded as a single unit string;    (2)~no space, regarded as a single unit string;
1481    (3)~all units above, and \unit{eV, pc, Jy, Crab} Only \unit{mCrab} allowed;    (3)~all units above, and \unit{eV, pc, Jy, Crab} Only \unit{mCrab} allowed;
# Line 1758  Line 1757 
1757    
1758  The FITS specification permits a leading numeric multiplier, but  The FITS specification permits a leading numeric multiplier, but
1759  ``[c]reators of FITS files are encouraged to use the numeric  ``[c]reators of FITS files are encouraged to use the numeric
1760  multiplier only when the available standard scale factors of [SI] will  multiplier only when the available standard scale-factors of [SI] will
1761  not suffice''.  not suffice''.
1762    
1763  The FITS specification permits \texttt{m(2)}, to indicate the square of  The FITS specification permits \texttt{m(2)}, to indicate the square of
# Line 1792  Line 1791 
1791  3.2) that ``occasionally it may be preferable to include [leading  3.2) that ``occasionally it may be preferable to include [leading
1792  scale] factors on the grounds of user-friendliness'', but that ``[t]he  scale] factors on the grounds of user-friendliness'', but that ``[t]he
1793  inclusion of numerical factors should therefore be avoided wherever  inclusion of numerical factors should therefore be avoided wherever
1794  possible'', and it is ``suggested'' that the scale factor should in any case  possible'', and it is ``suggested'' that the scale-factor should in any case
1795  be restricted to powers of~10.  be restricted to powers of~10.
1796  %On these grounds, the \texttt{FLOAT}  %On these grounds, the \texttt{FLOAT}
1797  %terminal in the grammar should be extra-syntactically restricted to  %terminal in the grammar should be extra-syntactically restricted to
# Line 1856  Line 1855 
1855  take it that this is valid, and equivalent to \units{kg~m^{-1}~s^{-1}}.  take it that this is valid, and equivalent to \units{kg~m^{-1}~s^{-1}}.
1856  \end{itemize}  \end{itemize}
1857    
1858  This specification places no restrictions on the leading scale factor.  This specification places no restrictions on the leading scale-factor.
1859    
1860  \begin{table}[ht]  \begin{table}[ht]
1861  \verbatiminput{unity-grammars/unity-cds.txt}  \verbatiminput{unity-grammars/unity-cds.txt}
# Line 1891  Line 1890 
1890  and by the list of known units of \prettyref{tabx:knownunits}.  and by the list of known units of \prettyref{tabx:knownunits}.
1891    
1892  The intention of the VOUnits grammar is that if a VOUnits string  The intention of the VOUnits grammar is that if a VOUnits string
1893  does not use the scalefactor, quoted-units or binary-prefix  does not use the scale-factor, quoted-units or binary-prefix
1894  extensions  extensions
1895  (that is, if it avoids the \texttt{VOUFLOAT}  (that is, if it avoids the \texttt{VOUFLOAT}
1896  and \texttt{QUOTED\_STRING} terminals and is restricted to SI decimal prefixes),  and \texttt{QUOTED\_STRING} terminals and is restricted to SI decimal prefixes),
1897  then it will be parseable, with the same semantics, by FITS  then it will be parsable, with the same semantics, by FITS
1898  and CDS parsers, and that it will be parseable by an OGIP parser if  and CDS parsers, and that it will be parsable by an OGIP parser if
1899  dots are replaced by stars.  dots are replaced by stars.
1900  See \prettyref{sec:deviations} for discussion.  See \prettyref{sec:deviations} for discussion.
1901  In particular:  In particular:

Legend:
Removed from v.2439  
changed lines
  Added in v.2440

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26