mcsas.utils.binning module¶
binningArray(): Can be used to do n-by-n pixel binning of 2D detector images. The returned uncertainty is the larger of either the binned uncertainty or the sample standard deviation in the bin.binning1d(): bins the data and propagates errors, or calculates errors if not initially providedbinningWeighted1d(): Weighted binning, where the intensities of a pixel are divided between the two neighbouring bins depending on the distances to the centres. If error provided is empty, the standard deviation of the intensities in the bins are computed.
-
array(value)¶ Warning
function ‘utils.binning.array’ undocumented
-
binning1d(q, intensity, error=None, numBins=200, stats='std')[source]¶ An unweighted binning routine. The intensities are sorted across bins of equal size. If provided error is empty, the standard deviation of the intensities in the bins are computed.
-
binningArray(q, psi, intensity, error, s=2)[source]¶ This function applies a simple s-by-s binning routine on images. It calculates new error based on old error superseded by standard deviation in a bin.
-
binningWeighted1d(q, intensity, error=None, numBins=200, stats='se')[source]¶ Implementation of the binning routine written in Matlab. The intensities are divided across the q-range in bins of equal size. The intensities of a pixel are divided between the two neighbouring bins depending on the distances to the centres. If error provided is empty, the standard deviation of the intensities in the bins are computed.
Usage:
qbin, ibin, ebin = binning_weighted_1d(q, intensity, error = [], numBins = 200, stats = 'se')
Optional input arguments:
- numBins: integer indicating the number of bins to divide the intensity
- over. Alternatively, this can be an array of equidistant bin centres. If you go this route, depending on the range, not all intensity may be counted.
- stats: Can be set to ‘auto’. This takes the maximum error between
- supplied Poisson statistics error-based errors or the standard error.
Written by Brian R. Pauw, 2011, released under BSD open source license.