Program: GRADIENT Purpose: Calculates the gradients or the laplacian of a map, using three by three sized templates. Category: CALCULATION File: gradient.c Author: Fred Lahuis Keywords: INSET= Set and subset(s) to be used. The maximum number of subsets is 50 and the maximun number of axis 10 (if desirable these values can be altered). The dimension of the subsets has to be 2. BOX= Area to be used. [whole subset] GRADIENT= The kind of output wanted. [1] 1 --> x and y gradient 2 --> x gradient only 3 --> y gradient only 4 --> gradient and gradient-direction phi (in radians anticlockwise from positive x-axis) 5 --> gradient only 6 --> laplacian ASET= First output set. If no name is entered _xxx will be made, where xxx is gradx if gradient is 1 or 3, grady if gradient is 2, grad if gradient is 4 or 5. BSET= Second output set, if GRAD= 1 or 4. If ASET is not entered _xxx will be made, where xxx is grady if gradient is 1 and phi if gradient is 4, else BSET is asked and a setname must be entered. **BLANK= Value used to substitute possible blanks [0] in the map. **CONSTANT= Constant used in the gradient templates. [sqrt(2)] Usually a value between 1 and 2 is used. **FULL= To determine the size of the output set(s). [Y]/N Y --> size of the input set N --> size of the box **SIGMA= Value below which the gradient is [0] set to zero if its absolute value is less then this. Comments: The values for BLANK, CONSTANT and SIGMA can be altered while the program is running, e.g. to enter a different value for the next subset while the program is working on the present subset. Description: GRADIENT calculates the gradients in a map using three by three templates over the set and normalizing the result. -1 0 1 1 c 1 (x templ.) -c 0 c (y templ.) 0 0 0 -1 0 1 -1 -c -1 The gradient (GRAD= 4 or 5) is taken as grad = sqrt( sqr(buf_a) + sqr(buf_b) ). The laplacian is an approximation to the mathematical laplacian. It is represented by a 'circular' template with a central value of -1 and four surrounding values of 0.25. Comments: Blank values in the map are treated as if being equal to zero, unless a value is given by BLANK, which is then used instead. If an existing set is overwritten the data outside the box is not removed. GRADIENT also updates the header item NOISE. This value is taken as the spread in data points, so to have a first guess of the true noise in the map. Updates: April 8 1991: FL Document created. Feb 25 1991: FL Last update.