VOunits draft
Rob Seaman
seaman at noao.edu
Mon May 25 07:49:52 PDT 2009
On May 24, 2009, at 11:23 PM, Hervé Wozniak wrote:
> I think using SI prefix is rather a good idea. The number of SI
> prefixes is fixed and rather short (20) compared to other stuff we
> have often to compile... (including units!) :
Is there a reference to using SI prefixes to handle numerical
precision conversions? Unfortunately my Numerical Recipes is at the
office (and the building has been closed until tomorrow due to
flooding in the basement!) A quick google on "SI prefixes numerical
precision" returns the top hit (on some Perl mailing list):
>> "String numerifier with SI prefix support ... Given a floating-
>> point numerical input, I produce an output string formatted in
>> engineering notation."
With the punchline:
>> "...It does not handle rounding or precision correctly"
Anyway, this seems like an interesting idea, but it isn't clear (to
me, anyway) how it would work in practice. Presumably an algorithm
would do a high-water-mark and low-water-mark on various intermediate
results and trigger a conversion as needed? The several units from
each input would have to be explicitly carried throughout with some
case statement near the end to select from various multiplicative 10^N
options.
How is this better than dividing out a single integer or floating
point scaling factor near the beginning and folding it back in at the
end?
In most cases it is sufficient to just choose double precision and
throw an error in the rare instances that a loss of precision is
detected. Handling that error (by adjusting the range of the inputs)
should be about as efficient a way to address the issue as any.
> However, if we want to use the full SI system to transport data from
> the data provider to any client, after maybe some pipeline process
> or workflow, we have to keep as much as possible the accurary of the
> original data during the various transformations (at least two:
> orginal units to SI, SI to client units. But maybe some intermediate
> clients would make internal conversions).
I'm concerned that we're conflating two (or maybe several) different
issues:
- There are well known techniques for dealing with precision in
numerical algorithms.
- There is also a need for the VO to semantically recognize and
display unit labels.
- There happens to be a standard system of units resulting from the
Age of Enlightenment (and a guillotined chemist). The SI units do not
form a complete system (or even a completely self-consistent one).
- And the notion of "units" in general is only a shorthand way of
dealing with a very large number of empirical/instrumental issues.
Hence, the VO should certainly support a range of SI units - but
others are completely irrelevant to astronomy. The VO also needs to
support numerous non-SI units.
And various of the SI prefixes should be recognized (in some
fashion). But others are completely irrelevant to astronomy. Carl
Sagan said "Billyuns and billyuns", not "Yotta and Yocto". (Although
these do sound like words one might hear in the Bronx :-)
SI isn't "the answer to units", it is one particular answer - to a
question that astronomers didn't ask.
Rob
More information about the dm
mailing list