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 from the observer to the dark matter halo center, used to compute the line-of-sight integration geometry.

annihilationQuantity, optional

Decay or annihilation. Default is True.

rmaxQuantity

Physical size of the dark matter halo (upper limit of the line-of-sight integral). For extragalactic sources, this should be set to the halo radius (~kpc), not the distance to the source. Defaults to distance for backward compatibility, which is only appropriate for Galactic sources.

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 geometry is defined by

\[r(l)^2 = D^2 + l^2 - 2 D l \cos\theta,\]

where \(D\) is the observer-to-halo-center distance and \(l \geq 0\) is the physical forward line-of-sight coordinate. The impact parameter of the corresponding infinite line is given by:

\[r_\perp = D \sin\theta.\]

The integration is split into two regions:

1. \(D < r_{\max}\): the observer is inside the integration radius. Directions with \(\theta < \pi / 2\) cross the inner radial interval twice, while directions with \(\theta \geq \pi / 2\) contain only the outward branch.

2. \(D \geq r_{\max}\): the observer is outside the integration radius. The line of sight contributes only when it points toward the halo and intersects the integration sphere, i.e. when \(\theta < \pi / 2\) and \(r_\perp < r_{\max}\).

Each radial branch is evaluated using

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

The apparent singularity at \(r = r_\perp\) is integrable. To avoid evaluating it directly, each radial branch is integrated with the substitution \(r = r_\perp\cosh t\).

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, rmax, annihilation=True)[source]#
classmethod __new__(*args, **kwargs)#