Group an array so that its absolute gradient is above a user-defined limit.
grpMaxSlope( Array_Type axisArray, Array_Type dataArray, Double_Type
slope )
grpMaxSlope( Array_Type axisArray, Array_Type dataArray, Double_Type
slope, Integer_Type maxLength )
grpMaxSlope( Array_Type axisArray, Array_Type dataArray, Double_Type
slope, Integer_Type maxLength, Array_Type tabStops )
Returns: ( Array_Type grouping, Array_Type quality )
In this routine, groups are created when the
absolute value of the slope of the input data (the axisArray and binArray
arguments) is less than the threshold value (the slope
argument).
The slope is calculated as
delta[dataArray] / delta[axisArray]
The optional parameters maxLength and tabStops
represent the maximum number of elements
that can be combined and an array representing those
elements that should be ignored respectively.
This function provides the same functionality
as the MAX_SLOPE option of dmgroup.
chips> (g,q) = grpMaxSlope( x, y, 2 )
This example calculates the grouping and quality arrays
that represent the input data (here the contents of the x
and y arrays) in groups in which the slope is more than 2.
chips> x = [1:10]
chips> y = [1, 2, 10, 1, 1, 20, 40, 80, 20, 2 ]
chips> (g,q) = grpMaxSlope( x, y, 2 )
chips> ysum = grpGetGroupSum( y, g )
chips> nchan = grpGetChansPerGroup( g )
chips> i = where( g == 1 )
chips> yavg = ysum[i] / nchan[i]
chips> curve( x, y )
chips> simpleline
chips> curve( x[i], yavg )
chips> symbol square
chips> symbol red
Here we take a dataset and group it so that the
resulting groups differ by a slope at least 2.
The plot shows the original data (the solid line and the
crosses) and the grouped data (as the
red squares); the latter has been normalised by the
width of each group and is displayed at the left-edge
of each group.
- group
-
grpadaptive,
grpadaptivesnr,
grpbin,
grpbinfile,
grpbinwidth,
grpgetchanspergroup,
grpgetgroupsum,
grpgetgrpnum,
grpmaxslope,
grpminslope,
grpnumbins,
grpnumcounts,
grpsnr
- modules
-
group
|