next up previous contents FITSIO Home
Next: 9.6.4 Read Column Data Up: 9.6 Specialized FITS ASCII Previous: 9.6.2 Low-Level Table Access

9.6.3 Write Column Data Routines

1
Write elements into an ASCII or binary table column (in the CDU). The datatype of the array is implied by the suffix of the routine name.  
  int fits_write_col_str / ffpcls
      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
       long nelements, char **array, > int *status)

  int fits_write_col_[log,byt,sht,usht,int,uint,lng,ulng,lnglng,flt,dbl,cmp,dblcmp] /
      ffpcl[l,b,i,ui,k,uk,j,uj,jj,e,d,c,m]
      (fitsfile *fptr, int colnum, long firstrow,
           long firstelem, long nelements, DTYPE *array, > int *status)
2
Write elements into an ASCII or binary table column substituting the appropriate FITS null value for any elements that are equal to the nulval parameter. This routines must not be used to write to variable length array columns.  
  int fits_write_colnull_[log, byt, sht, usht, int, uint, lng, ulng, lnglng, flt, dbl] /
      ffpcn[l,b,i,ui,k,uk,j,uj,jj,e,d]
      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
       long nelements, DTYPE *array, DTYPE nulval, > int *status)
3
Write string elements into a binary table column (in the CDU) substituting the FITS null value for any elements that are equal to the nulstr string. This routine must NOT be used to write to variable length array columns.  
  int fits_write_colnull_str / ffpcns
      (fitsfile *fptr, int colnum, long firstrow, long firstelem,
       long nelements, char **array, char *nulstr, > int *status)
4
Write bit values into a binary byte ('B') or bit ('X') table column (in the CDU). Larray is an array of logical values corresponding to the sequence of bits to be written. If larray is true then the corresponding bit is set to 1, otherwise the bit is set to 0. Note that in the case of 'X' columns, CFITSIO can write to all 8 bits of each byte whether they are formally valid or not. Thus if the column is defined as '4X', and one calls ffpclx with firstbit=1 and nbits=8, then all 8 bits will be written into the first byte (as opposed to writing the first 4 bits into the first row and then the next 4 bits into the next row), even though the last 4 bits of each byte are formally not defined. It should also be noted that it is more efficient to write 'X' columns an entire byte at a time, instead of bit by bit. Any of the CFITSIO routines that write to columns (e.g. fits_write_col_byt) may be used for this purpose. These routines will interpret 'X' columns as though they were 'B' columns (e.g., '8X' is equivalent to '1B', and '16X' is equivalent to '2B').  
  int fits_write_col_bit / ffpclx
      (fitsfile *fptr, int colnum, long firstrow, long firstbit,
       long nbits, char *larray, > int *status)
5
Write the descriptor for a variable length column in a binary table. This routine can be used in conjunction with ffgdes to enable 2 or more arrays to point to the same storage location to save storage space if the arrays are identical.  
    int fits_write_descript / ffpdes
        (fitsfile *fptr, int colnum, long rownum, long repeat,
         long offset, > int *status)

next up previous contents FITSIO Home
Next: 9.6.4 Read Column Data Up: 9.6 Specialized FITS ASCII Previous: 9.6.2 Low-Level Table Access