Find a FITS card in a FitsChan by keyword AST_FINDFITS
If the search is successful (i.e. a card is found which matches the template), the contents of the card are
returned and the Card attribute is adjusted to identify the card found or, if required, the one following
it. If the search is not successful, the function returns .FALSE. and the Card attribute is set to the "
end-of-file"
.
"
field specifiers"
which are capable of matching a
range of characters (see the "
Keyword Templates"
section for details). In this case, the first card
with a keyword which matches the template will be found. To find the next FITS card
regardless of its keyword, you should use the template "
%f"
. ’
s Card attribute will be set to
the index of the card that was found. If it is .TRUE., however, the Card attribute will be
incremented to identify the card which follows the one found. ’
%f’
, CARD, .TRUE., STATUS ) "
%f"
template matches any
keyword). ’
BITPIX’
, CARD, .TRUE., STATUS ) "
BITPIX"
keyword and returns that card.
The Card attribute is then incremented to identify the card that follows it. ’
COMMENT’
, CARD, .FALSE., STATUS ) ’
CRVAL%1d’
, CARD, .TRUE., STATUS ) "
CRVALi"
(for example,
any of the keywords "
CRVAL1"
, "
CRVAL2"
or "
CRVAL3"
would be matched). The
card found (if any) is returned, and the Card attribute is then incremented to identify the
following card (ready to search for another keyword with the same form, perhaps). The search always starts with the current card, as identified by the Card attribute. To ensure you
search the entire contents of a FitsChan, you should first clear the Card attribute (using AST_CLEAR).
This effectively "
rewinds"
the FitsChan.
If a search is unsuccessful, the Card attribute is set to the "
end-of-file"
(i.e. to one more than the
number of cards in the FitsChan). No error occurs.
A value of .FALSE. will be returned if this function is invoked with the AST error status set, or if it should fail for any reason.
"
field specifiers"
which can match a range of possible
characters. This allows you to search for keywords that contain (for example) numbers, where the
digits comprising the number are not known in advance.
A field specifier starts with a "
%"
character. This is followed by an optional single digit (0 to 9)
specifying a field width. Finally, there is a single character which specifies the
type of character to be matched, as follows:
"
c"
: matches all upper case letters,
"
d"
: matches all decimal digits,
"
f"
: matches all characters which are permitted within a FITS keyword (upper case letters, digits,
underscores and hyphens).
If the field width is omitted, the field specifier matches one or more characters. If the field width is zero, it matches zero or more characters. Otherwise, it matches exactly the number of
characters specified. In addition to this:
The template "
%f"
will match a blank FITS keyword consisting of 8 spaces (as well as matching all
other keywords).
A template consisting of 8 spaces will match a blank keyword (only).
For example:
The template "
BitPix"
will match the keyword "
BITPIX"
only.
The template "
crpix%1d"
will match keywords consisting of "
CRPIX"
followed by one decimal
digit.
The template "
P%c"
will match any keyword starting with "
P"
and followed by one or more
letters.
The template "
E%0f"
will match any keyword beginning with "
E"
.
The template "
%f"
will match any keyword at all (including a blank one).