Bug #1094
make check from gammalib-00-08-00 has one failure
Status: | Closed | Start date: | 01/21/2014 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assigned To: | Knödlseder Jürgen | % Done: | 100% | |
Category: | - | |||
Target version: | 00-08-01 | |||
Duration: |
Description
Test binned observation: ..E. NOK
Recurrence
No recurrence.
Related issues
History
#1 Updated by Knödlseder Jürgen almost 11 years ago
- Project changed from ctools to GammaLib
#2 Updated by Knödlseder Jürgen almost 11 years ago
Johann, could you please upload the files test/test_COM.log and test/reports/GCOM.xml so that I can check what’s going on? It seems that Stefan Klepser has encountered the same problem. I’m wondering why I don’t see this on my machine ...
#4 Updated by Cohen-Tanugi Johann almost 11 years ago
- File test_COM added
#5 Updated by Knödlseder Jürgen almost 11 years ago
- File config.log added
For the record, I grabbed the gammalib-00-08-00 release tarball and build it on my Mac OS X 10.6.8. All tests passed. Here the configuration file: config.log
#6 Updated by Cohen-Tanugi Johann almost 11 years ago
- File config.log added
ok here is mine. The first thing is that we do not use the same gcc version, and I am on 64bits while you are on 32bits. Beyond that, I see that there are compilation failures in the logs, for both of us.....
#7 Updated by Knödlseder Jürgen almost 11 years ago
Okay, problem is as I expected in Test XML constructor
:
<testcase assertions="" classname="COMPTEL instrument specific class testing" name="Test binned observation: Test XML constructor" status="" time="0"> 24 <error message='*** ERROR in GFits::open(std::string&): Unable to open FITS file "/home/cohen/sources/CTA/CTOOLS/ctools-00-07-00/share/caldb/u47569_iaq.fits" (status=104)' type="N10GException15fits_open_errorE" /> 25 </testcase>
It tries to open the file
/home/cohen/sources/CTA/CTOOLS/ctools-00-07-00/share/caldb/u47569_iaq.fits
. In the XML file, the filename is u47569_iaq.fits
. The code apparently adds the path /home/cohen/sources/CTA/CTOOLS/ctools-00-07-00/share/caldb
which is, I guess, the GAMMALIB_CALDB
environment variable. Here the relevant codevoid GCOMResponse::load(const std::string& iaqname) { // Save calibration database name std::string caldb = m_caldb; // Clear instance clear(); // Restore calibration database name m_caldb = caldb; // Save IAQ name m_iaqname = iaqname; // Build filename std::string filename = m_caldb + "/" + m_iaqname; // Open FITS file GFits file(filename); // Get IAQ image const GFitsImage& iaq = *file.image(0); // Read IAQ read(iaq); // Close ARF FITS file file.close(); // Return return; }
m_caldb
is set by the std::string GCaldb::rootdir()
method and is either the environment variable GAMMALIB_CALDB
or CALDB
(whichever exists in the given order). The GAMMALIB_CALDB
is set by the GammaLib configuration script. CALDB
is set by the ctools configuration script. Maybe this is the problem?#8 Updated by Knödlseder Jürgen almost 11 years ago
- Assigned To set to Knödlseder Jürgen
- % Done changed from 0 to 10
I checked GCaldb::rootdir()
again and noticed that in contrary to expectations, CALDB
takes precedence over GAMMALIB_CALDB
. I still need to dive more in the code to understand the problem. For now I try to reproduce this by setting the CALDB
environment variable.
#9 Updated by Knödlseder Jürgen almost 11 years ago
Got it. Setting the CALDB environment variable gave
********************************************* * COMPTEL instrument specific class testing * ********************************************* Test instrument direction: ............ ok Test response: ... ok Test binned observation: ..E. NOK Test event bin: ............ ok Test event cube: .................... ok
#10 Updated by Knödlseder Jürgen almost 11 years ago
- Target version set to 00-08-01
- % Done changed from 10 to 20
And understood. The COMPTEL unit test sets internally the GAMMALIB_CALDB
environment variable before jumping into the code:
// Set GAMMALIB_CALDB environment variable std::string caldb = "GAMMALIB_CALDB="+com_caldb; putenv((char*)caldb.c_str());
This should work if
GAMMALIB_CALDB
takes precedence over CALDB
. As the code is in fact not doing this, CALDB
is used if it’s set, directing to a directory that does not contain the response files.
So the immediate correction is to correct the GCaldb::rootdir()
method.
Follow-up actions should be taken to clean up the CALDB interface. Actually, the expected structure
$CALDB/data/<mission> $CALDB/data/<mission>/<instrument> $GAMMALIB_CALDB/data/<mission> $GAMMALIB_CALDB/data/<mission>/<instrument>is not really used (the
data
directory is actually missing), and the GCOMResponse
response class does not use the appropriate GCaldb::path()
method to access the data.
The latter is followed up by change request #1102.
#11 Updated by Knödlseder Jürgen almost 11 years ago
- Status changed from New to Closed
#12 Updated by Knödlseder Jürgen almost 11 years ago
- % Done changed from 20 to 100