Group an array so that its absolute gradient is below a user-defined limit.
grpMinSlope( Array_Type axisArray, Array_Type dataArray, Double_Type
slope )
grpMinSlope( Array_Type axisArray, Array_Type dataArray, Double_Type
slope, Integer_Type maxLength )
grpMinSlope( 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 more 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 MIN_SLOPE option of dmgroup.
chips> (g,q) = grpMinSlope( 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 less than 2.
chips> x = [1:10]
chips> y = [1, 2, 1, 10, 1, 2, 1, 2, 1, 2 ]
chips> (g,q) = grpMinSlope( 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 that is essentially flat,
except for one point, and group it so that the
resulting groups differ by a slope of no more
than 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
|