Bug #2855

CTYPE1 not found error with ctlike and Fermi data

Added by de Bony Mathieu over 5 years ago. Updated over 5 years ago.

Status:RejectedStart date:03/21/2019
Priority:NormalDue date:
Assigned To:-% Done:

0%

Category:-
Target version:-
Duration:

Description

I’m looking for making a fits on Fermi data with ctools. I followed the tutorial in the ctools documentation (same source, same parameter and xml configuration file, I just use the last IRF (P8R3_SOURCE_V2)). When I run ctlike i have got this error (ctlike.log):

2019-03-21T09:46:45: ************************************************************************
2019-03-21T09:46:45: * ctlike
2019-03-21T09:46:45: * ---------------------------------------------------------------------------- *
2019-03-21T09:46:45: * Version: 1.5.2 *
2019-03-21T09:46:45: *
************************************************************************
2019-03-21T09:46:46: * ERROR encounterted in the execution of ctlike. Run aborted ...
2019-03-21T09:46:46: *
ERROR in GFitsHeaderCard& GFitsHeader::at(std::string&): Invalid argument. Keyword “CTYPE1” not found in FITS header.
2019-03-21T09:46:46:
2019-03-21T09:46:46: Application “ctlike” terminated after 1 wall clock seconds, consuming 0.11 seconds of CPU time.

After modification of the observation xml by puting random name for fits file and see if an error occured, it’s look like the error come from the srcmaps fits file.


Recurrence

No recurrence.

History

#1 Updated by Tibaldo Luigi over 5 years ago

This is a known issue (#2850). It is due to the removal of some WCS keywords from the output of gtsrcmap in the latest versions of the Fermi Science Tools

https://github.com/fermi-lat/Likelihood/issues/29

A fix from the Gammalib side is on its way, in the mean time you can tweak the srcmap file to make it work with the current version, please find a code snippet below

from astropy.io import fits

srcmap = 'srcmaps.fits'
hdulist = fits.open(srcmap)
hd0 = hdulist[0].header
for card in hd0.cards:
    if card.keyword[0]=='C':
        for hdu in hdulist[3:]:
            hdu.header.append(card)
hdulist.writeto(srcmap,overwrite=True)

#2 Updated by de Bony Mathieu over 5 years ago

Thanks, it’s works. Did you know when the last IRF of Fermi will be supported by ctools ? ctlike works if I use P8R2_SOURCE_V6 but not if I use P8R3_SOURCE_V2.

#3 Updated by Knödlseder Jürgen over 5 years ago

  • Project changed from ctools to GammaLib
  • Status changed from New to Rejected

Duplication of existing issue #2850. Issue #2850 was fixed.

#4 Updated by Tibaldo Luigi over 5 years ago

P8R3 IRFs are already supported in the development version.

#5 Updated by de Bony Mathieu over 5 years ago

Ok Thanks for the information

Also available in: Atom PDF