% @(#)computdima.hlq 17.1.1.1 (ESO-IPG) 01/25/02 17:43:20 %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %.COPYRIGHT (c) 1990 European Southern Observatory %.IDENT computdima.hlq %.AUTHOR KB, IPG/ESO %.KEYWORDS MIDAS, help files, COMPUTE/DIMAGE %.PURPOSE On-line help file for the command: COMPUTE/DIMAGE %.VERSION 1.0 19-MAR-1998 : Creation, KB %---------------------------------------------------------------- \se SECTION./DIMA \es\co COMPUTE/DIMAGE 19-MAR-1998 KB \oc\su COMPUTE/DIMAGE [outspec =] expression compute arithmetic expression \us\pu Purpose: Perform arithmetic operations in double precision on constants and images, using world coordinates. \up\sub Subject: Double precision arithmetic \bus\sy Syntax: COMPUTE/DIMAGE [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 double precision 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 double precision keyword OUTPUTD(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. Images must have same stepsize within 0.0001 of a step and same origins within 0.05 of a step. Computations are done on the common area of all images only! \ap\no Note: 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 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 double. 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. \on\sa See also: COMPUTE/DPIXEL, COMPUTE/DPLANE, COMPUTE/IMAGE \as\exs Examples: \ex COMPUTE/DIMA 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/DIMA 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/DIMA EXP(25003.01/30001234.45678)+SIN(1.1) Compute the expression and store result in keyword OUTPUTD(1). \xe\ex COMPUTE/DIMA 100011.13*{OUTPUTD(1)} + 4.001002005 Use result from computation above. \xe\ex COMPUTE/DIMA 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/DIMA a = a+LOG10(a) Also in VMS just modify frame `a.bdf', do not create a new file. \xe \sxe