next up previous contents Back To Software Index
Next: Read or Write Up: FITS Header I/O Previous: FITS Header I/O

Header Space and Position Routines

Reserve space in the CHU for MOREKEYS more header keywords. This routine may be called to reserve space for keywords which are to be written at a later time, after the data unit or subsequent extensions have been written to the FITS file. If this routine is not explicitly called then the initial size of the FITS header will be limited to the space available at the time that the first data is written to the associated data unit. CFITSIO will dynamically add more space to the header if needed, however it is more efficient to preallocate the required space if the size is known in advance.

  int fits_set_hdrsize / ffhdef
      (fitsfile *fptr, int morekeys, > int *status)

Return the number of existing keywords in the CHU (NOT counting the END keyword which is not considered a real keyword) and the remaining space available to write additional keywords in the CHU (returns morekeys = -1 if the header has not yet been closed). Note that CFITSIO will attempt to dynamically add space for more keywords if required when appending new keywords to a header.

  int fits_get_hdrspace / ffghsp
      (fitsfile *fptr, > int *keysexist, int *morekeys, int *status)

Return the number of keywords in the header (not counting the END keyword) and the current position in the header. The position is the number of the keyword record that will be read next (or one greater than the position of the last keyword that was read or written). A value of 1 is returned if the pointer is positioned at the beginning of the header.

  int fits_get_hdrpos / ffghps
      (fitsfile *fptr, > int *keysexist, int *keynum, int *status)