Logo Search packages:      
Sourcecode: qfits version File versions  Download package

char* qfits_query_hdr ( const char *  filename,
const char *  keyword 

Retrieve the value of a key in a FITS header.

filename Name of the FITS file to browse
keyword Name of the keyword to find
pointer to statically allocated character string
Provide the name of a FITS file and a keyword to look for. The input file is memory-mapped and the first keyword matching the requested one is located. The value corresponding to this keyword is copied to a statically allocated area, so do not modify it or free it.

The input keyword is first converted to upper case and expanded to the HIERARCH scheme if given in the shortFITS notation.

This function is pretty fast due to the mmapping. Due to buffering on most Unixes, it is possible to call many times this function in a row on the same file and do not suffer too much from performance problems. If the file contents are already in the cache, the file will not be re-opened every time.

It is possible, though, to modify this function to perform several searches in a row. See the source code.

Returns NULL in case the requested keyword cannot be found.

Definition at line 113 of file qfits_tools.c.

References qfits_query_ext().

    return qfits_query_ext(filename, keyword, 0);

Generated by  Doxygen 1.6.0   Back to index