[fitsbits] [mhvk at astro.utoronto.ca: Question about FITS format for logarithmic units]
Marten van Kerkwijk
mhvk at astro.utoronto.ca
Thu Dec 12 09:22:54 EST 2013
Hi Peter,
>> (1) How would I indicate a dimensionless but logarithmic quantity such
>> as dex? If I understood the standard correctly, log(surface gravity)
>> might have the unit "log(cm/s2)", but how about a dimensionless one
>> (like metallicity). Would it be "log()", or, by analogy with
>> magnitude, just "log"?
>
> If something has no unit that the unit could be viewer to be unity.
> Hence I would say use log(1). Leaving the argument empty would otherwise
> probably break parsers.
Thanks! definitely seems much more logical than the log() or log('') I
suggested, especially since the standard explicitly defines it as the
function having taken an argument and divided it by the unit in
parenthesis. (And it also matches nicely with our internal astropy use,
where dimensionless unscaled can be represented by Unit(1).)
My colleage Michael Droettboom looked at wcslib in a bit more detail and
it looks like that package assumes that prefactors for the log()
function are not allowed, and hence that it is not possible to pass that
package a unit of dB(mW) or mag(AB).
>From the discussion -- which I do find interesting! -- it seems that (as
yet) the FITS standard similarly does not define these cases. Like we
already do for units with non-factor-of-ten scale, it may be best for
now to simply warn the user that this cannot be stored in a way that one
can count on other packages understanding, and give a hint on what would
be needed to make it more easily supported.
I do think eventually one would like to be able to handle such units,
however ugly they are (they are just too commonly used...). In the
recommendations on units by NIST [1], two possibilities are mentioned,
the default one perhaps more alike to Tim's, where the unit is "dB" (in
that example) and the description "L_P (re 20 μPa)" (where "re" stands
for reference level, which I must say I rather dislike) and a "condensed
version" that is more similar to what I had in mind, as that unit
carries all the required information in one place: "dB (20 μPa)"
Thanks again,
Marten
[1] http://physics.nist.gov/Pubs/SP811/sec08.html#8.7
More information about the fitsbits
mailing list