Commit ce798fb518c2200eebdd675964908b95e280d94d
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,14 +334,16 @@ class csphagen(ctools.csobservation): | ||
| 334 | response_xml = "parameter name=\"Calibration\"" +\ | 334 | response_xml = "parameter name=\"Calibration\"" +\ |
| 335 | " database=\"" + database + "\"" +\ | 335 | " database=\"" + database + "\"" +\ |
| 336 | " response=\"" + irf + "\"" | 336 | " response=\"" + irf + "\"" |
| 337 | - print(response_xml) | ||
| 338 | xml = gammalib.GXmlElement() | 337 | xml = gammalib.GXmlElement() |
| 339 | xml.append(response_xml) | 338 | xml.append(response_xml) |
| 340 | - print(xml) | ||
| 341 | # define response and assign to observation | 339 | # define response and assign to observation |
| 342 | response = gammalib.GCTAResponseIrf(xml) | 340 | response = gammalib.GCTAResponseIrf(xml) |
| 343 | obs.response(response) | 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 | # Query parameters for source/On region definition | 347 | # Query parameters for source/On region definition |
| 346 | self._get_source_parameters() | 348 | self._get_source_parameters() |
| 347 | 349 | ||
| @@ -429,7 +431,7 @@ class csphagen(ctools.csobservation): | @@ -429,7 +431,7 @@ class csphagen(ctools.csobservation): | ||
| 429 | self['prefix'].string() | 431 | self['prefix'].string() |
| 430 | 432 | ||
| 431 | # Get background method parameters (have to come after setting up of | 433 | # Get background method parameters (have to come after setting up of |
| 432 | - # observations) | 434 | + # observations and models) |
| 433 | self._get_parameters_bkgmethod() | 435 | self._get_parameters_bkgmethod() |
| 434 | 436 | ||
| 435 | # Write input parameters into logger | 437 | # Write input parameters into logger |