Units needed in ADQL-0.7

From: Clive Page <cgp-at-star.le.ac.uk>
Date: Thu, 15 Jan 2004 17:05:19 +0000 (GMT)


It seems to me (following valuable discussions with Guy Rixon, Patricio Ortiz, Tony Linde and others) that we cannot ignore the need for physical units in our queries. For example if one specifies (using SkyQL to avoid the verboseness of XML) something like:

  SELECT * FROM sometable t WHERE ABS(t.galactic_latitude) > 10.0 ;

The meaning to an astronomer is fairly clear: you only want sources more than 10 degrees from the galactic plane. But how does the specifier, or the database access layer, know that 10.0 means degrees and not say radians or pixels? There are only two possibilities that I can think of:

(a) the physical units for each column must be standardised so that
everyone in the community knows that galactic latitude must be in degrees and any data centre using anything different has a mandatory permanent conversion job to do.

or
(b) we need a way of specifying units in the string (and in the XML).

I think that (a) is too difficult, as there are just too many different columns and possible units, and argument as to what should be the "standard" would never cease. Using (b) we need a notation for units.

The nearest thing to a standard notation that has so far been proposed is in section 3.2 of this document from CDS: http://vizier.u-strasbg.fr/doc/catstd.htx I think this looks a pretty good solution to the problem.

Of course we still need a way of marking the syntax of the string in the pseudo-sql, for example in brackets, it would become

  SELECT * FROM sometable t WHERE ABS(t.galactic_latitude) > 10.0[deg] ;

The data access layer at each site would have to interpret the units and do the appropriate conversion, so that if its table used radians, it would simply provide the conversion on the fly.

-- 
Clive Page
Dept of Physics & Astronomy,
University of Leicester,    Tel +44 116 252 3551
Leicester, LE1 7RH,  U.K.   Fax +44 116 252 3311
Received on 2004-01-15Z18:06:25