Skip to the navigation links
Last modified: December 2009

AHELP for CIAO 4.2


Context: group


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. The tabStops array must be the same length as the channels array. A value of 0 means no tab; a value of 1 means that there is a tab stop.

This function provides the same functionality as the MAX_SLOPE option of dmgroup.

The group module is not available by default; to use it in a S-Lang program, it must be loaded using the S-Lang require() function:


Example 1

slsh> (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.

Example 2

slsh> x = [1:10];
slsh> y = [1, 2, 10, 1, 1, 20, 40, 80, 20, 2 ];
slsh> (g,q) = grpMaxSlope( x, y, 2 );
slsh> ysum = grpGetGroupSum( y, g );
slsh> nchan = grpGetChansPerGroup( g );
slsh> i = where( g == 1 );
slsh> yavg = ysum[i] / nchan[i];

Here we take a dataset and group it so that the resulting groups differ by a slope at least 2.


See the bugs page for the group library on the CIAO website for an up-to-date listing of known bugs.

See Also

grpadaptive, grpadaptivesnr, grpbin, grpbinfile, grpbinwidth, grpgetchanspergroup, grpgetgroupsum, grpgetgrpnum, grpmaxslope, grpminslope, grpnumbins, grpnumcounts, grpsnr

Last modified: December 2009