VOUnits RFC
Norman Gray
norman at astro.gla.ac.uk
Fri Jul 26 10:35:22 PDT 2013
Rob, hello.
Thanks for the link to the New SI document. I'm sure I'd seen something of that work, but not in that detail. It looks like interesting reading.
On 2013 Jul 26, at 18:02, Rob Seaman <seaman at noao.edu> wrote:
>> The VOUnits Recommendation still intends _not_ to be innovative, in the sense that it is intended to indicate the _intersection_ of the existing syntaxes for unit strings, as much as possible.
>
[...]
> Whereas the intent of the recommendation is to convey only syntax and leave semantics for applications to sort out?
That's exactly right.
If you parse 'kg/m/s**2', that's a valid string in the OGIP syntax, but an invalid one in the other syntaxes. 'kg/(m.s**2)' is valid in FITS and VOUnits, and so on. In each case, there's an SI prefix 'k' recognised in front of the 'g'.
The 'known units' are 'known' only to the extent that they have extra constraints on them. Thus:
% ./unity -ifits -v 'erg/s'
0 0/erg/1 0/s/-1
check: all units recognised? yes
check: all units recommended? no
check: all units satisfy constraints? yes
% ./unity -iogip -v 'erg/s'
0 0/erg/1 0/s/-1
check: all units recognised? yes
check: all units recommended? yes
check: all units satisfy constraints? yes
% ./unity -ivounits -v 'erg/s'
0 0/erg/1 0/s/-1
check: all units recognised? yes
check: all units recommended? no
check: all units satisfy constraints? yes
% ./unity -icds -v 'erg/s'
0 0/erg/1 0/s/-1
check: all units recognised? no
check: all units recommended? no
check: all units satisfy constraints? yes
.... the 'erg' is recognised but deprecated in FITS and VOUnits, perfectly fine in OGIP, and unrecognised in CDS. There are also constraints on what units are permitted prefixes (the Merg is OK in VOUnits, but bad in FITS).
The library, as the specification suggests it should be, is liberal about what it accepts:
% ./unity -ifits -v 'furlong/fortnight'
0 -15/urlong/1 -15/ortnight/-1
check: all units recognised? no
check: all units recommended? no
check: all units satisfy constraints? yes
...so the femto-urlong per femto-ortnight is fine! No semantics there.
The Java library (but not the C one) can report the dimensions of the resulting expression, but that was only because, due to the way I was implementing this, it was pretty easy to do, so it's really only a party-trick at this point.
> Whichever it is, the structure of the conversions should be general enough not to assume that all time-like or mass-like or distance-like conversions are commutative / idempotent / reversible / transitive.
The specification discusses no conversions beyond (implicitly) conversions between syntaxes:
% ./unity -ivounits -oogip 'kg/(m.s**2)'
kg /m /s**(2)
%
Going anything beyond that, we thought, strays into the hell that is the Quantities Discussion. This is the low-hanging fruit: we really should have collectively agreed this recommendation by around 2003.
Does that allay your concerns?
All the best,
Norman
--
Norman Gray : http://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK
More information about the semantics
mailing list