Calculate the group number for each element in the array.
Integer_Type grpnum = grpGetGrpNum( Array_Type grouping )
This function calculates which group each element in
the input array belongs to, where the groups are numbered from
1.
The return value is an array whose length equals
that of the input data (the grouping argument)
and each element within a group contains the same value.
As an example,
grpGetGrpNum( [1,-1,1,-1,1,1] )
will return the array
since the groups consist of the first two elements,
then the next two elements, with the last two elements
being un-grouped.
chips> igrp = grpGetGrpNum( grp )
The igrp array will contain the group number for
each element of the input array, for the
grouping scheme stored in the grp array,
and has the same size as the grp array.
chips> x = [0.5:6.0:0.05]
chips> y = 3 + 30 * exp( - (x-2.0)^2 / 0.1 )
chips> ( grp, qual ) = grpNumCounts( y, 15 )
chips> yavg = grpGetGroupSum( y, grp ) / grpGetChansPerGroup( grp )
chips> igrp = grpGetGrpNum( grp )
chips> i = where( grp == 1 and qual == 0 )
chips> split 2
chips> curve( x, y )
chips> d 2
chips> curve( igrp[i], yavg[i] )
Here we take the function
y = 3 + 30 * exp( -(x-2)^2 / 0.1 )
and group it by 15 counts per group.
Two plots are created: the upper plot is the original
dataset and the lower plot is the grouped data (averaged by
the width of each group) plotted as a function of
the group number.
- group
-
grpadaptive,
grpadaptivesnr,
grpbin,
grpbinfile,
grpbinwidth,
grpgetchanspergroup,
grpgetgroupsum,
grpgetgrpnum,
grpmaxslope,
grpminslope,
grpnumbins,
grpnumcounts,
grpsnr
- modules
-
group
|