2.8. empix.downsample
- downsample(input_signal, optional_params=None)[source]
Downsample a given input 2D
hyperspysignal.This Python function copies a given input 2D
hyperspysignal and downsamples the copy along the axes in signal space. The Python function effectively does the following:1. Groups the pixels of the copy of the input signal into so-called downsampling blocks along the axes in signal space, with dimensions determined by the parameter
block_dims, padding the copy with a constant value ofpadding_constin the case that either the horizontal or vertical dimensions of the signal space of the original input signal are not divisible by the corresponding dimensions of the downsampling blocks.2. For each downsampling block, the Python function calls a
numpyfunction determined by the parameterdownsample_mode, wherein the input is the array data of the downsampling block, and the output is the value of the corresponding pixel of the downsampled signal.- Parameters:
- input_signal
hyperspy._signals.signal2d.Signal2D|hyperspy._signals.complex_signal2d.ComplexSignal2D The input
hyperspysignal.- optional_params
empix.OptionalDownsamplingParams| None, optional The set of optional parameters. See the documentation for the class
empix.OptionalDownsamplingParamsfor details. Ifoptional_paramsis set toNone, rather than an instance ofempix.OptionalDownsamplingParams, then the default values of the optional parameters are chosen.
- input_signal
- Returns:
- output_signal
hyperspy._signals.signal2d.Signal2D|hyperspy._signals.complex_signal2d.ComplexSignal2D The output
hyperspysignal that results from the downsampling. Note that the metadata of the input signal is copied over to the output signal, with the title being overwritten.
- output_signal