ObservationsEventsSampler#
- class gammapy.data.ObservationsEventsSampler[source]#
Bases:
ParallelMixin
Run event sampling for an ensemble of observations.
- Parameters:
- sampler_kwargsdict, optional
Arguments passed to
MapDatasetEventSampler
.- dataset_kwargsdict, optional
Arguments passed to
create_map_dataset_from_observation()
.- outdirstr, optional
Path of the output files created. Default is “./simulated_data/”. If None, a list of
Observation
is returned.- overwritebool, optional
Overwrite existing file. Default is True.
- n_jobsint, optional
Number of processes to run in parallel. By default, the value is 1, unless
N_JOBS_DEFAULT
has been 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 observations.
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 observations.
- Parameters:
- observations
Observations
Observations to be simulated.
- models
Models
, optional Models to simulate. Can be None to only sample background events. Default is None.
- observations
- 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
- __init__(sampler_kwargs=None, dataset_kwargs=None, outdir='./simulated_data/', overwrite=True, n_jobs=None, parallel_backend=None)[source]#
- classmethod __new__(*args, **kwargs)#