Change request #2343
Change GCTABackground3D to support different column names
Status: | Closed | Start date: | 02/23/2018 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assigned To: | Knödlseder Jürgen | % Done: | 100% | |
Category: | - | |||
Target version: | 1.6.0 | |||
Duration: |
Description
Right now, GCTABackground3D
is initialised with background information from a column with the hardcoded name “BGD”:m_inx_bgd = m_background.table("BGD");
However, specifications for gamma-ray data formats suggest “BKG”:
http://gamma-astro-data-formats.readthedocs.io/en/latest/irfs/full_enclosure/bkg/index.html#bkg-3d
Maybe this class should be changed to support multiple column names.
Recurrence
No recurrence.
History
#1 Updated by Knödlseder Jürgen almost 7 years ago
- Target version set to 1.5.1
I agree that the class should support both column names.
#2 Updated by Knödlseder Jürgen over 6 years ago
- Target version changed from 1.5.1 to 1.6.0
#3 Updated by Knödlseder Jürgen over 6 years ago
- Status changed from New to In Progress
- Assigned To set to Knödlseder Jürgen
- % Done changed from 0 to 10
Here the places where BGD
is explicitly hardcoded in GammaLib:
inst/cta/src/GCTABackground3D.cpp: m_inx_bgd = m_background.table("BGD"); inst/cta/src/GCTAResponseIrf.cpp: bgdname = m_caldb.filename("","","BGD","","",expr);
The code in
GCTABackground3D
refers to a column name in the background response table, the code in GCTAResponseIrf
refers to the name in the caldb index. For the later, the handling of a BKG
is already supported.
And here the places where BGD
is explicitly hardcoded in ctools:
cscripts/csobs2caldb.py: table['CAL_CNAM'][row] = 'BGD' cscripts/csroot2caldb.py: names = ['EA', 'PSF', 'EDISP', 'BGD'] cscripts/csroot2caldb.py: # Create "BGD" data column cscripts/csroot2caldb.py: self._make_3D(array, ds['HDU_BGD'], 'BGD', '1/(MeV s sr)') test/test_csobs2caldb.py: bgd = gammalib.GFilename(db.filename('','','BGD','','',expr)) test/dev/cta_kb_root2caldb.py: self.bgd_name = "BGD"
#4 Updated by Knödlseder Jürgen over 6 years ago
- % Done changed from 10 to 30
I changed GCTABackground3D
so that it now first searches for a response table with name BKG
, and only if such a table does not exit, searches for a table with name BGD
. This assures backwards compatibility with old calibration files.
I also updated all keywords in the calibration files from BGD
to BKG
, and made also the background units compliant with astropy.
#5 Updated by Knödlseder Jürgen over 6 years ago
- Status changed from In Progress to Pull request
- % Done changed from 30 to 100
I also changed the ctools code. All BGD
are now replaced by BKG
.
#6 Updated by Knödlseder Jürgen over 6 years ago
- Status changed from Pull request to Closed
Merged into devel
.