Remarks, Sqr(source), Stddevspa(dest, swath, source) – Campbell Scientific CR9000X Measurement and Control System User Manual
Page 321: Swath

Section 8. Processing and Math Instructions
Remarks
The results from SortSpa can be stored in the same variable or a different
variable. If the results are stored in a different variable, the array is copied from
Source and stored into Dest prior to sorting. If the Source and Dest variables
are the same, then the sorting is done in place. NANs and +INFs are sorted to
the top of the array (that is, the most minimum value).
Parameter
& Data Type
Enter
SORTSPA PARAMETERS
Dest
Var or Array
The variable array in which to store the sorted values.
Swath
Constant
The number of elements in the Source array to include in the values to be sorted.
Source
Array
The first variable in the array for which the sort should be performed.
SQR(Source)
Returns the square root of a number.
Syntax
SQR(source)
Remarks
The argument source can be any valid numeric expression that results in a value
greater than or equal to 0. Returns the square root of the value in parentheses.
SQR Function Example
The example uses SQR to calculate the square root of Volt(1) value.
Dim Msg, Number
'Declare variables.
Number = Volt(1)
'Get input.
If Number < 0 Then
Msg = 0
‘Cannot calc the root of a negative number.
Else
Msg
=
SQR
(Number)
End If
StdDevSpa(Dest, Swath, Source)
Used to find the standard deviation of a sequential set of elements of an array.
Syntax
StdDevSpa(
Dest, Swath, Source
)
Remarks
Spatial standard deviation. NANs are not included in the processing of the
Spatial Standard Deviation.
2
1
1
2
1
2
/
/
)
(
)
(
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛
⎟⎟
⎠
⎞
⎜⎜
⎝
⎛
⎟
⎠
⎞
⎜
⎝
⎛
−
=
∑
∑
−
+
=
=
−
+
=
=
swath
swath
i
X
i
X
Dest
swath
j
i
j
i
swath
j
i
j
i
Where X(j) = Source
8-35