Commit ce798fb518c2200eebdd675964908b95e280d94d

Authored by Luigi Tibaldo
1 parent 088cacf3

add Off observations models to container

Showing 1 changed file with 5 additions and 3 deletions
cscripts/csphagen.py
... ... @@ -334,14 +334,16 @@ class csphagen(ctools.csobservation):
334 334 response_xml = "parameter name=\"Calibration\"" +\
335 335 " database=\"" + database + "\"" +\
336 336 " response=\"" + irf + "\""
337   - print(response_xml)
338 337 xml = gammalib.GXmlElement()
339 338 xml.append(response_xml)
340   - print(xml)
341 339 # define response and assign to observation
342 340 response = gammalib.GCTAResponseIrf(xml)
343 341 obs.response(response)
344 342  
  343 + # Add models from Off observations to model container
  344 + for model in self.obs_off().models():
  345 + self._models.append(model)
  346 +
345 347 # Query parameters for source/On region definition
346 348 self._get_source_parameters()
347 349  
... ... @@ -429,7 +431,7 @@ class csphagen(ctools.csobservation):
429 431 self['prefix'].string()
430 432  
431 433 # Get background method parameters (have to come after setting up of
432   - # observations)
  434 + # observations and models)
433 435 self._get_parameters_bkgmethod()
434 436  
435 437 # Write input parameters into logger
... ...