compute_total_stats¶
-
gammapy.stats.compute_total_stats(counts, exposure, background=None, solid_angle=None, mask=None)[source]¶ Compute total stats for arrays of per-bin stats.
The
resultdictionary contains afluxentry computed as\[F = N / E = \sum{N_i} / \sum{E_i}\]as well as a
flux3entry computed as\[F = \sum{F_i} = \sum{\left(N_i / E_i\right)}\]where
Fis flux,Nis excess andEis exposure.The output
fluxunits are the inverse of the inputexposureunits, e.g.exposurein cm^2 s ->fluxin cm^-2 s^-1exposurein cm^2 s TeV ->fluxin cm^-2 s^-1 TeV-1
The output
surface_brightnessunits in addition depend on thesolid_angleunits, e.g.exposurein cm^2 s andsolid_anglein deg^2 ->surface_brightnessin cm^-2 s^-1 deg^-2
TODOs:
- integrate this with the
Statsclass. - add statistical errors on excess, flux, surface brightness
Parameters: counts, exposure : array_like
Input arrays
background, solid_angle, mask : array_like
Optional input arrays
Returns: result : dict
Dictionary of total stats (for now, see the code for which entries it has).
See also
gammapy.image.profile.FluxProfile.compute