ObservationsEventsSampler#
- class gammapy.data.ObservationsEventsSampler(sampler_kwargs=None, dataset_kwargs=None, outdir='./simulated_data/', overwrite=True, n_jobs=None, parallel_backend=None)[source]#
Bases:
ParallelMixin
Run event sampling for an emsemble of observations
- Parameters:
- sampler_kwargsdict, optional
Arguments passed to
MapDatasetEventSampler
.- dataset_kwargsdict, optional
Arguments passed to
create_map_dataset_from_observation()
.- outdirstr, Path
path of the output files created. Default is “./simulated_data/”. If None a list of
Observation
is returned.- overwritebool
Overwrite the output files or not
- n_jobsint, optional
Number of processes to run in parallel. Default is one, unless
N_JOBS_DEFAULT
was modified.- parallel_backend{‘multiprocessing’, ‘ray’}, optional
Which backend to use for multiprocessing. Default is None.
Attributes Summary
Number of jobs as an integer.
Parallel backend as a string.
Methods Summary
run
(observations[, models])Run event sampling for an ensemble of onservations
simulate_observation
(observation[, models])Simulate a single observation.
Attributes Documentation
- n_jobs#
Number of jobs as an integer.
- parallel_backend#
Parallel backend as a string.
Methods Documentation
- run(observations, models=None)[source]#
Run event sampling for an ensemble of onservations
- Parameters:
- observation
Observation
Observation to be simulated.
- models
Models
, optional Models to simulate. Can be None to only sample background events. Default is None.
- observation
- simulate_observation(observation, models=None)[source]#
Simulate a single observation.
- Parameters:
- observation
Observation
Observation to be simulated.
- models
Models
, optional Models to simulate. Can be None to only sample background events. Default is None.
- observation