Data.bin¶
- Data.bin(xcol=None, ycol=None, bins=0.03, mode='log', clone=True, yerr=None, **kwargs)¶
Bin x-y data into new values of x with an error bar.
- Parameters:
datafile (Data) – Data object to work with if not being used as a bound method.
xcol (index) – Index of column of data with X values
ycol (index) – Index of column of data with Y values
bins (int, float or 1d array) – Number of bins (if integer) or size of bins (if float), or bin edges (if array)
mode (string) – “log” or “lin” for logarithmic or linear binning
- Keyword Arguments:
yerr (index) – Column with y-error data if present.
bin_start (float) – Manually override the minimum bin value
bin_stop (float) – Manually override the maximum bin value
clone (bool) – Return a clone of the current AnalysisMixin with binned data (True) or just the numbers (False).
yerr – Column to use for y-errors if not None.
**kwargs – Other keyword arguments passed to make_bins
- Returns:
(
Stoner.Dataor tuple of 4 array-like) – Either a clone of the current data set with the new binned data or tuple of (bin centres, bin values, bin errors, number points/bin), depending on the clone parameter.
Note
Algorithm inspired by MatLab code wbin, Copyright (c) 2012: Michael Lindholm Nielsen
See also
User Guide section (Re)Binning Data