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.
fcarith INFILE CONST OUTFIL OPS
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.
The name and extension of the input FITS file image.
The value of the constant to be used in the calculation.
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.
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.
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).
Whether to copy keywords from the primary array of infile1.
If true, an existing file with the same name as the output file will be overwritten.
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
farith