92 model : `~gammalib.GModel`
94 obs : `~gammalib.GObservations`
103 roilimit = self[
'roilimit'].real()
104 roimargin = self[
'roimargin'].real()
105 ethres = self[
'ethres'].real()
106 fluxlimit = self[
'fluxlimit'].real()
107 tslimit = self[
'tslimit'].real()
111 msg =
'Select by default'
114 if hasattr(model,
'spatial'):
117 model_bounds = model.spatial().region()
121 msg =
'Exclude since outside any RoI'
133 obs_centre = obs_roi.centre().dir()
134 obs_radius = obs_roi.radius()
135 if obs_radius > roilimit:
136 obs_radius = roilimit
137 obs_radius += roimargin
140 obs_bounds = gammalib.GSkyRegionCircle(obs_centre, obs_radius)
143 if obs_bounds.overlaps(model_bounds):
145 msg =
'Select due to overlap with at least one RoI'
150 if select
and model.has_ts():
151 if model.ts() < tslimit:
153 msg =
'Exclude since below TS limit (TS=%.3f)' % model.ts()
157 if select
and model.classname() ==
'GModelSky':
158 emin = gammalib.GEnergy(ethres,
'TeV')
159 emax = gammalib.GEnergy(1000.0,
'TeV')
160 flux = model.spectral().flux(emin, emax)
163 msg =
'Exclude since below flux limit (Flux=%.3e ph/cm2/s)' % flux
166 self._log_value(gammalib.NORMAL, model.name(), msg)
227 models = gammalib.GModels()
230 self._log_observations(gammalib.NORMAL, self.obs(),
'Input observation')
233 self._log_models(gammalib.NORMAL, self.
_models,
'Input model')
236 self._log_header1(gammalib.NORMAL,
'Model selection')
255 self._log_models(gammalib.NORMAL, self.
_models,
'Selected model')