FCARITH (Sep92) ftools.fimage FCARITH (Sep92) 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. USAGE fcarith INFILE CONST OUTFIL OPS 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. PARAMETERS infile [filename] The name and extension of the input FITS file image. const [real] The value of the constant to be used in the calculation. outfil [filename] 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. ops [string] 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. (datatype) [string] 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). (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. (copyprime = yes) [boolean] Whether to copy keywords from the primary array of infile1. (clobber = no) [boolean] If true, an existing file with the same name as the output file will be overwritten. 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 BUGS SEE ALSO farith