Commit 673eaac785e30e00bf9e20fcdccf342c6275e5b2
1 parent
352ab4d3
Add support of edisp to cslightcrv
Showing
1 changed file
with
22 additions
and
22 deletions
cscripts/cslightcrv.py
| ... | ... | @@ -484,28 +484,28 @@ class cslightcrv(ctools.cscript): |
| 484 | 484 | # Set precomputed binned response |
| 485 | 485 | obs[0].response(expcube.expcube(), psfcube.psfcube(), bkgcube.bkgcube()) |
| 486 | 486 | |
| 487 | -# # Check if we need to include energy dispersion | |
| 488 | -# if self.m_edisp: | |
| 489 | -# | |
| 490 | -# # Create edisp cube | |
| 491 | -# edispcube = ctools.ctedispcube(select.obs()) | |
| 492 | -# edispcube["incube"] = "NONE" | |
| 493 | -# edispcube["usepnt"] = False | |
| 494 | -# edispcube["ebinalg"] = "LOG" | |
| 495 | -# edispcube["xref"] = self.m_xref | |
| 496 | -# edispcube["yref"] = self.m_yref | |
| 497 | -# edispcube["binsz"] = self.m_binsz | |
| 498 | -# edispcube["nxpix"] = self.m_nxpix | |
| 499 | -# edispcube["nypix"] = self.m_nypix | |
| 500 | -# edispcube["enumbins"] = self.m_ebins | |
| 501 | -# edispcube["emin"] = self.m_emin | |
| 502 | -# edispcube["emax"] = self.m_emax | |
| 503 | -# edispcube["coordsys"] = self.m_coordsys | |
| 504 | -# edispcube["proj"] = self.m_proj | |
| 505 | -# edispcube.run() | |
| 506 | -# | |
| 507 | -# # Set precomputed binned response including energy dispersion | |
| 508 | -# obs[0].response(expcube.expcube(), psfcube.psfcube(), edispcube.edispcube(), bkgcube.bkgcube()) | |
| 487 | + # Check if we need to include energy dispersion | |
| 488 | + if self.m_edisp: | |
| 489 | + | |
| 490 | + # Create edisp cube | |
| 491 | + edispcube = ctools.ctedispcube(select.obs()) | |
| 492 | + edispcube["incube"] = "NONE" | |
| 493 | + edispcube["usepnt"] = False | |
| 494 | + edispcube["ebinalg"] = "LOG" | |
| 495 | + edispcube["xref"] = self.m_xref | |
| 496 | + edispcube["yref"] = self.m_yref | |
| 497 | + edispcube["binsz"] = self.m_binsz | |
| 498 | + edispcube["nxpix"] = self.m_nxpix | |
| 499 | + edispcube["nypix"] = self.m_nypix | |
| 500 | + edispcube["enumbins"] = self.m_ebins | |
| 501 | + edispcube["emin"] = self.m_emin | |
| 502 | + edispcube["emax"] = self.m_emax | |
| 503 | + edispcube["coordsys"] = self.m_coordsys | |
| 504 | + edispcube["proj"] = self.m_proj | |
| 505 | + edispcube.run() | |
| 506 | + | |
| 507 | + # Set precomputed binned response including energy dispersion | |
| 508 | + obs[0].response(expcube.expcube(), psfcube.psfcube(), edispcube.edispcube(), bkgcube.bkgcube()) | |
| 509 | 509 | |
| 510 | 510 | # Fix background models if required |
| 511 | 511 | if self.m_fix_bkg: | ... | ... |