MapMaker

class gammapy.cube.MapMaker(geom, offset_max, geom_true=None, exclusion_mask=None, background_oversampling=None)[source]

Bases: object

Make maps from IACT observations.

Parameters:
geom : WcsGeom

Reference image geometry in reco energy

offset_max : Angle

Maximum offset angle

geom_true : WcsGeom

Reference image geometry in true energy, used for exposure maps and PSF. If none, the same as geom is assumed

exclusion_mask : Map

Exclusion mask

background_oversampling : int

Background oversampling factor in energy axis.

Methods Summary

run(self, observations[, selection]) Make maps for a list of observations.
run_images(self[, observations, spectrum, …]) Create images by summing over the energy axis.

Methods Documentation

run(self, observations, selection=None)[source]

Make maps for a list of observations.

Parameters:
observations : Observations

Observations to process

selection : list

List of str, selecting which maps to make. Available: ‘counts’, ‘exposure’, ‘background’ By default, all maps are made.

Returns:
maps : dict

Stacked counts, background and exposure maps

run_images(self, observations=None, spectrum=None, keepdims=False)[source]

Create images by summing over the energy axis.

Either MapMaker.run() has to be called before calling this function, or observations need to be passed. If MapMaker.run() has been called before, then those maps will be summed over. Else, new maps will be computed and then summed.

Exposure is weighted with an assumed spectrum, resulting in a weighted mean exposure image.

Parameters:
observations : Observations

Observations to process

spectrum : SpectralModel

Spectral model to compute the weights. Default is power-law with spectral index of 2.

keepdims : bool, optional

If this is set to True, the energy axes is kept with a single bin. If False, the energy axes is removed

Returns:
images : dict of Map