Commit b689e55ee1e1e76a7884e82bc15ec9814c502cd2
1 parent
3f7bda51
Add CONST method to comobsbin (#4254)
Showing
6 changed files
with
36 additions
and
11 deletions
ChangeLog
1 | -2023-03-22 | |
1 | +2023-04-22 | |
2 | 2 | |
3 | 3 | * Version 2.1.0 released |
4 | 4 | ======================== |
5 | 5 | |
6 | + Add CONST method to comobsbin (#4254) | |
6 | 7 | Add collection of HKD datasets to comgendb (#4209) |
7 | 8 | Replace distutils by setuptools for Python setup (#4223) |
8 | 9 | Add support for DRW weighting cubes (#4209) | ... | ... |
NEWS
1 | 1 | New Features and Important Changes in ctools 2.1.0 |
2 | 2 | |
3 | -22 March 2023 | |
3 | +4 April 2023 | |
4 | 4 | |
5 | 5 | |
6 | 6 | Introduction |
... | ... | @@ -360,6 +360,9 @@ a DRG for background modelling. Set "outfolder" parameter to automatic (#4209). |
360 | 360 | |
361 | 361 | comobsbin - Bin COMPTEL observations |
362 | 362 | ------------------------------------ |
363 | +Add CONST method for DRW computation that generates solid angle multiplied and | |
364 | +DRE normalised DRW datasets from the DRG data (#4254) | |
365 | + | |
363 | 366 | Implement computation of weighting cubes (DRW) for improved background modelling. |
364 | 367 | Added "timebin" parameter to provide control over the time binning used for |
365 | 368 | DRW computation (#4209). | ... | ... |
README.md
1 | 1 | ctools information |
2 | 2 | ================== |
3 | -* Version: 2.1.0.dev (15 March 2023) | |
3 | +* Version: 2.1.0.dev (2 April 2023) | |
4 | 4 | * GammaLib dependency: 2.1.0.dev |
5 | 5 | |
6 | 6 | [![Build Status](https://cta-jenkins.irap.omp.eu/buildStatus/icon?job=ctools-integrate-os)](https://cta-jenkins.irap.omp.eu/job/ctools-integrate-os/) | ... | ... |
doc/source/admin/release_history/2.1.rst
... | ... | @@ -30,8 +30,12 @@ Bug fixes |
30 | 30 | Improvements |
31 | 31 | ------------ |
32 | 32 | |
33 | +* [`4254 <https://cta-redmine.irap.omp.eu/issues/4254>`_] - | |
34 | + Add CONST method to :ref:`comobsbin` | |
33 | 35 | * [`4209 <https://cta-redmine.irap.omp.eu/issues/4209>`_] - |
34 | - Add support for DRW weighting cubes. Add collection of HKD datasets to :ref:`comgendb`. | |
36 | + Add support for DRW weighting cubes. | |
37 | + Add PHIBAR and VETORATE methods to :ref:`comobsbin`. | |
38 | + Add collection of HKD datasets to :ref:`comgendb`. | |
35 | 39 | * [`4201 <https://cta-redmine.irap.omp.eu/issues/4201>`_] - |
36 | 40 | Prefit models without test source in :ref:`comlixmap` |
37 | 41 | ... | ... |
modules/comscripts/comobsbin.par
... | ... | @@ -49,7 +49,7 @@ psdmin, i, h, 0,0,110, "Minimum PSD value" |
49 | 49 | psdmax, i, h, 110,0,110, "Maximum PSD value" |
50 | 50 | zetamin, r, h, 5.0,0.0,10.0, "Minimum Earth horizon - Phibar (zeta) angle (deg)" |
51 | 51 | fpmtflag, i, h, 0,0,2, "Handling of D2 modules with failed PMT flag (0: exclude, 1: include, 2: exclude PMT)" |
52 | -drwmethod, s, h, PHIBAR,PHIBAR|VETORATE,, "DRW computation method" | |
52 | +drwmethod, s, h, PHIBAR,CONST|PHIBAR|VETORATE,, "DRW computation method" | |
53 | 53 | timebin, r, h, 300.0,,, "Internal time bin for DRW PHIBAR computation (sec)" |
54 | 54 | d1use, s, h, 1111111,,, "D1 module usage (1: use, 0: don't use)" |
55 | 55 | d2use, s, h, 11111111111111,,, "D2 module usage (1: use, 0: don't use)" | ... | ... |
modules/comscripts/comobsbin.py
... | ... | @@ -569,9 +569,28 @@ class comobsbin(ctools.csobservation): |
569 | 569 | self._log_header3(gammalib.NORMAL, 'Compute DRWs') |
570 | 570 | |
571 | 571 | # Compute DRWs |
572 | - drws.compute_drws(obs, self._select, self['zetamin'].real(), | |
573 | - self['timebin'].real(), | |
574 | - drwmethod) | |
572 | + if drwmethod == 'const': | |
573 | + | |
574 | + # Load DRG | |
575 | + drg = gammalib.GCOMDri(drgname) | |
576 | + | |
577 | + # Get dataspace dimensions | |
578 | + nphibar = drg.nphibar() | |
579 | + npix = drg.nchi() * drg.npsi() | |
580 | + | |
581 | + # Set DRWs by multiplying DRG with solid angle | |
582 | + for ipix in range(npix): | |
583 | + omega = drg.map().solidangle(ipix) | |
584 | + for iphibar in range(nphibar): | |
585 | + index = ipix + iphibar*npix | |
586 | + drw = drg[index] * omega | |
587 | + for i in range(drws.size()): | |
588 | + drws[i][index] = drw | |
589 | + | |
590 | + else: | |
591 | + drws.compute_drws(obs, self._select, self['zetamin'].real(), | |
592 | + self['timebin'].real(), | |
593 | + drwmethod) | |
575 | 594 | |
576 | 595 | # Phibar normalise DRWs to DREs |
577 | 596 | for i in range(drws.size()): |
... | ... | @@ -580,10 +599,8 @@ class comobsbin(ctools.csobservation): |
580 | 599 | dre = gammalib.GCOMDri(drenames[engindex[i]]) |
581 | 600 | |
582 | 601 | # Get dataspace dimensions |
583 | - nchi = dre.nchi() | |
584 | - npsi = dre.npsi() | |
585 | 602 | nphibar = dre.nphibar() |
586 | - npix = nchi * npsi | |
603 | + npix = dre.nchi() * dre.npsi() | |
587 | 604 | |
588 | 605 | # Phibar normalise DRW |
589 | 606 | for iphibar in range(nphibar): | ... | ... |