MapEventSampler¶
-
class
gammapy.utils.random.MapEventSampler(npred_map, t_min, t_max, t_delta='1 s', temporal_model=None, random_state=0)[source]¶ Bases:
objectMap event sampler.
Parameters: - npred_map :
Map Predicted number of counts map.
- t_min :
Time Start time of the sampling.
- t_max :
Time Stop time of the sampling.
- t_delta :
Quantity Time step used for sampling of the temporal model.
- temporal_model :
LightCurveTableModelorPhaseCurveTableModel Input light (or phase)-curve model of the source, given with columns labelled as “time” (or “phase)” and “normalization” (arbitrary units).
- random_state : {int, ‘random-seed’, ‘global-rng’,
RandomState} Defines random number generator initialisation. Passed to
get_random_state.
Attributes Summary
npred_totalSample the total number of predicted events. ontimeOn time ( Quantity)time_unitMethods Summary
sample_events(self[, n_events])It converts the given sampled event list into an astropy table. sample_position_energy(self[, n_events])Sample position and energy of events. sample_time(self[, n_events])Sample arrival times of events. Attributes Documentation
-
npred_total¶ Sample the total number of predicted events.
Returns: - npred_total : int
Number of predicted events.
-
time_unit= Unit("s")¶
Methods Documentation
-
sample_events(self, n_events=None)[source]¶ It converts the given sampled event list into an astropy table.
Parameters: - n_events : int
Number of events to sample.
Returns: - events :
table Sampled event list in an astropy table format.
- npred_map :