Commit a916862193bcaa5dde2775f65502e27041fbd992

Authored by Andreas Specovius
Committed by Jürgen Knödlseder
1 parent c43724e2

Replaced check for too small pointing-source offset by check for the on region c…

…ontaining the pointing (should be equal, but has greater flexibility for different (filled) region types)
Showing 1 changed file with 5 additions and 4 deletions
cscripts/csphagen.py
... ... @@ -385,10 +385,11 @@ class csphagen(ctools.csobservation):
385 385 offset = pnt_dir.dist_deg(self._src_dir)
386 386  
387 387 # Skip observation if it is too close to source
388   - if offset <= self._rad:
389   - msg = ' Skip because observation is pointed at %.3f deg <= '\
390   - '"rad=%.3f" from source.' \
391   - % (offset, self._rad)
  388 + if self._src_reg.contains(pnt_dir):
  389 + msg = ' Skip because observation is pointed at %.3f deg from source'\
  390 + % (offset)
  391 + if self._srcshape == 'CIRCLE':
  392 + msg += ' (circle rad=%.3f).' % (self._rad)
392 393 self._log_string(gammalib.NORMAL, msg)
393 394  
394 395 # Skip observation if it is pointed too far from the source
... ...