[AstroPy] (Table) unit formatting

Paul Kuin npkuin at gmail.com
Wed Nov 1 13:41:34 EDT 2017


During the 1990's we had some discussions on standardization of units.
Unfortunately, CDS and Heasarc were using different standardizations, and
as far as I know that is still the case. That's the 'Flexible' in FITS, I
suppose.

On Wed, Nov 1, 2017 at 4:52 PM, Peter Weilbacher <pweilbacher at aip.de> wrote:

> Hi Tom,
>
> On Wed, 1 Nov 2017, Thomas Robitaille wrote:
>
> > The issue is that the FITS standard includes a prescription about how
> units
> > should be formatted, and we follow the standard strictly when writing
> files
> > to make sure the files we produce are standard-compliant. I would
> therefore
> > advise against trying to modify TUNIT to make it more 'human-friendly'
> > since it will result in it being non-standard-compliant and could cause
> > issues when other people try and read it in. When the table is loaded
> into
> > a Table object in Python you can of course convert units to various
> string
> > representations including latex - but we should stick to the standard
> when
> > writing FITS files.
>
> 'erg/s/cm**2' /is/ a valid FITS unit string, I see no reason that it
> gets mangled to 'cm-2 erg s-1'. I could agree it getting changed to
> 'erg/(s cm**2)' but removing all slashes and sorting the individual
> units in ascending alphabetical order is not required by the standard
> AFAICT.
>
> And actually, since the standard says that multiple slashes /may/ be
> used (despite them being discouraged), FITS readers have to be capable
> to handle such files anyway. (Couldn't find the sentence in the IAU
> style manual that forbids multiple slashes.)
>
> > The fact that the format on Table columns is not propagated to TDISP
> sounds
> > like an oversight. Can you open an issue in the astropy repository?
>
> Done, https://github.com/astropy/astropy/issues/6806
>
> > We indeed don't currently print descriptions when showing a Table object
> in
> > Python and also don't write them to FITS. Feel free to open feature
> > requests for these in the issue tracker above too. Keep that issue
> separate
> > from the TDISP issue which I think is an actual bug/oversight - whereas I
> > think there is no 'standard' way to write descriptions for columns to
> FITS
> > so this is more of a possible feature request.
>
> Right, anyway, I opened https://github.com/astropy/astropy/issues/6807
> I didn't see a way to make it a feature request over a bug, but someone
> else may be able to tag it accordingly.
>
> But thanks for the answers, so I know that for now I'll have to do these
> things "by hand".
>
>    Peter.
> --
> Dr. Peter M. Weilbacher             http://www.aip.de/People/PWeilbacher
> Phone +49 331 74 99-667                       encryption key ID 7D6B4AA0
> ------------------------------------------------------------------------
> Leibniz-Institut für Astrophysik Potsdam (AIP)
> An der Sternwarte 16, D-14482 Potsdam
>
> Vorstand: Prof. Dr. Matthias Steinmetz, Matthias Winker
> Stiftung bürgerlichen Rechts, Stiftungsverz. Brandenburg: 26 742-00/7026
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org
> https://mail.python.org/mailman/listinfo/astropy
>



-- 

* * * * * * * * http://www.mssl.ucl.ac.uk/~npmk/ * * * *
Dr. N.P.M. Kuin      (n.kuin at ucl.ac.uk)
phone +44-(0)1483 (prefix) -204111 (work)
mobile +44(0)7908715953  skype ID: npkuin
Mullard Space Science Laboratory  – University College London  –
Holmbury St Mary – Dorking – Surrey RH5 6NT–  U.K.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20171101/55343be3/attachment.html>


More information about the AstroPy mailing list