.help fcarith Sep92 ftools.fimage
.ih
NAME
fcarith -- Read an input FITS file and a constant, perform
the requested arithmetic operations ADD, SUB, MUL or DIV and
write the output to a FITS file.
.ih
USAGE
fcarith INFILE CONST OUTFIL OPS
.ih
DESCRIPTION
This task will read an images from a FITS files and a constant
input by the user, perform any one of the operations ADD, SUB, 
MUL and DIV (or +, -, * or /), between each element of the FITS file 
and the input constant and write the output into an output FITS file.
(The * must be quoted to prevent expansion by the shell.)
The arithmetic operation can take place on images with n-dimensions.
Note that scaling is NOT done in the output file, so care should be
taken in setting datatype to avoid overflow and integer division problems.
.ih
PARAMETERS
.ls infile [filename]
.le
The name and extension of the input FITS file image.
.le
.ls const [real]
.le
The value of the constant to be used in the calculation.
.le
.ls outfil [filename]
.le
The name of the output FITS file.  The image will be place in the primary
array.  If preceeded by a !, an existing file of the same name will
be overwritten.
.le
.ls ops [string]
.le
The requested type of calculation.  The value can be either the words
ADD, SUB, MUL or DIV or the mathematical symbols +, -, * or /.  Extra
characters on the words (MULT for example) are ignored.
The * must be quoted to prevent expansion by the shell.
.le
.ls (datatype) [string]
.le
The datatype (or bits/pixel) of the output image.  If blank or "-", 
defaults are to the bitpix of the input image.
Acceptable inputs are (b,8), (i,short,16), (j,integer,int,long,32),
(r,f,e,real,float,-32) and (d,double,-64).
.le
.ls (overflow = no) [boolean]
Whether to ignore the overflow and underflow in the output file.
If true, the overflow and underflow elements of the output image
array will be ignored and replaced with the maximum and minimum
of the corresponding data type. If false, these elements
will throw an error and terminate the program. This option is only
relevant for byte, short and integer images.
.le
.ls (copyprime = yes) [boolean]
.le
Whether to copy keywords from the primary array of infile1.
.le
.ls (clobber = no) [boolean]
.le
If true, an existing file with the same name as the output file will
be overwritten.
.le
.ih
EXAMPLES 
1.  Read the image values in the primary array of INFILE and 
    divide all of the values by 10.  Write the resultant image 
    into the primary array of the output FITS file OUTFIL.
    
    ft> fcarith INFILE[0] 10. OUTFIL /

2. Same example using DIV

    ft> fcarith INFILE[0] 10. OUTFIL DIV

.fi
.ih
BUGS
.ih
SEE ALSO
farith
.endhelp
