Commit d78abf9b926b06fc7eb160c083fe6c0c6612779a
1 parent
952bf765
Write PHASECOR keyword based on input DREs
Showing
1 changed file
with
18 additions
and
13 deletions
modules/comscripts/comobsadd.py
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | # ========================================================================== |
| 3 | 3 | # Add COMPTEL observations |
| 4 | 4 | # |
| 5 | -# Copyright (C) 2021 Juergen Knoedlseder | |
| 5 | +# Copyright (C) 2021-2022 Juergen Knoedlseder | |
| 6 | 6 | # |
| 7 | 7 | # This program is free software: you can redistribute it and/or modify |
| 8 | 8 | # it under the terms of the GNU General Public License as published by |
| ... | ... | @@ -153,18 +153,19 @@ class comobsadd(ctools.csobservation): |
| 153 | 153 | found = True |
| 154 | 154 | break |
| 155 | 155 | if not found: |
| 156 | - ebins.append({'emin' : emin, | |
| 157 | - 'emax' : emax, | |
| 158 | - 'dres' : [o.drename()], | |
| 159 | - 'drbs' : [o.drbname()], | |
| 160 | - 'drgs' : [o.drgname()], | |
| 161 | - 'drxs' : [o.drxname()], | |
| 162 | - 'iaq' : o.response().rspname(), | |
| 163 | - 'gti' : o.events().dre().gti(), | |
| 164 | - 'tofcor': o.events().dre().tof_correction(), | |
| 165 | - 'nspinp': o.events().dre().num_superpackets(), | |
| 166 | - 'nspuse': o.events().dre().num_used_superpackets(), | |
| 167 | - 'nspskp': o.events().dre().num_skipped_superpackets()}) | |
| 156 | + ebins.append({'emin' : emin, | |
| 157 | + 'emax' : emax, | |
| 158 | + 'dres' : [o.drename()], | |
| 159 | + 'drbs' : [o.drbname()], | |
| 160 | + 'drgs' : [o.drgname()], | |
| 161 | + 'drxs' : [o.drxname()], | |
| 162 | + 'iaq' : o.response().rspname(), | |
| 163 | + 'gti' : o.events().dre().gti(), | |
| 164 | + 'tofcor' : o.events().dre().tof_correction(), | |
| 165 | + 'phasecor' : o.events().dre().phase_correction(), | |
| 166 | + 'nspinp' : o.events().dre().num_superpackets(), | |
| 167 | + 'nspuse' : o.events().dre().num_used_superpackets(), | |
| 168 | + 'nspskp' : o.events().dre().num_skipped_superpackets()}) | |
| 168 | 169 | |
| 169 | 170 | # Log DRI definition |
| 170 | 171 | self._log_value(gammalib.NORMAL, 'Coordinate system', coordsys) |
| ... | ... | @@ -181,6 +182,7 @@ class comobsadd(ctools.csobservation): |
| 181 | 182 | self._log_value(gammalib.NORMAL, 'Energy bin %d' % i, |
| 182 | 183 | '%s - %s' % (str(ebin['emin']), str(ebin['emax']))) |
| 183 | 184 | self._log_value(gammalib.NORMAL, ' ToF correction', ebin['tofcor']) |
| 185 | + self._log_value(gammalib.NORMAL, ' Phase correction', ebin['phasecor']) | |
| 184 | 186 | self._log_value(gammalib.NORMAL, ' Response', ebin['iaq']) |
| 185 | 187 | |
| 186 | 188 | # Create sky map for DRE, DRG and DRB |
| ... | ... | @@ -232,6 +234,9 @@ class comobsadd(ctools.csobservation): |
| 232 | 234 | # Set ToF correction |
| 233 | 235 | dre.tof_correction(ebin['tofcor']) |
| 234 | 236 | |
| 237 | + # Set phase correction | |
| 238 | + dre.phase_correction(ebin['phasecor']) | |
| 239 | + | |
| 235 | 240 | # Set superpackets usage |
| 236 | 241 | dre.num_superpackets(ebin['nspinp']) |
| 237 | 242 | dre.num_used_superpackets(ebin['nspuse']) | ... | ... |