Commit 6acf0287bb49b93fa903b198fc051459b2908fe0

Authored by Jürgen Knödlseder
1 parent c319da92

Make sure that csphagen appends non-background models to output

Showing 1 changed file with 7 additions and 2 deletions
cscripts/csphagen.py
... ... @@ -452,7 +452,8 @@ class csphagen(ctools.csobservation):
452 452 # Initialise model usage
453 453 use_model = False
454 454  
455   - # If model is a background model then append "OnOff"
  455 + # If model is a background model then check if it will be
  456 + # used
456 457 if 'GCTA' in model.classname():
457 458  
458 459 # Skip model if background model should not be used
... ... @@ -488,9 +489,13 @@ class csphagen(ctools.csobservation):
488 489 use_model = True
489 490 model.ids('')
490 491  
491   - # Set instrument name
  492 + # Append "OnOff" to instrument name
492 493 model.instruments(model.instruments()+'OnOff')
493 494  
  495 + # ... otherwise, if model is not a background model then use it
  496 + else:
  497 + use_model = True
  498 +
494 499 # If model is relevant then append it now to the model
495 500 # container
496 501 if use_model:
... ...