Commit 7b1c99b362151e90268d9ab82b50cbc47ee2e4d7
1 parent
aaf5ac0e
Add zetamin parameter
Showing
2 changed files
with
16 additions
and
7 deletions
modules/comscripts/comobsbin.par
| @@ -39,6 +39,7 @@ npsi, i, h, 80,1,500, "Number of bins in Psi direction" | @@ -39,6 +39,7 @@ npsi, i, h, 80,1,500, "Number of bins in Psi direction" | ||
| 39 | nphibar, i, h, 25,1,100, "Number of bins in Phibar direction" | 39 | nphibar, i, h, 25,1,100, "Number of bins in Phibar direction" |
| 40 | psdmin, i, h, 0,0,110, "Minimum PSD value" | 40 | psdmin, i, h, 0,0,110, "Minimum PSD value" |
| 41 | psdmax, i, h, 110,0,110, "Maximum PSD value" | 41 | psdmax, i, h, 110,0,110, "Maximum PSD value" |
| 42 | +zetamin, r, h, 5.0,0.0,10.0, "Minimum Earth horizon - Phibar (zeta) angle" | ||
| 42 | 43 | ||
| 43 | # | 44 | # |
| 44 | # Standard parameters | 45 | # Standard parameters |
modules/comscripts/comobsbin.py
| @@ -42,7 +42,8 @@ class comobsbin(ctools.csobservation): | @@ -42,7 +42,8 @@ class comobsbin(ctools.csobservation): | ||
| 42 | # Initialise members | 42 | # Initialise members |
| 43 | self._phases = gammalib.GPhases() | 43 | self._phases = gammalib.GPhases() |
| 44 | self._select = gammalib.GCOMSelection() | 44 | self._select = gammalib.GCOMSelection() |
| 45 | - self._suffix = '' | 45 | + self._drx_suffix = '' |
| 46 | + self._drg_suffix = '' | ||
| 46 | self._dre_suffix = '' | 47 | self._dre_suffix = '' |
| 47 | 48 | ||
| 48 | # Return | 49 | # Return |
| @@ -72,6 +73,7 @@ class comobsbin(ctools.csobservation): | @@ -72,6 +73,7 @@ class comobsbin(ctools.csobservation): | ||
| 72 | self['nphibar'].integer() | 73 | self['nphibar'].integer() |
| 73 | self['psdmin'].integer() | 74 | self['psdmin'].integer() |
| 74 | self['psdmax'].integer() | 75 | self['psdmax'].integer() |
| 76 | + self['zetamin'].real() | ||
| 75 | 77 | ||
| 76 | # Query ahead output model filename | 78 | # Query ahead output model filename |
| 77 | if self._read_ahead(): | 79 | if self._read_ahead(): |
| @@ -191,11 +193,12 @@ class comobsbin(ctools.csobservation): | @@ -191,11 +193,12 @@ class comobsbin(ctools.csobservation): | ||
| 191 | 193 | ||
| 192 | # Set suffix | 194 | # Set suffix |
| 193 | phases = self['phase'].string() | 195 | phases = self['phase'].string() |
| 194 | - self._suffix = '_phases'+phases.replace(';', '_') | 196 | + self._drx_suffix = '_phases'+phases.replace(';', '_') |
| 197 | + self._drg_suffix = '_phases'+phases.replace(';', '_') | ||
| 195 | self._dre_suffix = '_phases'+phases.replace(';', '_') | 198 | self._dre_suffix = '_phases'+phases.replace(';', '_') |
| 196 | 199 | ||
| 197 | # If PSD interval differs from standard interval then set the interval | 200 | # If PSD interval differs from standard interval then set the interval |
| 198 | - if self['psdmin'].integer() != 0 or self['psdmin'].integer() != 110: | 201 | + if self['psdmin'].integer() != 0 or self['psdmax'].integer() != 110: |
| 199 | 202 | ||
| 200 | # Set PSD interval | 203 | # Set PSD interval |
| 201 | self._select.psd_min(self['psdmin'].integer()) | 204 | self._select.psd_min(self['psdmin'].integer()) |
| @@ -205,6 +208,11 @@ class comobsbin(ctools.csobservation): | @@ -205,6 +208,11 @@ class comobsbin(ctools.csobservation): | ||
| 205 | self._dre_suffix += '_psd%d-%d' % (self['psdmin'].integer(), | 208 | self._dre_suffix += '_psd%d-%d' % (self['psdmin'].integer(), |
| 206 | self['psdmax'].integer()) | 209 | self['psdmax'].integer()) |
| 207 | 210 | ||
| 211 | + # If zeta angle differs from standard value then append zeta angle to suffix | ||
| 212 | + if self['zetamin'].real() != 5.0: | ||
| 213 | + self._drg_suffix += '_zeta%.1f' % (self['zetamin'].real()) | ||
| 214 | + self._dre_suffix += '_zeta%.1f' % (self['zetamin'].real()) | ||
| 215 | + | ||
| 208 | # Log input observations | 216 | # Log input observations |
| 209 | self._log_string(gammalib.NORMAL, str(self._select)) | 217 | self._log_string(gammalib.NORMAL, str(self._select)) |
| 210 | 218 | ||
| @@ -260,8 +268,8 @@ class comobsbin(ctools.csobservation): | @@ -260,8 +268,8 @@ class comobsbin(ctools.csobservation): | ||
| 260 | drx = gammalib.GCOMDri(expo) | 268 | drx = gammalib.GCOMDri(expo) |
| 261 | 269 | ||
| 262 | # Set DRG and DRX filenames | 270 | # Set DRG and DRX filenames |
| 263 | - drxname = '%s/%s_drx%s.fits' % (self['outfolder'].string(), obs.id(), self._suffix) | ||
| 264 | - drgname = '%s/%s_drg%s.fits' % (self['outfolder'].string(), obs.id(), self._suffix) | 271 | + drxname = '%s/%s_drx%s.fits' % (self['outfolder'].string(), obs.id(), self._drx_suffix) |
| 272 | + drgname = '%s/%s_drg%s.fits' % (self['outfolder'].string(), obs.id(), self._drg_suffix) | ||
| 265 | drxfile = gammalib.GFilename(drxname) | 273 | drxfile = gammalib.GFilename(drxname) |
| 266 | drgfile = gammalib.GFilename(drgname) | 274 | drgfile = gammalib.GFilename(drgname) |
| 267 | 275 | ||
| @@ -280,7 +288,7 @@ class comobsbin(ctools.csobservation): | @@ -280,7 +288,7 @@ class comobsbin(ctools.csobservation): | ||
| 280 | if drgfile.exists(): | 288 | if drgfile.exists(): |
| 281 | self._log_value(gammalib.NORMAL, 'DRG file exists', drgfile.url()) | 289 | self._log_value(gammalib.NORMAL, 'DRG file exists', drgfile.url()) |
| 282 | else: | 290 | else: |
| 283 | - drg.compute_drg(obs, self._select) | 291 | + drg.compute_drg(obs, self._select, self['zetamin'].real()) |
| 284 | drg.save(drgfile, True) | 292 | drg.save(drgfile, True) |
| 285 | self._log_value(gammalib.NORMAL, 'DRG file created', drgfile.url()) | 293 | self._log_value(gammalib.NORMAL, 'DRG file created', drgfile.url()) |
| 286 | self._log_string(gammalib.NORMAL, str(drg)) | 294 | self._log_string(gammalib.NORMAL, str(drg)) |
| @@ -312,7 +320,7 @@ class comobsbin(ctools.csobservation): | @@ -312,7 +320,7 @@ class comobsbin(ctools.csobservation): | ||
| 312 | dre.ebounds(gammalib.GEbounds(ebounds.emin(i), ebounds.emax(i))) | 320 | dre.ebounds(gammalib.GEbounds(ebounds.emin(i), ebounds.emax(i))) |
| 313 | 321 | ||
| 314 | # Compute DRE | 322 | # Compute DRE |
| 315 | - dre.compute_dre(obs, self._select) | 323 | + dre.compute_dre(obs, self._select, self['zetamin'].real()) |
| 316 | 324 | ||
| 317 | # Save DRE | 325 | # Save DRE |
| 318 | dre.save(drefile, True) | 326 | dre.save(drefile, True) |