JFactory#

class gammapy.astro.darkmatter.JFactory[source]#

Bases: object

Compute J-Factor or D-Factor maps.

J-Factors are computed for annihilation and D-Factors for decay. Set the argument annihilation to False to compute D-Factors. The assumed dark matter profiles will be centered on the center of the map.

Parameters:
geomWcsGeom

Reference geometry.

profileDMProfile

Dark matter profile.

distanceQuantity

Distance to convert angular scale of the map.

annihilationbool, optional

Decay or annihilation. Default is True.

Methods Summary

compute_differential_jfactor([ndecade])

Compute differential J-Factor.

compute_jfactor([ndecade])

Compute astrophysical J-Factor.

Methods Documentation

compute_differential_jfactor(ndecade=10000.0)[source]#

Compute differential J-Factor.

\[\frac{\mathrm d J_\text{ann}}{\mathrm d \Omega} = \int_{\mathrm{LoS}} \mathrm d l \rho(l)^2\]
\[\frac{\mathrm d J_\text{decay}}{\mathrm d \Omega} = \int_{\mathrm{LoS}} \mathrm d l \rho(l)\]
Parameters:
ndecadefloat, optional

Number of sampling points per decade in radius used for the numerical integration. Default is 1e4.

Returns:
jfactorQuantity

Differential j-factor.

Notes

The line-of-sight (LoS) integral should include both the near and far sides of the halo. To account for this, the integration is split into two regions:

  1. \([r_{\min}, r_{\max}]\) - from the observer to the source, counted twice to include contributions from both near and far sides.

  2. \([r_{\max}, 4 r_{\max}]\) - from the source to infinity. The upper limit is truncated at \(4 r_{\max}\) because contributions beyond this are negligible.

Hence, the effective integration domain is:

\[2 \times [r_{\min}, r_{\max}] \;+\; [r_{\max}, 4 r_{\max}].\]

The LoS integral is converted into a radial integral over the profile through:

\[r^2 = l^2 + r_{\max}^2 - 2 dl \cos \theta\]

Rearranging for the differential gives:

\[\mathrm dl = \frac{2 r}{\sqrt{r^2 - r_{\min}^2}} \, \mathrm dr.\]

This substitution allows the integral to be evaluated directly as radial integrals using profile.integral, giving

\[\int_0^{l_\mathrm{max}} \rho^2(r(l, \theta)) \, \mathrm dl = 2 \int_{r_{\min}}^{r_{\max}} \frac{r \, \rho^2(r)}{\sqrt{r^2 - r_{\min}^2}} \, \mathrm dr + \int_{r_{\max}}^{4 r_{\max}} \frac{r \, \rho^2(r)}{\sqrt{r^2 - r_{\min}^2}} \, \mathrm dr.\]
compute_jfactor(ndecade=10000.0)[source]#

Compute astrophysical J-Factor.

\[J(\Delta\Omega) = \int_{\Delta\Omega} \mathrm d \Omega^{\prime} \frac{\mathrm d J}{\mathrm d \Omega^{\prime}}\]
Parameters:
ndecadefloat, optional

Number of sampling points per decade in radius used for the numerical integration. Default is 1e4.

Returns:
jfactorQuantity

The j-factor.

__init__(geom, profile, distance, annihilation=True)[source]#
classmethod __new__(*args, **kwargs)#