MapDatasetEventSampler

class gammapy.cube.MapDatasetEventSampler(random_state='random-seed')[source]

Bases: object

Sample events from a map dataset

Parameters
random_state{int, ‘random-seed’, ‘global-rng’, RandomState}

Defines random number generator initialisation. Passed to get_random_state.

Methods Summary

sample_background(self, dataset)

Sample background

sample_edisp(self, edisp_map, events)

Sample energy dispersion map.

sample_psf(self, psf_map, events)

Sample psf map.

sample_sources(self, dataset)

Sample source model components.

Methods Documentation

sample_background(self, dataset)[source]

Sample background

Parameters
datasetMapDataset

Map dataset

Returns
eventsgammapy.data.EventList

Background events

sample_edisp(self, edisp_map, events)[source]

Sample energy dispersion map.

Parameters
edisp_mapEDispMap

Energy dispersion map

eventsEventList

Event list with the true energies

Returns
eventsEventList

Event list with reconstructed energy column.

sample_psf(self, psf_map, events)[source]

Sample psf map.

Parameters
psf_mapPSFMap

PSF map.

eventsEventList

Event list.

Returns
eventsEventList

Event list with reconstructed position columns.

sample_sources(self, dataset)[source]

Sample source model components.

Parameters
datasetMapDataset

Map dataset.

Returns
eventsEventList

Event list