HyperSpy API is changing in version 2.0, see the release notes!

Binned and unbinned signals#

Signals that are a histogram of a probability density function (pdf) should have the is_binned attribute of the signal axis set to True. The reason is that some methods operate differently on signals that are binned. An example of binned signals are EDS spectra, where the multichannel analyzer integrates the signal counts in every channel (=bin). Note that for 2D signals each signal axis has an is_binned attribute that can be set independently. For example, for the first signal axis: signal.axes_manager.signal_axes[0].is_binned.

The default value of the is_binned attribute is shown in the following table:

Binned default values for the different subclasses.#

BaseSignal subclass

binned

Library

BaseSignal

False

hyperspy

Signal1D

False

hyperspy

exspy.signals.EELSSpectrum

True

exSpy

exspy.signals.EDSSEMSpectrum

True

exSpy

exspy.signals.EDSTEMSpectrum

True

exSpy

Signal2D

False

hyperspy

ComplexSignal

False

hyperspy

ComplexSignal1D

False

hyperspy

ComplexSignal2D

False

hyperspy

To change the default value:

>>> s.axes_manager[-1].is_binned = True 

Changed in version 1.7: The binned attribute from the metadata has been replaced by the axis attributes is_binned.

Integration of binned signals#

For binned axes, the detector already provides the per-channel integration of the signal. Therefore, in this case, integrate1D() performs a simple summation along the given axis. In contrast, for unbinned axes, integrate1D() calls the integrate_simpson() method.