Bug #2140
ctmodel does not work for cube-background (reason: 'instrument' value)
Status: | Closed | Start date: | 06/29/2017 | |
---|---|---|---|---|
Priority: | High | Due date: | ||
Assigned To: | Knödlseder Jürgen | % Done: | 100% | |
Category: | - | |||
Target version: | 1.3.1 | |||
Duration: |
Description
After running a simulation (with ctobssim) and creating a background cube, I wanted to create a model cube of the simulated background.
For this I used the .xml-file that I got from ctbkgcube, see 'outmodel_0.xml’ (sources were deleted manually).
The model cube was always empty! For sources, ctmodel worked fine, the problem only occurred with cube-background.
After a few days of investigation I now discovered that the reason is the 'instrument’ value.
If I change it manually to 'CTA,HESS,MAGIC,VERITAS’, everything works fine, see 'outmodel.xml’.
I don’t know how to fix the problem in the ctools-code, wether one should change what ctbkgcube writes in the xml-files or better change what ctmodel accepts as instrument value, so I assign this to Jürgen, I hope this is okay. I also attached the cubes if you want to reproduce the problem.
Thanks!
Recurrence
No recurrence.
History
#1 Updated by Eschbach Stefan over 7 years ago
- File deleted (
exp_cube.fits)
#2 Updated by Eschbach Stefan over 7 years ago
- File deleted (
bkg_cube.fits)
#3 Updated by Eschbach Stefan over 7 years ago
- File deleted (
psf_cube.fits)
#4 Updated by Eschbach Stefan over 7 years ago
I had to delete the cubes because I was told they were HESS intern, sry...
#5 Updated by Knödlseder Jürgen over 7 years ago
- Priority changed from Normal to High
- Target version set to 1.3.1
I recently remove the CTA,HESS,MAGIC,VERITAS instruments from the XML file, but apparently this has a side effect. I’ll try to fix the code that it works without that string.
#6 Updated by Knödlseder Jürgen over 7 years ago
- Status changed from New to In Progress
It appears that ctmodel
needs either an instrument of CTA
or no instrument attribute to work correctly.
This happens probably because ctmodel
creates an observation with the instrument set to CTA
in ctmodel::get_obs
.
The issue comes in fact from a change in ctbkgcube::run
where before the tool wrote always the attribute "CTA,HESS,MAGIC,VERITAS"
into the XML file while now it collects the instruments for all input observations in the instrument attribute using the following code:
// Collect instrument identifiers
if (instruments.length() > 0) {
instruments += ",";
}
instruments += m_bkgmdl[i]->instruments();
This by the way explains why your XML file has many times the
HESS
attribute since for each HESS input background model one string will be appended. This logic should be changed so that each instrument string is unique.
Now the issue still is that ctmodel
does not know that a HESS
observation is handled. ctmodel
should probably extract the instrument from the counts cube TELESCOPE
keyword.
#7 Updated by Knödlseder Jürgen over 7 years ago
- Target version changed from 1.3.1 to 1.4.0
I manually changed the TELESCOP
keyword in an event list to HESS
and ctbin
then created a counts cube with the TELESCOP
keyword set to HESS
. So it appears that the issue is that ctobssim
does create an event list with the TELESCOP
keyword set to CTA
.
So far ctobssim
always creates a CTA
observation. In principle, the instrument type can be inferred from the response function FITS file TELESCOP
keywords, and the code should in fact check that the instrument for an observation and the response function is consistent. This needs to add an instrument attribute to the IRFs, which implies an interface change, hence I move the issue to version 1.4.0.
#8 Updated by Knödlseder Jürgen over 7 years ago
- Target version changed from 1.4.0 to 1.3.1
- % Done changed from 0 to 80
I decided to put back the setting of the CTA,HESS,MAGIC,VERITAS
attribute in ctbkgcube
, and do this in the bugfix release 1.3.1.
I created issue #2152 to request a proper taking into account of non-CTA instruments.
#9 Updated by Knödlseder Jürgen over 7 years ago
- Status changed from In Progress to Closed
- % Done changed from 80 to 100