DarkMatterAnnihilationSpectralModel#
- class gammapy.astro.darkmatter.DarkMatterAnnihilationSpectralModel[source]#
Bases:
SpectralModel
Dark matter annihilation spectral model.
The gamma-ray flux is computed as follows:
\[\frac{\mathrm d \phi}{\mathrm d E} = \frac{\langle \sigma\nu \rangle}{4\pi k m^2_{\mathrm{DM}}} \frac{\mathrm d N}{\mathrm dE} \times J(\Delta\Omega)\]- Parameters:
- mass
Quantity
Dark matter mass.
- channelstr
Annihilation channel for
PrimaryFlux
, e.g. “b” for “bbar”. SeePrimaryFlux.channel_registry
for more.- scalefloat
Scale parameter for model fitting.
- jfactor
Quantity
Integrated J-Factor needed when
PointSpatialModel
is used.- z: float
Redshift value.
- k: int
Type of dark matter particle (k:2 Majorana, k:4 Dirac).
- mass
References
Examples
This is how to instantiate a
DarkMatterAnnihilationSpectralModel
model:>>> import astropy.units as u >>> from gammapy.astro.darkmatter import DarkMatterAnnihilationSpectralModel >>> channel = "b" >>> massDM = 5000*u.Unit("GeV") >>> jfactor = 3.41e19 * u.Unit("GeV2 cm-5") >>> modelDM = DarkMatterAnnihilationSpectralModel(mass=massDM, channel=channel, jfactor=jfactor) # noqa: E501
Attributes Summary
Thermally averaged annihilation cross-section
A model parameter.
Methods Summary
evaluate
(energy, scale)Evaluate dark matter annihilation model.
from_dict
(data)Create spectral model from a dictionary.
to_dict
([full_output])Convert to dictionary.
Attributes Documentation
- THERMAL_RELIC_CROSS_SECTION = <Quantity 3.e-26 cm3 / s>#
Thermally averaged annihilation cross-section
- default_parameters = <gammapy.modeling.parameter.Parameters object>#
- scale#
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 = ['DarkMatterAnnihilationSpectralModel', 'dm-annihilation']#
Methods Documentation
- classmethod from_dict(data)[source]#
Create spectral model from a dictionary.
- Parameters:
- datadict
Dictionary with model data.
- Returns:
- model
DarkMatterAnnihilationSpectralModel
Dark matter annihilation spectral model.
- model
- classmethod __new__(*args, **kwargs)#