[fitsbits] reopening of Public Comment Period on the CONTINUE convention

William Pence William.Pence at nasa.gov
Thu Mar 3 16:04:01 EST 2016


On 2/26/2016 12:49 PM, Demitri Muna wrote:
> Hi,
>
> My initial comments are:
>
> - Are the single quotes necessary (providing any value?) as there 
> isn’t expected to be anything else on the line?

The quotes are necessary to delimit any significant leading or trailing 
spaces and also serve to separate the string value from the optional 
comment string.

> - Shouldn’t the ampersand be located outside of the quoted string?

No.   There is no ambiguity by requiring the ampersand to be the last 
character of the quoted string.  It would be more ambiguous to say the 
ampersand must be the first character of the comment field. In that 
case, should it precede or follow the recommended space following the 
slash character?  Should it precede or follow any optional units string 
in square brackets?  Also, from a practical standpoint it is more 
convenient parse the ampersand as part of the value string rather than 
having to parse the comment string as well.
> - Is there a benefit to a free form text field having a comment? 
> Particularly as it might contain an unlimited number of lines?

Some users might find it beneficial to continue the comment field, as 
well as the string value itself, over the same keyword records.

> - I think that if a line ends with an ampersand but the next does not 
> contain the “CONTINUE” keyword, is should be an error. If it looks 
> like an error (even acknowledged in the document), it should be an error.

It is an error in the sense that the keywords probably do not convey the 
meaning that was intended, however all the individual keywords 
completely conform to the requirements for  valid FITS keywords and are 
perfectly legal.  Also, it is possible for a string keyword to actually 
have an ampersand as the last character of the string.

> - There should be no chance (particularly through an error!) that the 
> continuation string (“&”) be assumed to be part of the long string. 
> This is another argument to keep the continuation character outside of 
> the quoted string.

As mentioned above, putting the continuation character inside the quoted 
string is better than the alternative.  In any case, in the 22 years 
that this continuation convention has been used by the HEASARC (and many 
others) in countless FITS files, we have never (to my knowledge) 
encountered any problems with the long string values becoming corrupted.

> - Is there a maximum number of lines? While the intent here is for 
> strings of a few lines, this clearly lays out the red carpet for the 
> possibility of megabytes of text. In software, whatever your intent 
> it, expect users to exceed it by an order of magnitude.
>

Generally speaking, the FITS standard does not place upper limits on any 
the data structures that it defines, so users can use or abuse them as 
they see fit.    Note that the entire text of Tolstoy's 'War and Peace'  
(587287 words) could be written as a single 50000-line continuation 
keyword, and CFITSIO would have no trouble reading or writing it 
(although it might take awhile!).

> Is the reason this specific format was chosen was that it is currently 
> being implemented somewhere else?
>

Yes.  This particular convention was adopted by the HEASARC in 1994 to 
support the need to write long string values related to certain missions 
that it supported.    See 
http://fits.gsfc.nasa.gov/registry/continue_keyword.html.

> I would also request the the LaTeX document for the documentation use 
> the correct “straight” quote in the example headers. The document 
> source is using straight single quotes, but these of course become a 
> curly quote which is incorrect. This can be accomplished, for example, 
> with the “\textquotesingle” macro in the textcomp package.
>
Good suggestion.

-Bill Pence
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listmgr.nrao.edu/pipermail/fitsbits/attachments/20160303/13016108/attachment-0001.html>


More information about the fitsbits mailing list