[AstroPy] FITS files and column descriptions

Aldcroft, Thomas aldcroft at head.cfa.harvard.edu
Mon Nov 11 12:45:35 EST 2013

On Fri, Nov 8, 2013 at 7:32 AM, Yannick Roehlly <yannick.roehlly at lam.fr>wrote:

> Le Thu, 7 Nov 2013 21:59:46 +0000,
> Paul Kuin <npkuin at gmail.com> a écrit :
> > My (biased) feeling  is that you cannot
> > go around having a second metadata file when going to ascii.
> Hi Paul,
> You are right, having all the metadata on a separate README file is
> really important; I know people not even putting the column names in
> the data files to be sure users read the README.
> But I also think having the metadata inside the data file is useful as
> a reminder when working with the data.

There is no technical reason you cannot store all reasonable metadata in a
commented header that precedes the data in an ASCII table.  The vast
majority of table readers support a "comment" character to separate data
from other information.  Obviously this depends on having some standards
for interpreting the commented header, but this is the same whether or not
it resides in a separate file.

Personally I think it is far preferable to have header metadata and the
data in a single file, otherwise you have to maintain / distribute twice as
many files and have a mechanism for establishing a correspondence between
the meta (ReadMe) and the data file.  This then makes it harder to rename
table files since you need to update the contents of the ReadMe as well.
 Obviously there are some advantages, like being able to create a
collection of data files (ala CDS) with a single ReadMe, but overall it
seems simpler to have a single data table (with meta) per file.

BTW, slightly OT but I did spend some time thinking about supporting
arbitrary metadata in an ASCII format. The result is this pull request:
It's basically just an exploratory idea that saves everything as JSON.
 This got stalled out and it may not be the best way to go (do we need yet
another format?), but it's there if anyone is interested.

- Tom

> Concerning the column descriptions in FITS files, pyfits /
> astropy.io.fits does not handle them, but it is always possible to add
> the TCOMM keywords manually to the HDU headers.
> Regards,
> Yannick
> --
> What is mind?  No matter.  What is matter?  Never mind.
>                 -- Thomas Hewitt Key, 1799-1875
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20131111/da1e03bc/attachment.html>

More information about the AstroPy mailing list