Next: CONTINUE
Up: SIC Language Internal Help
Previous: BREAK
COMPUTE
[SIC\]COMPUTE OutVar OPERATION InVar [Parameters]
Perform operations or transformations on variables that are not directly
supported by the array capabilities of the SIC command interpretor.
OutVar is the output variable, InVar the input variable. Outvar must be
defined beforehand.
The following operations are available on REAL and DOUBLE_PRECISION
arrays, regardless of their nature:
- MAX MIN MEAN RMS SUM PROD
for which InVar is an array of rank 1 to 4 (a 1-D to 4-D array), and
OutVar must be an array of lesser rank (i.e., one or more dimension
less than InVar, down to a number), AND of identical shape as InVar
for the dimensions in common.
Example (if A[4,12,2,8] and b[4,12]): "COMPUTE B MAX A"
Sections, implicit transpositions, etc... permitted by SIC are
supported.
- HISTOGRAM
Example: "COMPUTE outvar HISTOGRAM invar [hmin] [hmax] [bval]
[eval]"
which puts in variable 'outvar' (dimension [n,2]) the histogram of
values of n-D variable 'invar', eventually between the cuts 'hmin'
and 'hmax', and with blanking values 'bval' and 'eval' (that is,
values of the invar array are not taken in account for the histogram
if at 'eval' from 'bval'). These Parameters can be absent. One can
use '*' to omit any of them.
The number of bins is dictated by the first dimension of the array
min of the 'invar' array. The 'outvar' variable contains the
histogram in its first column (outvar[1]) and the corresponding bin
value in the second column (outvar[2]).
The following transformations are available:
- FFT+ (Direct Fast Fourier Transform)
- FFT- (Inverse Fast Fourier Transform)
which accept REAL or COMPLEX parameters. OutVar is a 2-D array with
second dimension equals 2, storing respectively the Real and
Imaginary part of the (complex) output Fourier transform. By
default, InVar is like OutVar, but if parameter REAL is specified
InVar is a 1-D array.
- FOURT+ (Direct Fast Fourier Transform)
- FOURT- (Inverse Fast Fourier Transform)
Which operates on input and output on COMPLEX Arrays of dimension
[2,NX,NY]
- COMPLEX
Populates the Real part of outvar (complex variable) with invar
(real).
- REAL
outvar = REAL part of invar. Outvar is Real, Invar is Complex .
- IMAG
outvar = IMAGE part of invar. Outvar is Real, Invar is Complex.
- ABS
outvar = AMPLITUDE (invar). Outvar is Real, Invar is Complex.
- PHASE
outvar = PHASE (invar). Outvar is Real, Invar is Complex.
- CMPMUL as in COMPUTE varout CMPMUL varin1 varin2:
varout = PRODUCT of Varin1 and Varin2. All complex arrays.
Miscellaneous Operations:
- DATE as in COMPUTE creation_date DATE filename
Where 'filename' is a file name and returns the last modification
date in the integer variable 'creation_date'. Used in procedures to
check if file has been changed, etc...
- GAG_DATE as in COMPUTE idate GAG_DATE "15-DEC-2035"
stores the date "15-DEC-2035" as a modified Julian date in the
integer variable 'idate'. This modified julian date has little
meaning outside the rather sparse community of souls gathered around
the CLASS program, however...
Gildas manager
2001-04-18