next up previous contents FITSIO Home
Next: Keyword I/O Routines Up: Basic Interface Routines Previous: FITSIO Error Status Routines   Contents

File I/O Routines

1
Open an existing FITS file with readonly or readwrite access. This routine always opens the primary array (the first HDU) of the file, and does not move to a following extension, if one was specified as part of the filename. Use the FTNOPN routine to automatically move to the extension. This routine will also open IRAF images (.imh format files) and raw binary data arrays with READONLY access by first converting them on the fly into virtual FITS images. See the `Extended File Name Syntax' chapter for more details.

        FTOPEN(unit,filename,rwmode, > blocksize,status)

2
Open an existing FITS file with readonly or readwrite access and move to a following extension, if one was specified as part of the filename. (e.g., 'filename.fits+2' or 'filename.fits[2]' will move to the 3rd HDU in the file). Note that this routine differs from FTOPEN in that it does not have the redundant blocksize argument.

        FTNOPN(unit,filename,rwmode, > status)

3
Open an existing FITS file with readonly or readwrite access and then move to the first HDU containing significant data, if a) an HDU name or number to open was not explicitly specified as part of the filename, and b) if the FITS file contains a null primary array (i.e., NAXIS = 0). In this case, it will look for the first IMAGE HDU with NAXIS > 0, or the first table that does not contain the strings `GTI' (Good Time Interval) or `OBSTABLE' in the EXTNAME keyword value. FTTOPN is similar, except it will move to the first significant table HDU (skipping over any image HDUs) in the file if a specific HDU name or number is not specified. FTIOPN will move to the first non-null image HDU, skipping over any tables.

        FTDOPN(unit,filename,rwmode, > status)
        FTTOPN(unit,filename,rwmode, > status)
        FTIOPN(unit,filename,rwmode, > status)

4
Open and initialize a new empty FITS file. A template file may also be specified to define the structure of the new file (see secion 4.2.4).

        FTINIT(unit,filename,blocksize, > status)

5
Close a FITS file previously opened with ftopen or ftinit

        FTCLOS(unit, > status)

6
Move to a specified (absolute) HDU in the FITS file (nhdu = 1 for the FITS primary array)

        FTMAHD(unit,nhdu, > hdutype,status)

7
Create a primary array (if none already exists), or insert a new IMAGE extension immediately following the CHDU, or insert a new Primary Array at the beginning of the file. Any following extensions in the file will be shifted down to make room for the new extension. If the CHDU is the last HDU in the file then the new image extension will simply be appended to the end of the file. One can force a new primary array to be inserted at the beginning of the FITS file by setting status = -9 prior to calling the routine. In this case the old primary array will be converted to an IMAGE extension. The new extension (or primary array) will become the CHDU.

        FTIIMG(unit,bitpix,naxis,naxes, > status)

8
Insert a new ASCII TABLE extension immediately following the CHDU. Any following extensions will be shifted down to make room for the new extension. If there are no other following extensions then the new table extension will simply be appended to the end of the file. The new extension will become the CHDU.

        FTITAB(unit,rowlen,nrows,tfields,ttype,tbcol,tform,tunit,extname, >
               status)

9
Insert a new binary table extension immediately following the CHDU. Any following extensions will be shifted down to make room for the new extension. If there are no other following extensions then the new bintable extension will simply be appended to the end of the file. The new extension will become the CHDU.

        FTIBIN(unit,nrows,tfields,ttype,tform,tunit,extname,varidat > status)


next up previous contents FITSIO Home
Next: Keyword I/O Routines Up: Basic Interface Routines Previous: FITSIO Error Status Routines   Contents