Group an array by signal to noise.
grpSnr( Array_Type countsArray, Double_Type snr )
grpSnr( Array_Type countsArray, Double_Type snr, Integer_Type maxLength
)
grpSnr( Array_Type countsArray, Double_Type snr, Integer_Type
maxLength, Array_Type tabStops )
grpSnr( Array_Type countsArray, Double_Type snr, Integer_Type
maxLength, Array_Type tabStops, Array_Type errorCol )
Returns: ( Array_Type grouping, Array_Type quality )
This function returns the grouping and quality arrays
that represent the input data (countsArray) after
it has been grouped so that the signal to noise
of each group is at least equal to the snr parameter.
The optional parameters maxLength and tabStops
represent the maximum number of elements
that can be combined into a group and an array representing those
elements that should be ignored respectively.
The errorCol array gives the error for each element of
the original array: if it is not supplied then
the error is taken to be the square root of the
element value.
This function provides the same functionality
as the SNR option of dmgroup.
chips> (g,q) = grpSnr( y, 5 )
This example calculates the grouping and quality arrays
that represent the input data (here the contents of the y
array) after it has been grouped to have a signal to noise of
at least 5 per group.
chips> x = [0.5:6.0:0.05]
chips> y = 3 + 30 * exp( - (x-2.0)^2 / 0.1 )
chips> (g,q) = grpSnr( y, 5 )
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 the signal-to-noise of the
group is at least 5.
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
|