# [QUANTITY] The quandary

David Berry dsb at ast.man.ac.uk
Wed May 21 06:44:01 PDT 2003

```Roy,

> > So I think we need to generalise the statement made by David that "a
> > Quantity is simply a value and a unit". I think a Quantity should be "a
> > value and a Domain".
>
> Actually I like the former definition. It is clear and well-defined, it is
> what we all learned in science class, it allows us to start work in a
> concrete way. The point here is not expressing everything that can be
> expressed, but in having a consensus among the community about what we are
> dealing with.Saying a quantity is a "number + unit" is as good as we will
> get!

If all that a Quantity gives us is a statement of the unit, is it worth the
overhead of being made a separate class? There is not much you can do with
just a unit, given that many of the useful quantities you may choose to
describe need other qualifying parameters in order to interpret them.
Again, what is meant by saying that "frequency 1 is larger than frequency
2"? Do you just simply compare the numerical values (converted into a
common unit), or do you take account of any difference in rest frames?
If the later, you need somewhere to put the information describing the two
rest frames. My idea for a Domain class is simply somewhere to put the
extra information you need in order to interpret the quantity. The Units
string is one item, but there are others, depending on what type of
quantity you are describing.

>
> > (I would say a UCD if I knew what a UCD actually is - I was a
> > bit confused by last weeks discussion - was I alone?).
>
> UCD provide higher level semantics. It is a "semantic type" for a data
> quantitiy. For example the quantities RA and GLON are both in degrees, but
> you attempt to, say subtract them. However, maybe you decide it is OK to use
> GLON|ERROR as an approximation to RA|ERROR.
>
> Similarly, TEMPERATURE_CCD and TEMPERATURE_PLASMA have the same units, but
> different UCD --> different semantics.
>
> getting confused!

Yes, I see there ia a lot of overlap. How are numerical parameters
represented within UCDs? If you had a UCD for, say, a topocentric radio
velocity value, where would the rest frequency, the observers
geocentric longitude and latitude, the date, etc, get stored? These are
all needed before you can compare the value with other values with the
same UCD.

My idea of a Domain is just somewhere to put these items. I can't see that
the Unit is special - it's just one of the potentially large number of
extra bits of information which you need to interpret a quantity.

David

```