hyperspy._components.power_law module

class hyperspy._components.power_law.PowerLaw(A=1000000.0, r=3.0, origin=0.0, left_cutoff=0.0, module='numexpr', compute_gradients=False, **kwargs)

Bases: hyperspy._components.expression.Expression

Power law component

f(x) = A*(x-origin)^-r

The left_cutoff parameter can be used to set a lower threshold from which the component will return 0.

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

Estimate the parameters by the two area method

Parameters
  • 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.

  • out (bool) – If True, returns the result arrays directly without storing in the parameter maps/values. The returned order is (A, r).

Returns

Return type

{bool, tuple of values}

grad_A(x)
grad_origin(x)
grad_r(x)