While testing an beta of cfitsio 3.38, I discovered that it broke our use of the HIERARCH keyword to handle keywords longer than 8 characters or those that have non-valid characters (e.g. “.”). HIERARCH is not defined in the FITS standard, but it is a convention originally defined by ESO for chaining keywords into a hieararchy:
That convention implies that using it to define single long keywords may not work (the first value in a HIERARCH is the “namespace”), but it doesn’t explicitly forbid it. On the other hand, the cfitsio documentation suggests using HIERARCH to store long keywords (according to Bill Pence, that support was added in the early 2000s):
and pyfits recently (~the last year) added similar support for HIERARCH for long keywords:
As I said at the top, such usage is not defined in the FITS standard, and the ESO HIERARCH convention implies that it shouldn’t be used in that way.
Here’s what Bill Pence suggested, after giving this warning:
However, I cannot guarantee that support for these types of keyword will continue indefinitely, and certainly there is no guarantee that other FITS software will be able to read or write these keywords.`
My recommendation on what to do depends on how many of these types of keywords you intend to use. If it is only a hand full of keywords, then the simpler path would be bit the bullet and convert them to standard 8 character keywords. Otherwise, would it be possible to change them so that they conform to the original ESO HIERARCH convention? For example, instead of
HIERARCH reallylongkeyword = 1
HIERARCH A.B.C.D = 1
HIERARCH LSST REALLYLONGKEYWORD = 1
HIERARCH LSST A B C D = 1`
We could certainly use the latter form (the LSST namespace) for all the places where use use long keywords, but I think we may have some “transparent” handling of long keywords at present that may cause trouble. Here’s one example:
I’m not sure what the best solution here is, but we should probably take care of this soon, before we start producing lots of non-compliant FITS files that may require special handling in the future.