NAME

fextract -- Extract (copy) an extension from a FITS file into a new FITS file


USAGE

        fextract infile[ext#] outfile[ext#]

DESCRIPTION

This task creates a new FITS file by copying the primary array or an extension from an existing FITS file into the new file. If an extension is copied, then the output file will have a null primary array with just the minimum set of required primary header keywords followed by the copied extension. If the extension to be copied is an image, it can be place in the primary array be specifying an extension of 0 in for the output file. The output extension number is ignored for all other cases. The input FITS file is not modified by this task.


PARAMETERS

infile [file name]
The file name and extension number of the extension is to be copied. Specify extension number = 0 to copy the primary array.

outfile [file name]
The name of the new FITS file to be created. If an image extension is to be copied, it can be optionally placed in the primary array of the output file by specifying extension 0. Any other extension specification will be ignored. If preceeded by a !, an existing output file of the same name will be overwritten.

(clobber = no) [boolean]
If true, an existing file with the same name as specified for outfile will be overwritten.


EXAMPLES

1. Extract the second extension from the input file test.fits and copy it to a new FITS file (with an empty primary array) called new.fits

             ft> fextract test.fits[2] new.fits 

2. Extract the primary array from the file test.fits and create a new FITS file called out.fits

             ft> fextract test.fits[0] out.fits 

3. Extract an image extension and place it in the primary array of the output file.

             ft> fextract test.fits[3] out.fits[0]


BUGS


SEE ALSO

ftcopy, ftselect, ftappend, ftmerge. fv, the interactive FITS file editor, can also be used to copy FITS extensions to a new file.

CATEGORY

Feb92 ftools.futils