[fitsbits] question about cfitsio

William Pence pence at tetra.gsfc.nasa.gov
Tue Oct 22 17:35:43 EDT 2002


First, cfitsio v2.1 is 2 years old, so you should get the latest 2.42
version (2.43 will be out shortly).

To answer your question:
  1. Call fits_create_file to create a new empty FITS file.
  2. Call fits_create_tbl to create an empty table with zero rows.
  3. Call fits_write_col to write to each column.  It is more 
     efficient to write to multiple rows within a column at one time 
     rather than one row at a time, except in the case of variable  
     length arrays which must be written one row at a time.
  4. Close the file with fits_close_file.

-Bill Pence

Greg Hennessy wrote:
> 
> I am trying to use cfitsio 2.1. I want to create a fits binary table,
> add rows to it, and it won't be known in advance how many rows I
> have. I thought I might try writing an element at a time via
> fits_write_col, but that routine must not be used to write to variable
> length array columns. I don't see what routine should be used. I can
> see a fits_insert_rows, but it isn't clear to me how to set the data
> in the row after I fits_insert_rows the row.
> 
> Can anyone offer advice on what I am missing?

____________________________________________________________________
Dr. William Pence                          pence at tetra.gsfc.nasa.gov
NASA/GSFC Code 662         HEASARC         +1-301-286-4599 (voice)     
Greenbelt MD 20771                         +1-301-286-1684 (fax)




More information about the fitsbits mailing list