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
.
- random_state{int, ‘random-seed’, ‘global-rng’,
Methods Summary
event_list_meta
(dataset, observation)Event list meta info.
run
(self, dataset[, observation])Run the event sampler, applying IRF corrections.
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
-
static
event_list_meta
(dataset, observation)[source]¶ Event list meta info.
- Parameters
- dataset
MapDataset
Map dataset.
- observation
Observation
In memory observation.
- dataset
- Returns
- metadict
Meta dictionary.
-
run
(self, dataset, observation=None)[source]¶ Run the event sampler, applying IRF corrections.
- Parameters
- dataset
MapDataset
Map dataset
- observation
Observation
In memory observation.
- edispBool
It allows to include or exclude the Edisp in the simulation.
- dataset
- Returns
- events
EventList
Event list.
- events
-
sample_background
(self, dataset)[source]¶ Sample background
- Parameters
- dataset
MapDataset
Map dataset
- dataset
- Returns
- events
gammapy.data.EventList
Background events
- events
-
sample_sources
(self, dataset)[source]¶ Sample source model components.
- Parameters
- dataset
MapDataset
Map dataset.
- dataset
- Returns
- events
EventList
Event list
- events