- Form:ADD dest [other] [CONST=c] [BOX=B] [DR=dr] [DC=dc]
-
- SUBTRACT dest [other] [CONST=c] [BOX=B] [DR=dr] [DC=dc]
-
- MULTIPLY dest [other] [CONST=c] [BOX=B] [DR=dr] [DC=dc]
-
- DIVIDE dest [other] [CONST=c] [BOX=B] [DR=dr] [DC=dc] [FLAT]
-
- dest
- is the buffer where the result will be stored
- other
- is the other buffer in the calculation, if any.
- CONST=c
- performs arithmetic between a buffer and a constant
- BOX=B
- limits the arithmetic to those pixels
in the source which are in box B
- DR=dr
- Gives a row offset between the 'dest' and 'other' buffers.
- DC=dc
- Gives a column offset between the 'dest' and 'other' buffers.
- FLAT
- rescales the division by the mean of 'other', preserving the
mean of the source.
These commands perform all arithmetic between images and spectra. There
are three ways to use these commands.
Operations between two images or two spectra:
In this form, the command word is followed by the numbers of the buffers
holding the images. Examples are
- ADD 1 2
- Add image in buffer 2 to image in buffer 1.
- SUBTRACT 3 4
- Subtract image in buffer 4 from image in buffer 3.
Note that the first buffer listed is the one modified by the operation.
The FLAT word is used in the DIVIDE command to re-scale the division by the
mean of the second image, thus preserving the mean of the first buffer.
This is typically used when dividing raw images by a flat field.
NOTE: The mean of the second image must have previously been
calculated by the MN command!
Operations between images and constants:
In this form, there is only one buffer specification on the command line.
The word CONST= (or C=) is used to specify the constant to be used.
- ADD 2 CONST=9.5
- Adds 9.5 to every pixel in buffer 2
- DIVIDE 3 CONST=10/3.1415
- Divides buffer 3 by 10/3.14159
Combined image and constant operations:
The first two forms of these commands may be combined, thus allowing you to
simultaneously operate on two images and a constant.
- ADD 2 3 CONST=5
- Adds buffers 3 to 2, then adds 5.0
to the result.
- MULTIPLY 1 $J CONST=0.01
- Multiplies buffer 1 by buffer J
(J a variable), then multiplies the result by 0.01.
Remarks:
In two-image arithmetic, only those pixels common to the two images are
changed by the operation. The size of the destination image is not changed
by the operation. The DR= and DC= keywords only apply to two-image
arithmetic and specify row and column offsets between the two images. The
sense of the shift is shown in the following example: dest(C+DC,R+DR) =
dest(C+DC,R+DR) + other(C,R).
BOX limits the operation to those pixels in the destination image which are
in the specified box.