Documentation:Reference:TDI M2 - MdsWiki
Navigation
Personal tools

From MdsWiki

Jump to: navigation, search

MAP (A,B)

Transformation. Element selection from an array.

Arguments
A an array of any type considered to be a vector.
B a list of offsets into the A array.
Values are from 0 to the number of elements in A less 1.
Out-of-bounds values are considered to be at the limits.

Signals. Same as B.
Units... Same as A.
Form.... Same type as A and same shape as B.

Result.. Each value in B is used to look up a value in A.
The value is copied into the result.
This is the same as A(B) in IDL when B is a vector.
>>>>>>>>>WARNING, multidimensional arrays referenced by bad offsets
will likely be junk.

Examples. MAP(1..10,[20,-1,5]) is [10,1,6].
_A=5..1..-1, MAP(_A,SORTI(_A)) is [1,2,3,4,5],
which is the same as SORT(5..1..-1).

See also. CULL to remove bad B values.
SUBSCRIPT for dimensional indexing into signal and multiple index access to arrays.

matmul (MATRIX_A,MATRIX_B)

F90 Transformation. Performs matrix multiplication of numeric matrices.

Arguments
MATRIX_A numeric array of rank one or two. A vector is
considered to be of shape [1,m].
MATRIX_B numeric array of rank one or two. The size of the first
dimension of MATRIX_B must be the same as the size of
the last dimension of MATRIX_A. A vector is considered
to be of shape [m,1].
There is no support for F90 logical arrays.

Signals. Single signal or smaller data.
Units... Same as for MATRIX_A * MATRIX_B.
Form.... If MATRIX_A has shape [n,m] and MATRIX_B has shape
[m,k], the result has shape [n,k]. For rank-one cases,
the n or k is omitted.

Result.. Result element [i,j] is
SUM(MATRIX_A[i,:] * MATRIX_B[:,j]).

Examples. MATMUL(_A=[1 2 3],_B=[1 2]) is [14 20].
[2 3 4] [2 3] [20 29]
[3 4]
MATMUL([1,2],_A) is vector-matrix product [5,8,11].
MATMUL(_A,[1,2,3]) is matrix-vector product [14,20].

mat_rot (MATRIX,ANGLE,MAG,X0,Y0)

Transformation. Rotate a matrix about a point.

Arguments
MATRIX rank-two array.
ANGLE real scalar, clockwise? rotation of the data.
MAG real scalar, magnification.
X0 real scalar, first axis center of rotation.
Y0 real scalar, second axis center of rotation.

Signals. Same as MATRIX.
Units... Same as MATRIX.
Form.... Same as MATRIX.

Result.. The value at closest grid point to the rotated array.

mat_rot_int (MATRIX,ANGLE,MAG,X0,Y0)

Transformation. Rotate a matrix about a point with interpolation.

Arguments
MATRIX rank-two array.
ANGLE real scalar, clockwise? rotation of the data.
MAG real scalar, magnification.
X0 real scalar, first axis center of rotation.
Y0 real scalar, second axis center of rotation.

Signals. Same as MATRIX.
Units... Same as MATRIX.
Form.... Same as MATRIX.

Result.. The value interpolated from near-by grid points to the
rotated array.

MAX (A1,A2,A3,...)

F90 Numeric Elemental. Maximum value.

Arguments Integer or real. Complex numbers are an error.

Signals. The single signal or the smallest.
Units... The single or matching units, else bad.
Form.... The compatible form of all the arguments. Conversion is
done pairwise.

Result.. The largest argument. A reserved operand will dominate.

Example. MAX(-9.0,7.0,2.0) is 7.0.

MAXEXPONENT (X)

F90 Inquiry. The maximum exponent in the model representing numbers of
the same type as the argument.

Argument. X is real, scalar or array.

Signals. None.
Units... None.
Form.... Integer scalar.

Result.. The number emax for the model of the same type as X.
Example. MAXEXPONENT(1.0) is 127 on the VAX.

MAXLOC (ARRAY,[DIM],[MASK])

F90 Transformation. Determine the location of an element of ARRAY
having the maximum value of the elements identified by MASK.

Arguments Optional: MASK.
ARRAY numeric array.
DIM integer scalar from 0 to n-1, where n is rank of ARRAY.
MASK logical and conformable with ARRAY.

Signals. None.
Units.... None.
Form.... Long vector of size equal to rank of ARRAY.

Result.. The result is the vector of subscripts of an element
whose value equals the maximum of all elements of ARRAY
or all elements for which MASK is true. Reserved
operands ($ROPRAND) are ignored. Each subscript will
be in the extent of its dimension. For zero size, no
true elements in MASK, or all $ROPRAND the result is
undefined. If more than one element has the maximum
value the result is the first in array order. The result
is an offset vector even if there is a lower bound.

Examples for _A=[[0, -5, 8, -3],[3, 4, -1, 2],[1, 5, 6, -4]]:

