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