DiskSpatialModel#
- class gammapy.modeling.models.DiskSpatialModel[source]#
Bases:
SpatialModel
Constant disk model.
For more information see Disk spatial model.
- Parameters:
- lon_0, lat_0
Angle
Center position. Default is “0 deg”, “0 deg”.
- r_0
Angle
\(a\): length of the major semiaxis, in angular units. Default is 1 deg.
- e
float
Eccentricity of the ellipse (\(0<= e<= 1\)). Default is 0.
- phi
Angle
Rotation angle \(\phi\): of the major semiaxis (\(-180<=phi<=200\)). Increases counter-clockwise from the North direction. Default is 0 deg.
- edge_widthfloat
Width of the edge. The width is defined as the range within which the smooth edge of the model drops from 95% to 5% of its amplitude. It is given as fraction of r_0. Default is 0.01.
- frame{“icrs”, “galactic”}
Center position coordinate frame.
- lon_0, lat_0
Attributes Summary
A model parameter.
A model parameter.
Minimal evaluation bin size as an
Angle
.Evaluation radius as an
Angle
.A model parameter.
A model parameter.
A model parameter.
A model parameter.
Methods Summary
evaluate
(lon, lat, lon_0, lat_0, r_0, e, ...)Evaluate model.
from_region
(region, **kwargs)Create a
DiskSpatialModel from a ~regions.EllipseSkyRegion
.to_region
([size_factor])Model outline as a
EllipseSkyRegion
.Attributes Documentation
- default_parameters = <gammapy.modeling.parameter.Parameters object>#
- e#
A model parameter.
Note that the parameter value has been split into a factor and scale like this:
value = factor x scale
Users should interact with the
value
,quantity
ormin
andmax
properties and consider the fact that there is afactor
andscale
an implementation detail.That was introduced for numerical stability in parameter and error estimation methods, only in the Gammapy optimiser interface do we interact with the
factor
,factor_min
andfactor_max
properties, i.e. the optimiser “sees” the well-scaled problem.- Parameters:
- namestr
Name.
- valuefloat or
Quantity
Value.
- scalefloat, optional
Scale (sometimes used in fitting).
- unit
Unit
or str, optional Unit. Default is “”.
- minfloat, str or
quantity
, optional Minimum (sometimes used in fitting). If
None
, set tonumpy.nan
. Default is None.- maxfloat, str or
quantity
, optional Maximum (sometimes used in fitting). Default is
numpy.nan
.- frozenbool, optional
Frozen (used in fitting). Default is False.
- errorfloat, optional
Parameter error. Default is 0.
- scan_minfloat, optional
Minimum value for the parameter scan. Overwrites scan_n_sigma. Default is None.
- scan_maxfloat, optional
Maximum value for the parameter scan. Overwrites scan_n_sigma. Default is None.
- scan_n_values: int, optional
Number of values to be used for the parameter scan. Default is 11.
- scan_n_sigmaint, optional
Number of sigmas to scan. Default is 2.
- scan_values: `numpy.array`, optional
Scan values. Overwrites all the scan keywords before. Default is None.
- scale_method{‘scale10’, ‘factor1’, None}, optional
Method used to set
factor
andscale
. Default is “scale10”.- interp{“lin”, “sqrt”, “log”}, optional
Parameter scaling to use for the scan. Default is “lin”.
- prior
Prior
, optional Prior set on the parameter. Default is None.
- edge_width#
A model parameter.
Note that the parameter value has been split into a factor and scale like this:
value = factor x scale
Users should interact with the
value
,quantity
ormin
andmax
properties and consider the fact that there is afactor
andscale
an implementation detail.That was introduced for numerical stability in parameter and error estimation methods, only in the Gammapy optimiser interface do we interact with the
factor
,factor_min
andfactor_max
properties, i.e. the optimiser “sees” the well-scaled problem.- Parameters:
- namestr
Name.
- valuefloat or
Quantity
Value.
- scalefloat, optional
Scale (sometimes used in fitting).
- unit
Unit
or str, optional Unit. Default is “”.
- minfloat, str or
quantity
, optional Minimum (sometimes used in fitting). If
None
, set tonumpy.nan
. Default is None.- maxfloat, str or
quantity
, optional Maximum (sometimes used in fitting). Default is
numpy.nan
.- frozenbool, optional
Frozen (used in fitting). Default is False.
- errorfloat, optional
Parameter error. Default is 0.
- scan_minfloat, optional
Minimum value for the parameter scan. Overwrites scan_n_sigma. Default is None.
- scan_maxfloat, optional
Maximum value for the parameter scan. Overwrites scan_n_sigma. Default is None.
- scan_n_values: int, optional
Number of values to be used for the parameter scan. Default is 11.
- scan_n_sigmaint, optional
Number of sigmas to scan. Default is 2.
- scan_values: `numpy.array`, optional
Scan values. Overwrites all the scan keywords before. Default is None.
- scale_method{‘scale10’, ‘factor1’, None}, optional
Method used to set
factor
andscale
. Default is “scale10”.- interp{“lin”, “sqrt”, “log”}, optional
Parameter scaling to use for the scan. Default is “lin”.
- prior
Prior
, optional Prior set on the parameter. Default is None.
- evaluation_bin_size_min#
Minimal evaluation bin size as an
Angle
.The bin min size is defined as r_0*(1-edge_width)/10.
- evaluation_radius#
Evaluation radius as an
Angle
.Set to the length of the semi-major axis plus the edge width.
- lat_0#
A model parameter.
Note that the parameter value has been split into a factor and scale like this:
value = factor x scale
Users should interact with the
value
,quantity
ormin
andmax
properties and consider the fact that there is afactor
andscale
an implementation detail.That was introduced for numerical stability in parameter and error estimation methods, only in the Gammapy optimiser interface do we interact with the
factor
,factor_min
andfactor_max
properties, i.e. the optimiser “sees” the well-scaled problem.- Parameters:
- namestr
Name.
- valuefloat or
Quantity
Value.
- scalefloat, optional
Scale (sometimes used in fitting).
- unit
Unit
or str, optional Unit. Default is “”.
- minfloat, str or
quantity
, optional Minimum (sometimes used in fitting). If
None
, set tonumpy.nan
. Default is None.- maxfloat, str or
quantity
, optional Maximum (sometimes used in fitting). Default is
numpy.nan
.- frozenbool, optional
Frozen (used in fitting). Default is False.
- errorfloat, optional
Parameter error. Default is 0.
- scan_minfloat, optional
Minimum value for the parameter scan. Overwrites scan_n_sigma. Default is None.
- scan_maxfloat, optional
Maximum value for the parameter scan. Overwrites scan_n_sigma. Default is None.
- scan_n_values: int, optional
Number of values to be used for the parameter scan. Default is 11.
- scan_n_sigmaint, optional
Number of sigmas to scan. Default is 2.
- scan_values: `numpy.array`, optional
Scan values. Overwrites all the scan keywords before. Default is None.
- scale_method{‘scale10’, ‘factor1’, None}, optional
Method used to set
factor
andscale
. Default is “scale10”.- interp{“lin”, “sqrt”, “log”}, optional
Parameter scaling to use for the scan. Default is “lin”.
- prior
Prior
, optional Prior set on the parameter. Default is None.
- lon_0#
A model parameter.
Note that the parameter value has been split into a factor and scale like this:
value = factor x scale
Users should interact with the
value
,quantity
ormin
andmax
properties and consider the fact that there is afactor
andscale
an implementation detail.That was introduced for numerical stability in parameter and error estimation methods, only in the Gammapy optimiser interface do we interact with the
factor
,factor_min
andfactor_max
properties, i.e. the optimiser “sees” the well-scaled problem.- Parameters:
- namestr
Name.
- valuefloat or
Quantity
Value.
- scalefloat, optional
Scale (sometimes used in fitting).
- unit
Unit
or str, optional Unit. Default is “”.
- minfloat, str or
quantity
, optional Minimum (sometimes used in fitting). If
None
, set tonumpy.nan
. Default is None.- maxfloat, str or
quantity
, optional Maximum (sometimes used in fitting). Default is
numpy.nan
.- frozenbool, optional
Frozen (used in fitting). Default is False.
- errorfloat, optional
Parameter error. Default is 0.
- scan_minfloat, optional
Minimum value for the parameter scan. Overwrites scan_n_sigma. Default is None.
- scan_maxfloat, optional
Maximum value for the parameter scan. Overwrites scan_n_sigma. Default is None.
- scan_n_values: int, optional
Number of values to be used for the parameter scan. Default is 11.
- scan_n_sigmaint, optional
Number of sigmas to scan. Default is 2.
- scan_values: `numpy.array`, optional
Scan values. Overwrites all the scan keywords before. Default is None.
- scale_method{‘scale10’, ‘factor1’, None}, optional
Method used to set
factor
andscale
. Default is “scale10”.- interp{“lin”, “sqrt”, “log”}, optional
Parameter scaling to use for the scan. Default is “lin”.
- prior
Prior
, optional Prior set on the parameter. Default is None.
- phi#
A model parameter.
Note that the parameter value has been split into a factor and scale like this:
value = factor x scale
Users should interact with the
value
,quantity
ormin
andmax
properties and consider the fact that there is afactor
andscale
an implementation detail.That was introduced for numerical stability in parameter and error estimation methods, only in the Gammapy optimiser interface do we interact with the
factor
,factor_min
andfactor_max
properties, i.e. the optimiser “sees” the well-scaled problem.- Parameters:
- namestr
Name.
- valuefloat or
Quantity
Value.
- scalefloat, optional
Scale (sometimes used in fitting).
- unit
Unit
or str, optional Unit. Default is “”.
- minfloat, str or
quantity
, optional Minimum (sometimes used in fitting). If
None
, set tonumpy.nan
. Default is None.- maxfloat, str or
quantity
, optional Maximum (sometimes used in fitting). Default is
numpy.nan
.- frozenbool, optional
Frozen (used in fitting). Default is False.
- errorfloat, optional
Parameter error. Default is 0.
- scan_minfloat, optional
Minimum value for the parameter scan. Overwrites scan_n_sigma. Default is None.
- scan_maxfloat, optional
Maximum value for the parameter scan. Overwrites scan_n_sigma. Default is None.
- scan_n_values: int, optional
Number of values to be used for the parameter scan. Default is 11.
- scan_n_sigmaint, optional
Number of sigmas to scan. Default is 2.
- scan_values: `numpy.array`, optional
Scan values. Overwrites all the scan keywords before. Default is None.
- scale_method{‘scale10’, ‘factor1’, None}, optional
Method used to set
factor
andscale
. Default is “scale10”.- interp{“lin”, “sqrt”, “log”}, optional
Parameter scaling to use for the scan. Default is “lin”.
- prior
Prior
, optional Prior set on the parameter. Default is None.
- r_0#
A model parameter.
Note that the parameter value has been split into a factor and scale like this:
value = factor x scale
Users should interact with the
value
,quantity
ormin
andmax
properties and consider the fact that there is afactor
andscale
an implementation detail.That was introduced for numerical stability in parameter and error estimation methods, only in the Gammapy optimiser interface do we interact with the
factor
,factor_min
andfactor_max
properties, i.e. the optimiser “sees” the well-scaled problem.- Parameters:
- namestr
Name.
- valuefloat or
Quantity
Value.
- scalefloat, optional
Scale (sometimes used in fitting).
- unit
Unit
or str, optional Unit. Default is “”.
- minfloat, str or
quantity
, optional Minimum (sometimes used in fitting). If
None
, set tonumpy.nan
. Default is None.- maxfloat, str or
quantity
, optional Maximum (sometimes used in fitting). Default is
numpy.nan
.- frozenbool, optional
Frozen (used in fitting). Default is False.
- errorfloat, optional
Parameter error. Default is 0.
- scan_minfloat, optional
Minimum value for the parameter scan. Overwrites scan_n_sigma. Default is None.
- scan_maxfloat, optional
Maximum value for the parameter scan. Overwrites scan_n_sigma. Default is None.
- scan_n_values: int, optional
Number of values to be used for the parameter scan. Default is 11.
- scan_n_sigmaint, optional
Number of sigmas to scan. Default is 2.
- scan_values: `numpy.array`, optional
Scan values. Overwrites all the scan keywords before. Default is None.
- scale_method{‘scale10’, ‘factor1’, None}, optional
Method used to set
factor
andscale
. Default is “scale10”.- interp{“lin”, “sqrt”, “log”}, optional
Parameter scaling to use for the scan. Default is “lin”.
- prior
Prior
, optional Prior set on the parameter. Default is None.
- tag = ['DiskSpatialModel', 'disk']#
Methods Documentation
- classmethod from_region(region, **kwargs)[source]#
Create a
DiskSpatialModel from a ~regions.EllipseSkyRegion
.- Parameters:
- region
EllipseSkyRegion
or ~regions.CircleSkyRegion` Region to create model from.
- kwargsdict
Keyword arguments passed to
DiskSpatialModel
.
- region
- Returns:
- spatial_model
DiskSpatialModel
Spatial model.
- spatial_model
- to_region(size_factor=1.0, **kwargs)[source]#
Model outline as a
EllipseSkyRegion
.
- __init__(**kwargs)#
- classmethod __new__(*args, **kwargs)#