Skip to content

Mention keyword deletion syntax in manual #111

@rmathar

Description

@rmathar

Section 11.1 of the cfitsio manual is missing a description of the
syntax that supports keyword deletion. By reading the source
code of ffgthd in fitscore.c it seems to be something like this:

Deletion/modification of keywords is triggered if the template line starts
with an optional number of blanks and the KEYWORD starts with
the minus sign. If the KEYWORD is followed by one or more blanks
and another KEYWORD2, the KEYWORD is not merely deleted but
replaced by KEYWORD2 .

Note 1: the parser in ffgthd supports another extended syntax:
If after the KEYWORD there is an optional number of blanks
and a plus sign, this is supposed to mark removal of multiple keywords (?)
and that information is flagged on return of ffgthd by adding the
trailing plus sign to the cards. But because ffpktp in putkey.c
just forwards this to ffdkey, which does know nothing about
multiple keyword's deletions, this is actually unsupported
functionality from the point of view of the template parser.

Philosophical Note 2: from the point of view of a template file creator,
deletion of keywords seems not to make sense (why delete
a keyword on construction if not mentioning it in the
template file at all would work the same?). But the
ffpktp can also be called acting on generic existing
headers, and then the deletion is helpful (for example
to delete the check sum keywords that become invalid
if anything is edited...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions