next up previous contents Back To Software Index
Next: Write Keyword Routines Up: FITS Header I/O Previous: Header Space and

Read or Write Standard Header Routines

These routines provide a simple method of reading or writing most of the keyword values that are normally required in a FITS files. These routines are provided for convenience and are not required to be used. If preferred, users may call the lower-level routines described in the previous section to individually read or write the required keywords. Note that in most cases the required keywords such as NAXIS, TFIELD, TTYPEn, etc, which define the structure of the HDU must be written to the header before any data can be written to the image or table.

1
Put the primary header or IMAGE extension keywords into the CHU. The simpler ffphps routine is equivalent to calling ffphpr with the default values of simple = TRUE, pcount = 0, gcount = 1, and extend = TRUE. The PCOUNT, GCOUNT and EXTEND keywords are not required in the primary header and are only written if pcount is not equal to zero, gcount is not equal to zero or one, and if extend is TRUE, respectively. When writing to an IMAGE extension, the SIMPLE and EXTEND parameters are ignored. Refer to Chapter 9 for a list of pre-defined bitpix values.

  int fits_write_imghdr / ffphps
      (fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)

  int fits_write_grphdr / ffphpr
      (fitsfile *fptr, int simple, int bitpix, int naxis, long *naxes,
       long pcount, long gcount, int extend, > int *status)

2
Get primary header or IMAGE extension keywords from the CHU. When reading from an IMAGE extension the SIMPLE and EXTEND parameters are ignored.

  int fits_read_imghdr / ffghpr
      (fitsfile *fptr, int maxdim, > int *simple, int *bitpix, int *naxis,
       long *naxes, long *pcount, long *gcount, int *extend, int *status)

3
Put the ASCII table header keywords into the CHU The optional TUNITn and EXTNAME keywords are written only if the input string values are not null. See Chapter 9 for a list of allowed tform values.

  int fits_write_atblhdr / ffphtb
      (fitsfile *fptr, long rowlen, long nrows, int tfields, char **ttype,
       long *tbcol, char **tform, char **tunit, char *extname, > int *status)

4
Get the ASCII table header keywords from the CHU

  int fits_read_atblhdr / ffghtb
      (fitsfile *fptr,int maxdim, > long *rowlen, long *nrows,
       int *tfields, char **ttype, long *tbcol, char **tform, char **tunit,
       char *extname,  int *status)

5
Put the binary table header keywords into the CHU. The optional TUNITn and EXTNAME keywords are written only if the input string values are not null. The pcount parameter, which specifies the size of the variable length array heap, should initially = 0; CFITSIO will automatically update the PCOUNT keyword value if any variable length array data is written to the heap. The TFORM keyword value for variable length vector columns should have the form 'Pt(len)' or '1Pt(len)' where `t' is the data type code letter (A,I,J,E,D, etc.) and `len' is an integer specifying the maximum length of the vectors in that column (len must be greater than or equal to the longest vector in the column). If `len' is not specified when the table is created (e.g., the input TFORMn value is just '1Pt') then CFITSIO will scan the column when the table is first closed and will append the maximum length to the TFORM keyword value. Note that if the table is subsequently modified to increase the maximum length of the vectors then the modifying program is responsible for also updating the TFORM keyword value. See Chapter 9 for a list of allowed tform values.

  int fits_write_btblhdr / ffphbn
      (fitsfile *fptr, long nrows, int tfields, char **ttype,
       char **tform, char **tunit, char *extname, long pcount, > int *status)

6
Get the binary table header keywords from the CHU

  int fits_read_btblhdr / ffghbn
      (fitsfile *fptr, int maxdim, > long *nrows, int *tfields,
       char **ttype, char **tform, char **tunit, char *extname,
       long *pcount, int *status)



next up previous contents Back To Software Index
Next: Write Keyword Routines Up: FITS Header I/O Previous: Header Space and