next up previous contents FITSIO Home
Next: Data Scaling Up: Basic FITSIO Conventions Previous: Subroutine Families and Datatypes

Implicit Data Type Conversion

Many of the data I/O subroutines have the ability to perform implicit data type conversion. This means that the data type of the subroutine parameter does not need to be the same as the data type of the value in the FITS file. More specifically, the implicit data type conversion will be performed for numerical data types when reading a FITS header keyword value and when reading or writing values to or from the primary array or a table column. FITSIO returns status = 412 if the converted data value exceeds the range of the output data type. Data type conversion is not allowed when reading or writing string (s), logical (l), complex (c), or double complex (m) data types.

One feature of the FITSIO routines is that they can operate on a `X' (bit) column in a binary table as though it were a `B' (byte) column. For example a `11X' datatype column can be interpreted the same as a `2B' column (i.e., 2 unsigned 8-bit bytes). In some instances, it can be more efficient to read and write whole bytes at a time, rather than reading or writing each individual bit (with the ftgcx and ftpclx routines).


next up previous contents FITSIO Home
Next: Data Scaling Up: Basic FITSIO Conventions Previous: Subroutine Families and Datatypes