MAXLOC(_A)is2,
MAXLOC(_A,,_A LT 6)is9,
MAXLOC(_A,0,_A LT 6)is[0,1,1], and
MAXLOC(_A,1,_A LT 6)is[1,2,1,1].


See also. MAXVAL for the value.

MAXVAL (ARRAY,[DIM],[MASK])

F90 Transformation. Maximum value of the elements of ARRAY along
dimension DIM corresponding to true elements of MASK.

Arguments Optional: DIM, MASK.
ARRAY numeric array.
DIM integer scalar from 0 to n-1, where n is rank of ARRAY.
MASK logical and conformable to ARRAY.

Signals. Same as ARRAY if DIM-th or all dimensions omitted.
Units... Same as ARRAY.
Form.... Same type as ARRAY. It is a scalar if DIM is absent or
ARRAY is scalar or vector. Otherwise, the result is an
array of rank n-1 and shaped like ARRAY with DIM
subscript omitted.

Result.. The result without DIM is the maximum value of the
elements of ARRAY, testing only those with true MASK
values and value not equal to the reserved operand
($ROPRAND). With DIM, the value of an element of the
result is the maximum of ARRAY elements with DIM
dimension fixed as the element number of the result.
If no value is found, -HUGE(ARRAY) is returned.

Examples. MAXVAL([1,2,3]) is 3. MAXVAL(_C,,_C LT 0) finds the
maximum negative element of C. If
_B=[1 3 5],
[2 4 6]
MAXVAL(_B,0) is [2,4,6] and MAXVAL(_B,1) is [5,6].

See also. MAXLOC for the location.

MEAN (ARRAY,[DIM],[MASK])

Transformation. Average value of the elements of ARRAY along dimension
DIM corresponding to the true elements of MASK.

Arguments Optional: DIM, MASK.
ARRAY numeric array.
DIM integer scalar from 0 to n-1, where n is rank of ARRAY.
MASK logical and conformable to ARRAY.

Signals. Same as ARRAY if DIM-th or all dimensions omitted.
Units... Same as ARRAY.
Form.... Same type as ARRAY. It is a scalar if DIM is absent or
ARRAY is scalar or vector. Otherwise, the result is an
array of rank n-1 and shaped like ARRAY with DIM
subscript omitted.

Result.. The result without DIM is the mean value of the elements
of ARRAY, testing only those with true MASK values and
value not equal to the reserved operand ($ROPRAND). With
DIM, the value of an element of the result is the mean
of ARRAY elements with dimension DIM fixed as the
element number of the result.
If no value is found, zero is given.

Examples. MEAN([1,2,3]) is 2. MEAN(_C,,_C GT 0) finds the mean of
positive element of C. If _B=[1 3 5],
[2 4 6]
MEAN(_B,0) is [1,3,5] and MEAN(_B,1) is [3,4].

median (ARRAY,WIDTH)

Transformation. Median filter of specified width or area.

Arguments
ARRAY integer or real, vector or rank-two array.
WIDTH integer scalar.

Signals. Same as ARRAY.
Units... Same as ARRAY.
Form.... Same as ARRAY.

Result.. Each element at least WIDTH/2 from the edge is median of
the values WIDTH/2 on each side of it. The perimeter is
equal to the first interior value. (subject to change)

MERGE (TSOURCE,FSOURCE,MASK)

F90 Logical Elemental. Choose alternative value according to a mask.

Arguments
TSOURCE any type compatible with FSOURCE.
FSOURCE any type compatible with TSOURCE.
MASK logical, conformable with TSOURCE and FSOURCE.

Signals. Single signal or smaller data.
Units... Single or common units (excluding MASK), else bad.
Form.... The type is the compatible type of FSOURCE and TSOURCE.
The shape conformable to FSOURCE, TSOURCE, and MASK.

Result.. If the MASK value is true, the TSOURCE value is use;
otherwise, the FSOURCE value is use.

Examples. MERGE([1,2,3],[4,5,6],[$TRUE,$FALSE,$TRUE]) is [1,5,3].
If TSOURCE is the array [1 6 5], FSOURCE is the array
[2 4 6]
[0 3 2] and MASK is [1 0 1],
[7 4 8] [0 0 1]
then MERGE(TSOURCE,FSOURCE,MASK)
is [1 3 5].
[7 4 6]

See also. CONDITIONAL with form: MASK ? TSOURCE : FSOURCE, for
scalar mask test.

METHOD_OF (A)

MDS Operation. Get the method field.

Argument. Descriptor as below.

Result.. A is searched for this:
DSC$K_DTYPE_METHOD, the method field.
Otherwise, an error.

MIN (A1,A2,A3,...)

F90 Numeric Elemental. Minimum value.

Arguments Integer or real. Complex numbers are an error.

Signals. The single signal or the smallest.
Units... The single or matching units, else bad.
Form.... The compatible form of all the arguments. Conversion is
done pairwise.

Result.. The smallest argument. A reserved operand will dominate.

Example. MIN(-9.0,7.0,2.0) is -9.0.

MINEXPONENT (X)

