MapDataset

class gammapy.cube.MapDataset(model, counts=None, exposure=None, mask_fit=None, psf=None, edisp=None, background_model=None, likelihood='cash', evaluation_mode='local', mask_safe=None)[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_fit : ndarray

Mask to apply to the likelihood for fitting.

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.

mask_safe : ndarray

Mask defining the safe data range.

Attributes Summary

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

Methods Summary

copy(self) A deep copy.
likelihood(self) Total likelihood given the current model parameters.
likelihood_per_bin(self) Likelihood per bin given the current model parameters
npred(self) Predicted source and background counts (Map).

Attributes Documentation

data_shape

Shape of the counts data (tuple)

mask

Combined fit and safe mask

model

Sky model to fit (SkyModel or SkyModels)

parameters

List of parameters (Parameters)

Methods Documentation

copy(self)

A deep copy.

likelihood(self)[source]

Total likelihood given the current model parameters.

likelihood_per_bin(self)[source]

Likelihood per bin given the current model parameters

npred(self)[source]

Predicted source and background counts (Map).