Commit 7b1c99b362151e90268d9ab82b50cbc47ee2e4d7

Authored by Jürgen Knödlseder
1 parent aaf5ac0e

Add zetamin parameter

modules/comscripts/comobsbin.par
... ... @@ -39,6 +39,7 @@ npsi, i, h, 80,1,500, "Number of bins in Psi direction"
39 39 nphibar, i, h, 25,1,100, "Number of bins in Phibar direction"
40 40 psdmin, i, h, 0,0,110, "Minimum PSD value"
41 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 45 # Standard parameters
... ...
modules/comscripts/comobsbin.py
... ... @@ -42,7 +42,8 @@ class comobsbin(ctools.csobservation):
42 42 # Initialise members
43 43 self._phases = gammalib.GPhases()
44 44 self._select = gammalib.GCOMSelection()
45   - self._suffix = ''
  45 + self._drx_suffix = ''
  46 + self._drg_suffix = ''
46 47 self._dre_suffix = ''
47 48  
48 49 # Return
... ... @@ -72,6 +73,7 @@ class comobsbin(ctools.csobservation):
72 73 self['nphibar'].integer()
73 74 self['psdmin'].integer()
74 75 self['psdmax'].integer()
  76 + self['zetamin'].real()
75 77  
76 78 # Query ahead output model filename
77 79 if self._read_ahead():
... ... @@ -191,11 +193,12 @@ class comobsbin(ctools.csobservation):
191 193  
192 194 # Set suffix
193 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 198 self._dre_suffix = '_phases'+phases.replace(';', '_')
196 199  
197 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 203 # Set PSD interval
201 204 self._select.psd_min(self['psdmin'].integer())
... ... @@ -205,6 +208,11 @@ class comobsbin(ctools.csobservation):
205 208 self._dre_suffix += '_psd%d-%d' % (self['psdmin'].integer(),
206 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 216 # Log input observations
209 217 self._log_string(gammalib.NORMAL, str(self._select))
210 218  
... ... @@ -260,8 +268,8 @@ class comobsbin(ctools.csobservation):
260 268 drx = gammalib.GCOMDri(expo)
261 269  
262 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 273 drxfile = gammalib.GFilename(drxname)
266 274 drgfile = gammalib.GFilename(drgname)
267 275  
... ... @@ -280,7 +288,7 @@ class comobsbin(ctools.csobservation):
280 288 if drgfile.exists():
281 289 self._log_value(gammalib.NORMAL, 'DRG file exists', drgfile.url())
282 290 else:
283   - drg.compute_drg(obs, self._select)
  291 + drg.compute_drg(obs, self._select, self['zetamin'].real())
284 292 drg.save(drgfile, True)
285 293 self._log_value(gammalib.NORMAL, 'DRG file created', drgfile.url())
286 294 self._log_string(gammalib.NORMAL, str(drg))
... ... @@ -312,7 +320,7 @@ class comobsbin(ctools.csobservation):
312 320 dre.ebounds(gammalib.GEbounds(ebounds.emin(i), ebounds.emax(i)))
313 321  
314 322 # Compute DRE
315   - dre.compute_dre(obs, self._select)
  323 + dre.compute_dre(obs, self._select, self['zetamin'].real())
316 324  
317 325 # Save DRE
318 326 dre.save(drefile, True)
... ...