% @(#)computimag.hlq	19.1 (ESO-IPG) 02/25/03 14:03:03 
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.COPYRIGHT  (c)  1990 European Southern Observatory
%.IDENT      computimag.hlq
%.AUTHOR     KB, IPG/ESO
%.KEYWORDS   MIDAS, help files, COMPUTE/IMAGE
%.PURPOSE    On-line help file for the command: COMPUTE/IMAGE
%.VERSION    1.0  06-APR-1990 : Creation, KB
%.VERSION    1.1  26-SEP-1991 : Update, KB
%.VERSION    1.2  05-JAN-1993 : Update, KB
%----------------------------------------------------------------
\se
SECTION./IMAG
\es\co
COMPUTE/IMAGE					04-OCT-2002  KB
\oc\su
COMPUTE/IMAGE [outspec =] expression
	compute arithmetic expression
\us\pu
Purpose:  
           Perform arithmetic operations on constants and images, using
           world coordinates.
\up\sub
Subject: 
           Arithmetic.
\bus\sy
Syntax: 
           COMPUTE/IMAGE [outspec =] expression
\ys\pa
           outspec = frame to get result of expression. 
               It will be created with the size of the common area of all
               images involved in the expression. The result frame will be 
               created using real data format, no matter what data format 
	       the individual input frames have.
               If "outspec =" is omitted, the expression should contain only
               numerical constants, the result of the computation is shown on
               the terminal and stored in real keyword OUTPUTR(1).
               If descriptor copying is enabled (which is the default,
               see also the command SET/MIDAS_SYSTEM DSCCOPY=..),
               all non-standard descriptors of the 1. input frame in the
               expression are copied to the result frame unless you enter
               `frame,dscname' as outspec with dscname the name of a frame
               in the expression;
               then, the non-standard descriptors of that frame are copied
               instead of the ones of the 1. frame in the expression
\ap\pa
           expression = arithmetic expression with up to 21 operands, which may
               be functions and frames or/and constants in the usual algebraic
               notation. 
\ap\no
Note:      
             OJO: Images must have same stepsize within 0.0001 of a step
           and the overlapping start values must be within 0.01 of a step.
           Computations are done on the common area of all images only!

             Spaces before and after the "=" sign are required. If the name of
           frame begins with a digit or contains a special char. like, e.g.
           `+',`-',... the name (with filetype!) has to be enclosed in double
           quotes.
             Inside the expression may be spaces or not. However, if your
           expression is longer than 100 chars. (the current max. token length)
           without spaces, you should include spaces between some operands,
           then the limit is 256 chars. for the complete command line. 
             If the result frame has the same name as a frame appearing in the
           expression, no new frame is created, but the result frame
           is overwritten (also in VMS!). This option should be used with
           care, since computations are only done on the overlapping area of
           all frames in the expression!
           Furthermore, since no new result frame is created, the final data is
           reconverted to the original data format when closing the result
           frame and you could get truncation errors!
             The operations +, -, *, / and ** are supported with the same
           precedence as in FORTRAN. Parentheses may be used to change that
           order as well as to nest operations.
             The functions
           SQRT(a), EXP(a), EXP10(a), LN(a), LOG10(a), SIN(a) ASIN(a), COS(a),
           ACOS(a), TAN(a), ATAN(a), INT(a), ABS(a), ATAN2(a1,a2), MAX(a1,a2),
           MIN(a1,a2) and MOD(a1,a2)
           are implemented as in FORTRAN. Except, that INT(a) will return the
           nearest integer of "a" converted to real. The trigonometric
           functions expect arguments in degrees!
             Results of illegal operations (e.g. division by zero) are set to
           the "null value" stored in the real keyword NULL.
             This command uses single precision (floating point) calculations,
           if you need higher precision, use COMPUTE/DIMAGE instead.
\on\sa
See also:
           COMPUTE/PIXEL, COMPUTE/ROW, COMPUTE/COLUMN, COMPUTE/XYPLANE
           COMPUTE/DIMAGE, COMPUTE/PLANE, COPY/II, REPLACE/IMAGE
           @a func2d, SET/MIDAS_SYS
\as\exs
Examples:
\ex
           COMPUTE/IMA r = sqrt(c+5.-log10(b))+abs(aa)
             Compute resulting image `r.bdf' from the expression involving the
             frames `c.bdf', `b.bdf' and `aa.bdf'.
             If descriptor copying is enabled, all non-standard descriptors of 
             `c.bdf' (the 1. frame in the expression) are copied to `r.bdf'.
\xe\ex
           COMPUTE/IMA r,aa = sqrt(c+5.-log10(b)) + abs(aa)
             As above, but if descriptor copying is enabled, all non-standard
             descriptors of `aa.bdf' are copied to `r.bdf'.
\xe\ex
           COMPUTE/IMA EXP(25./3.4) + SIN(1.1)
             Compute the expression and store result in keyword OUTPUTR(1).
\xe\ex
           COMPUTE/IMA 10.3*{OUTPUTR(1)}+4.5
             Use result from computation above.
\xe\ex
           COMPUTE/IMA r = sqrt(c)) + qso+22.bdf"
             Compute resulting image `r.bdf' from the expression involving the
             frames `c.bdf' and `qso+22.bdf'. 
\xe\ex
           COMPUTE/IMA a = a+LOG10(a)
             Also in VMS just modify frame `a.bdf', do not create a new file.
\xe \sxe
