Implement saving and loading of response cache information
|Assigned To:||Knödlseder Jürgen||% Done:|
In order to speed-up computations, it should be possible to save the response cache and the reload the cached values so that re-computation is not necessary. Corresponding loading and saving methods should be implemented in
The actual loading and saving should be implemented in the XML read/write methods of the relevant observation classes. For example for COMPTEL, implementation should be done in
GCOMObservation::write. A possible logic would be to add a member
to the class that by default is an empty string. If the filename is set, the
GFilename m_irfcachename; //!< IRF response cache filename
GCOMObservation::writemethod should save the response cache in the specified filename, and write the corresponding filename in the XML file
<parameter name="IRFcache" file="irf_cache.fits"/>The
GCOMObservation::readmethod should then check for the existence of the parameter, and if present, load the cache from the FITS file.
The FITS file would be a table with two columns, the first specifying the IRF cache ID and the second the IRF values.
#1 Updated by Knödlseder Jürgen 19 days ago
- Status changed from New to In Progress
- % Done changed from 0 to 30
read() methods into the
GResponseVectorCache to enable saving and loading of cache values using FITS files. Each cache entry is saved in a specific extension to take benefit from the compressed cache format. The cache identifier is used as the extension name.
Some code has been added to the unit test to verify that saving and loading works correctly.
#2 Updated by Knödlseder Jürgen 18 days ago
- Status changed from In Progress to Pull request
- % Done changed from 30 to 100
I implemented the automatic saving and loading of cached response information in the
GCOMResponse classes. The automatic saving is enabled by setting the response cache name using
GCOMObservation::rspname() to a non-empty string that specifies the name of the file into which the cached response values will be written. Once a file has been written it will never be overwritten again.
I also implemented a comscript
comobsconv that convolves a model with the COMPTEL response and stores the convolved response files in a specified output folder. The script also returns an observation definition XML file that points to the convolved response files and that can be used for further analysis.