Astropy: keyword order in column order for tables output as fits

Created on 17 Nov 2017  ·  3Comments  ·  Source: astropy/astropy

It would be useful for humans if the fits header keywords for tables were in column order e.g.
I have created a simple table with units and the units are placed at the end rather than in column order. e.g.

table.write produces

TTYPE1 = 'RA '
TFORM1 = 'D '
TTYPE2 = 'Dec '
TFORM2 = 'D '
TUNIT1 = 'deg '
TUNIT2 = 'deg '

It would be more human readable and debuggable if the order was:

TTYPE1 = 'RA '
TFORM1 = 'D '
TUNIT1 = 'deg '
Tetc1
TTYPE2 = 'Dec '
TFORM2 = 'D '
TUNIT2 = 'deg '
Tetc2

Effort-low Feature Request Package-intermediate io.fits

Most helpful comment

Ok, I was running astropy 1.3.0 as a result of installing lsst stack. Astropy 1.3.3 and 2.0.2 give me the result that I wanted. Sorry about the wild goose chase. Thanks, I will close this.

All 3 comments

An idea is to add a logic in table_to_hdu() to use Header.insert for these keywords.

It is already handled automatically, and I cannot reproduce. Can you check which version of Astropy you're using, and maybe upgrade or provide a minimal example ?

Ok, I was running astropy 1.3.0 as a result of installing lsst stack. Astropy 1.3.3 and 2.0.2 give me the result that I wanted. Sorry about the wild goose chase. Thanks, I will close this.

Was this page helpful?
0 / 5 - 0 ratings