Subject: FITS continuation problem

From: Clive Page <cgp at star.le.ac.uk>
Date: Mon, 11 Jul 1994 10:03:10 +0000 (GMT)

I take the point that in-band signalling is undesirable - as characters
like \ & - might sometimes occur as normal contents of the value string.
But what about putting the continuation marker and count in the comment
field?  Something like this:

LONGSTRG= 'This is a very long string value which will need to' / &1
        = ' be continued because it clearly will not fit in its' / &2
        = ' entirety on a single line'

The presence of an ampersand (or whatever character turns out to be most
acceptible) as the first non-blank character of a comment, followed by a
line counter, will signal to suitable FITS readers that a set of lines
that form a single long character-string value is coming its way. This
should not upset existing FITS readers (they will just lost the remainder
of the long string).  Of course it doesn't solve the problem, as pointed
out by Doug Tody, that programs that read and then write information in
FITS files may be forced to re-order keywords in some circumstances.

One way of getting around this might be to use an even more elaborate
comment field, for example:

LONGSTRG= 'This is a very long string value which will need to' / &LONGSTRG1
        = ' be continued because it clearly will not fit in its' /&LONGSTRG2
        = ' entirety on a single line' /&LONGSTRG3

With this format a clever FITS reader could reconstruct the original long
string even if somewhere in the processing chain the order of the lines had
been randomly scrambled.  Unfortunately it leaves even less space for the
value string, so even more of them will need to be continued on to two or
more lines. This is, of course, not a fully developed proposal, just an
idea that would seem to serve the purpose without violating the FITS
Standard.  No doubt it could be improved to simplifiy FITS readers, e.g.
by flagging the last line of the continuation sequence in some way.

-------------------------------------------------------------------------
Clive Page,                         Internet: cgp at star.le.ac.uk
Dept of Physics & Astronomy,        
University of Leicester,            Until Apr 95: Phone +44 533 523551
Leicester, LE1 7RH,                               Fax   +44 533 550182
UK.                                 After Aug 94: Phone +44 116 252 3551
                                                  Fax:  +44 116 255 0182