F90 Inquiry. The minimum exponent in the model representing numbers of
the same type as the argument.

Argument. X must be real or complex, scalar or array.

Signals. None.
Units... None.
Form.... Integer scalar.

Result.. The number emin for the model of the same type as X.

Example. MINEXPONENT(1.0) is -127 on the VAX.

MINLOC (ARRAY,[DIM],[MASK])

F90 Transformation. Determine the location of an element of ARRAY
having the minimum value of the elements identified by MASK.

Arguments Optional: MASK.
ARRAY numeric array.
DIM integer scalar from 0 to n-1, where n is rank of ARRAY.
MASK logical and conformable with ARRAY.

Signals. None.
Units.... None.
Form.... Long vector of size equal to rank of ARRAY.

Result.. The result is the vector of subscripts of an element
whose value equals the minimum of all elements of ARRAY
or all elements for which MASK is true. Reserved
operands ($ROPRAND) are ignored. Each subscript will
be in the extent of its dimension. For zero size, no
true elements in MASK, or all $ROPRAND the result is
undefined. If more than one element has the minimum
value the result is the first in array order. The result
is an offset vector even if there is a lower bound.

Examples for _A=[[0, -5, 8, -3],[3, 4, -1, 2],[1, 5, 6, -4]]:

MINLOC(_A)is1,
MINLOC(_A,,_A GT -4)is3,
MINLOC(_A,0,_A GT -4)is[3,2,0], and
MINLOC(_A,1,_A GT -4)is[0,1,1,0].


See also. MINVAL for the value.

MINVAL (ARRAY,[DIM],[MASK])

F90 Transformation. Minimum value of the elements of ARRAY along
dimension DIM corresponding to true elements of MASK.

Arguments Optional: DIM, MASK.
ARRAY numeric array.
DIM integer scalar from 0 to n-1, where n is rank of ARRAY.
MASK logical and conformable to ARRAY.

Signals. Same as ARRAY if DIM-th or all dimensions omitted.
Units... Same as ARRAY.
Form.... Same type as ARRAY. It is a scalar if DIM is absent or
ARRAY is scalar or vector. Otherwise, the result is an
array of rank n-1 and shaped like ARRAY with DIM
subscript omitted.
Result.. The result without DIM is the minimum value of the
elements of ARRAY, testing only those with true MASK
values and value not equal to the reserved operand
($ROPRAND). With DIM, the value of an element of the
result is the minimum of ARRAY elements with DIM
dimension fixed as the element number of the result.
If no value is found, +HUGE(ARRAY) is returned.

Examples. MINVAL([1,2,3]) is 3. MINVAL(_C,,_C GT 0) finds the
minimum positive element of C.
If _B=[1 3 5],
[2 4 6]
MINVAL(_B,0) is [1,3,5] and MINVAL(_B,1) is [1,2].

See also. MINLOC for the location.

MOD (A,P)

F90 Numeric Elemental. Remainder.
Usual Form A MOD P.

Arguments A and P must be integer or real.
Complex numbers are an error.

Signals. Single signal or smaller data.
Units... Single or common units, else bad.
Form.... Compatible form of A and P.

Result.. If P NE 0, the result is A-INT(A/P)*P. If P==0, the result
is the $ROPRAND for reals and undefined for integers.

Examples. MOD(3.0,2.0) is 1.0. MOD(8,5) is 3. MOD(-8,5) is -3.
MOD(8,-5) is -3. MOD(-8,-5) is -3.

MODEL_OF (A)

MDS Operation. Get the model field.

Argument. Descriptor as below.

Result.. A is searched for this:
DSC$K_DTYPE_CONGLOM, the model field.
Otherwise, an error.

modulo (A,P)

F90 Numeric Elemental. Remainder.
Usual Form A MODULO P.

Arguments A and P must be integer or real.
Complex numbers are an error.

Signals. Single signal or smaller data.
Units... Single or common units, else bad.
Form.... Compatible form of A and P.

Result.. If P NE 0, the result is A-FLOOR(REAL(A)/(REAL)P)*P.
If P==0, the result is the $ROPRAND for reals and
undefined for integers.

Examples. MODULO(8,5) is 3. MODULO(-8,5) is 2.
MODULO(8,-5) is -2. MODULO(-8,-5) is -3.

MULTIPLY (X,Y)

Numeric Elemental. Multiplication.
Usual Form X * Y.
Function Form MULTIPLY(X,Y).

Arguments X and Y must be numeric.

Signals. Single signal or smaller data.
Units... Those of X joined with those of Y by an asterisk.
Form.... Compatible form of X and Y.

Result.. Product of corresponding elements of X and Y.
>>>>>>>>>WARNING, integer overflow is ignored.

Examples. 3.0 * 2 is 6.0. BUILD_WITH_UNITS(3.0,"V")
* BUILD_SIGNAL(BUILD_WITH_UNITS($VALUE*2,"s"),4)) is
BUILD_SIGNAL(BUILD_WITH_UNITS(24.0,"V*s"),4).