Parameter

class gammapy.utils.fitting.Parameter(name, factor, unit='', scale=1, min=nan, max=nan, frozen=False)[source]

Bases: object

Class representing model parameters.

Parameters:

name : str

Name

factor : float or Quantity

Factor

scale : float, optional

Scale (sometimes used in fitting)

unit : Unit or str, optional

Unit

min : float, optional

Minimum (sometimes used in fitting)

max : float, optional

Maximum (sometimes used in fitting)

frozen : bool, optional

Frozen? (used in fitting)

Attributes Summary

factor Factor (float).
frozen Frozen? (used in fitting) (bool).
max Maximum (float).
min Minimum (float).
name Name (str).
quantity Value times unit (Quantity).
scale Scale (float).
unit Unit (Unit).
value Value = factor x scale (float).

Methods Summary

autoscale([method]) Autoscale the parameters.
to_dict()

Attributes Documentation

factor

Factor (float).

frozen

Frozen? (used in fitting) (bool).

max

Maximum (float).

min

Minimum (float).

name

Name (str).

quantity

Value times unit (Quantity).

scale

Scale (float).

unit

Unit (Unit).

value

Value = factor x scale (float).

Methods Documentation

autoscale(method='scale10')[source]

Autoscale the parameters.

Set factor and scale according to method

Available methods:

  • scale10 sets scale to power of 10, so that factor is in the range 1 to 10
  • factor1 sets factor, scale = 1, value
Parameters:

method : {‘factor1’, ‘scale10’}

Method to apply

to_dict()[source]