Using a calibration databaseΒΆ

The class GCaldb implements the interface to a calibration database that is compliant with the HEASARC format. To use a calibration database, make sure that the environment variable CALDB is set to a valid calibration database. The database is the open by specifying a mission and an instrument name. The examples below show two variants of opening the prod2 database for CTA.

C++

1GCaldb caldb1("cta","prod2");                        // Using opening constructor
2GCaldb caldb2;
3caldb2.open("cta","prod2");                          // Using open method

Python

1caldb1 = gammalib.GCaldb('cta','prod2')              # Using opening constructor
2caldb2 = gammalib.GCaldb()
3caldb2.open('cta','prod2')                           # Using open method

Once opened, the database can be used to locate for example the filename of a response component. The examples below show how the effective area filename for the response South_5h is accessed via the calibration database.

C++

1GFilename filename = caldb1.filename("","","EFF_AREA","","","NAME(South_5h)");

Python

1filename = caldb1.filename('','','EFF_AREA','','','NAME(South_5h)')