relative_step

Contents

relative_step#

scarlet2.relative_step(x, *args, factor=0.01, minimum=1e-06)[source]#

Step size set at factor times the norm of x

This step size is useful for Parameter instances whose uncertainty is relative, not absolute, e.g. for ArraySpectrum.

Parameters:
  • x (array) – Array to compute step size for

  • *args (list) – Additional arguments

  • factor (float) – Scale norm by this number

  • minimum (float) – Minimum return value to prevent zero step sizes

Returns:

factor*norm(x), or minimum, whichever is larger.

Return type:

float