hyperspy._components.polynomial_deprecated module

class hyperspy._components.polynomial_deprecated.Polynomial(order=2, legacy=True, module='numexpr', **kwargs)

Bases: hyperspy.component.Component

n-order polynomial component. (DEPRECATED)

Polynomial component defined by the coefficients parameters which is an array of len the order of the polynomial. For example, the [1,2,3] coefficients define the following 3rd order polynomial: f(x) = 1x² + 2x + 3 Polynomial will be replaced by Polynomial2

This API is deprecated and will be replaced by Polynomial in HyperSpy v2.0. To use the new API, set legacy to False.

  • order (int) – Order of the polynomial.

  • legacy (bool, default True) – If False, use the new API.

  • module (str) – See the docstring of Polynomial for details.



estimate_parameters(signal, x1, x2, only_current=False)

Estimate the parameters by the two area method

  • signal (Signal1D instance) –

  • x1 (float) – Defines the left limit of the spectral range to use for the estimation.

  • x2 (float) – Defines the right limit of the spectral range to use for the estimation.

  • only_current (bool) – If False estimates the parameters for the full dataset.

Return type



Returns a numpy array containing the value of the component for all indices. If enough memory is available, this is useful to quickly to obtain the fitted component without iterating over the navigation axes.

grad_one_coefficient(x, index)

Returns the gradient of one coefficient