next up previous contents Back To Software Index
Next: Advanced Interface Routines Up: Basic Interface Routines Previous: Keyword I/O Routines

Data I/O Routines

The following routines read or write data values in the current HDU of the FITS file. The `datatype' parameter specifies the datatype of the parameters pointed to by the `array` and `nulval' pointers. `Datatype' can have one of the following symbolic constant values: TBYTE, TUSHORT, TSHORT, TINT, TULONG, TLONG, TFLOAT, or TDOUBLE. The routines for reading or writing table columns also support the TLOGICAL, TSTRING, TCOMPLEX and TDBLCOMPLEX datatypes. Automatic datatype conversion will be attempted for numerical datatypes if the specified datatype is different from the actual datatype of the FITS array or table column.

1
Write elements into the primary array or image extension.

  int fits_write_img / ffppr
      (fitsfile *fptr, int datatype, long firstelem, long nelements,
       DTYPE *array, int *status);

2
Read elements from the primary array or image extension. Undefined array elements will be returned with a value = *nulval unless nulval = 0 or *nulval = 0, in which case no checks for undefined pixels will be performed. The anynul parameter is set to true (= 1) if any of the returned elements were undefined. Note that the address to the null value, not the null value itself must be supplied to this routine.

  int fits_read_img / ffgpv
      (fitsfile *fptr, int  datatype, long firstelem, long nelements,
       DTYPE *nulval, > DTYPE *array, int *anynul, int *status)

3
Write elements into an ASCII or binary table column. The `firstelem' parameter applies only to vector columns in binary tables and is ignored when writing to ASCII tables.

  int fits_write_col / ffpcl
      (fitsfile *fptr, int datatype, int colnum, long firstrow,
       long firstelem, long nelements, DTYPE *array, > int *status)

4
Read elements from an ASCII or binary table column. Undefined array elements will be returned with a value = *nulval unless nulval = 0 or *nulval = 0, in which case no checking for undefined values will be performed. The anynul parameter is set to true (= 1) if any of the returned elements were undefined. Note that the address to the null value, not the null value itself must be supplied to this routine.

  int fits_read_col / ffgcv
      (fitsfile *fptr, int datatype, int colnum, long firstrow, long firstelem,
       long nelements, DTYPE *nulval, DTYPE *array, int *anynul, int *status)

5
Get the table column number and full name of the column whose name matches the input template string. See the `Advanced Interface Routines' chapter for a full description of this routine.

  int fits_get_colname / ffgcnn
      (fitsfile *fptr, int casesen, char *templt, > char *colname,
       int *colnum, int *status)



next up previous contents Back To Software Index
Next: Advanced Interface Routines Up: Basic Interface Routines Previous: Keyword I/O Routines