MapDataset

class gammapy.cube.MapDataset(model, counts=None, exposure=None, mask=None, psf=None, edisp=None, background_model=None, likelihood='cash', evaluation_mode='local')[source]

Bases: gammapy.utils.fitting.Dataset

Perform sky model likelihood fit on maps.

Parameters:
model : SkyModel or SkyModels

Source sky models.

counts : WcsNDMap

Counts cube

exposure : WcsNDMap

Exposure cube

mask : WcsNDMap

Mask to apply to the likelihood.

psf : PSFKernel

PSF kernel

edisp : EnergyDispersion

Energy dispersion

background_model : BackgroundModel or BackgroundModels

Background models to use for the fit.

likelihood : {“cash”, “cstat”}

Likelihood function to use for the fit.

evaluation_mode : {“local”, “global”}

Model evaluation mode.

The “local” mode evaluates the model components on smaller grids to save computation time. This mode is recommended for local optimization algorithms. The “global” evaluation mode evaluates the model components on the full map. This mode is recommended for global optimization algorithms.

Attributes Summary

data_shape Shape of the counts data (tuple)
model Sky model to fit (SkyModel or SkyModels)
parameters List of parameters (Parameters)

Methods Summary

likelihood(parameters[, mask]) Total likelihood given the current model parameters.
likelihood_per_bin() Likelihood per bin given the current model parameters
npred() Predicted source and background counts (Map).

Attributes Documentation

data_shape

Shape of the counts data (tuple)

model

Sky model to fit (SkyModel or SkyModels)

parameters

List of parameters (Parameters)

Methods Documentation

likelihood(parameters, mask=None)[source]

Total likelihood given the current model parameters.

Parameters:
mask : ndarray

Mask to be combined with the dataset mask.

likelihood_per_bin()[source]

Likelihood per bin given the current model parameters

npred()[source]

Predicted source and background counts (Map).