Commit 39bd65362ed2de3cfb0ad0a4ecd5a3118b3f59c7
1 parent
128b9ed8
Use always energy dispersion for On/Off observations in cspull
Showing
1 changed file
with
5 additions
and
4 deletions
cscripts/cspull.py
| ... | ... | @@ -155,6 +155,7 @@ class cspull(ctools.csobservation): |
| 155 | 155 | # some parameters |
| 156 | 156 | nbins = self['enumbins'].integer() |
| 157 | 157 | onsrc = self['onsrc'].string() |
| 158 | + edisp = self['edisp'].boolean() | |
| 158 | 159 | emin = None |
| 159 | 160 | emax = None |
| 160 | 161 | binsz = 0.0 |
| ... | ... | @@ -167,6 +168,7 @@ class cspull(ctools.csobservation): |
| 167 | 168 | onrad = self['onrad'].real() |
| 168 | 169 | emin = self['emin'].real() |
| 169 | 170 | emax = self['emax'].real() |
| 171 | + edisp = True # Use always energy dispersion for On/Off | |
| 170 | 172 | else: |
| 171 | 173 | |
| 172 | 174 | # Reset On region source name and radius |
| ... | ... | @@ -189,8 +191,7 @@ class cspull(ctools.csobservation): |
| 189 | 191 | onsrc=onsrc, onrad=onrad, |
| 190 | 192 | addbounds=True, seed=seed, |
| 191 | 193 | binsz=binsz, npix=npix, proj=proj, coord=coordsys, |
| 192 | - edisp=self['edisp'].boolean(), | |
| 193 | - log=False, debug=self._logDebug(), | |
| 194 | + edisp=edisp, log=False, debug=self._logDebug(), | |
| 194 | 195 | chatter=self['chatter'].integer()) |
| 195 | 196 | |
| 196 | 197 | # Determine number of events in simulation |
| ... | ... | @@ -214,13 +215,13 @@ class cspull(ctools.csobservation): |
| 214 | 215 | for model in models: |
| 215 | 216 | like = ctools.cterror(obs) |
| 216 | 217 | like['srcname'] = model.name() |
| 217 | - like['edisp'] = self['edisp'].boolean() | |
| 218 | + like['edisp'] = edisp | |
| 218 | 219 | like['debug'] = self._logDebug() |
| 219 | 220 | like['chatter'] = self['chatter'].integer() |
| 220 | 221 | like.run() |
| 221 | 222 | else: |
| 222 | 223 | like = ctools.ctlike(obs) |
| 223 | - like['edisp'] = self['edisp'].boolean() | |
| 224 | + like['edisp'] = edisp | |
| 224 | 225 | like['debug'] = self._logDebug() |
| 225 | 226 | like['chatter'] = self['chatter'].integer() |
| 226 | 227 | like.run() | ... | ... |