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, *, central_pixel_rtol=0.01, central_pixel_max_subdivision=128)[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.

central_pixel_rtolfloat, optional

Relative tolerance for adaptive refinement of the central pixel. Default is 0.01.

central_pixel_max_subdivisionint, optional

Maximum subdivision factor for adaptive refinement of the central pixel. Must be a power of two greater than or equal to 4. Default is 128.

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.\]

Defining the signed coordinate

\[s = l - D \cos\theta,\]

gives \(r^2 = r_\perp^2 + s^2\). The physical forward ray (\(l \geq 0\)) and the integration sphere (\(r \leq r_{\max}\)) define the limits

\[s_{\min} = \max\left(-\sqrt{r_{\max}^2-r_\perp^2}, -D\cos\theta\right), \qquad s_{\max} = \sqrt{r_{\max}^2-r_\perp^2}.\]

If these domains do not overlap, the integral is zero. Otherwise, for non-zero impact parameter, the line of sight is evaluated continuously using

\[s = r_\perp\sinh t, \qquad r = r_\perp\cosh t, \qquad \mathrm ds = r\,\mathrm dt.\]

A zero-impact line of sight that does not cross the halo center is integrated directly in positive \(s\). The central direction is handled by the adaptive central-pixel integration.

compute_jfactor(ndecade=10000.0, *, central_pixel_rtol=0.01, central_pixel_max_subdivision=128)[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.

central_pixel_rtolfloat, optional

Relative tolerance for adaptive refinement of the central pixel. Default is 0.01.

central_pixel_max_subdivisionint, optional

Maximum subdivision factor for adaptive refinement of the central pixel. Must be a power of two greater than or equal to 4. Default is 128.

Returns:
jfactorQuantity

The j-factor.

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