Dimensionless units in VOUnits 1.1

Ole Streicher ole at aip.de
Thu Oct 24 09:39:18 CEST 2024


Hi again,

One other question appeared here during the course of implementing this 
in astropy, astropy/astropy#17230: It is not clear to me whether this is 
an incompatible structural change in 1.1, just a clarification or some 
practice already unofficially established with 1.0, or introducing a new 
semantics because the old one (using an empty string) was contradicting 
the grammars? I.e.

* in 1.0, was it possible to use "1" and "log(1)"? if yes, what was the 
semantics then?

* is it still allowed to use "" resp. "log()" in 1.1, and what would be 
the semantics now?

Finally, I would like to know how this translates to FITS units, i.e. if 
I have "1" or "log(1)" in VOUnit, how does one write it when converting 
to FITS?

(This is also a comment on 
https://github.com/ivoa-std/VOUnits/issues/37, but copied here to have a 
wider discussion).

Cheers

Ole

On 23.10.24 11:11, Ole Streicher wrote:
> Hello semantickers,
> 
> I just stumbled upon a probably forgotten change in VOUnits 1.1 [1]:
> While section 2.2 now states
> 
>> In each of the grammars here, the empty string is not a valid units 
>> string - in particular, it is not taken to indicate a dimensionless 
>> quantity. […] The VOUnits syntax, though it also deems the empty 
>> string to be invalid, recognises the string 1 as positively indicating 
>> a dimensionless quantity.
> 
> section 2.8 still claims
> 
>> If there is no unit associated with a quantity (for example a
>> quantity that is a character string, or unitless), data providers
>> should indicate this with an empty string rather than blanks or
>> dashes.
> 
> which makes it not fully clear whether one should use an empty string or 
> the string "1" for the dimensionless unit.
> 
> But there is another problem with using "1" for dimensionless unit: it 
> breaks FITS compatibility (and Astropy parsing). Section 2.12 (although 
> informative) claims that VOUnits are FITS compliant unless scale factors 
> or quoted-units are used. Section 2.2 (cited above) however doesn't 
> introduce the "1" mark as a scale-factor.
> 
> Given that dimensionless quantities are quite common, this may produce 
> rather a mess when converting from/to FITS, and especially when it comes 
> to function units: VOUnit would (probably) need "log(1)", while FITS 
> fill surely not accept that (not sure what one would use there: "log()"?)
> 
> Or did I misunderstand this?
> 
> Best
> 
> Ole
> 
> [1] https://github.com/ivoa-std/VOUnits/issues/37



More information about the semantics mailing list