Group an array into a set of equal-width groups (by number of groups).
grpNumBins( Integer_Type numChans, Integer_Type numGroups )
grpNumBins( Integer_Type numChans, Integer_Type numGroups, Array_Type
tabStops )
Returns: ( Array_Type grouping, Array_Type quality )
This function returns the grouping and quality arrays
that represent an array of numChans elements
grouped into numGroups groups.
The optional parameter tabStops is an array
which lists those elements that should be ignored.
This function provides the same functionality
as the NUM_BINS option of dmgroup.
The grpBinWidth() function allows you to fix
the width of the group rather than the number of
groups.
chips> (g,q) = grpNumBins( 10, 2 )
This example calculates the grouping and quality arrays
that represent an array of 10 elements grouped into
2 groups.
chips> x = [0.5:6.0:0.05]
chips> y = 3 + 30 * exp( - (x-2.0)^2 / 0.1 )
chips> (g,q) = grpNumBins( length(y), 10 )
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 the function
y = 3 + 30 * exp( -(x-2)^2 / 0.1 )
and group it so that there are 10 groups.
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
|