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: Expression

Power law component.

\[f(x) = A\cdot(x-x_0)^{-r}\]

Variable

Parameter

\(A\)

A

\(r\)

r

\(x_0\)

origin

Parameters:
  • A (float) – Height parameter.

  • r (float) – Power law coefficient.

  • origin (float) – Location parameter.

  • **kwargs – Extra keyword arguments are passed to the Expression component.

left_cutoff

For x <= left_cutoff, the function returns 0. Default value is 0.0.

Type:

float

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

Estimate the parameters for the power law component 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).

Return type:

{bool, tuple of values}