gammapy / enrico

Enrico helps you with your Fermi data analysis
http://enrico.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
22 stars 26 forks source link

error while executing gtmodel during enrico_sed operation #133

Open basuparth opened 5 years ago

basuparth commented 5 years ago

I was running enrico_sed to generate flux points and I ran into the following error. Prior to gtmodel all the other steps were executed successfully by enrico.

Error report

time -p gtmodel srcmaps=/home/parth/SINP/1ES1218+304/1ES1218+304_LAT_Analysis_PowerLaw2_srcMap.fits srcmdl=/home/parth/SINP/1ES1218+304/1ES1218+304_PowerLaw2_LAT_Analysis_out.xml outfile=/home/parth/SINP/1ES1218+304/1ES1218+304_LAT_Analysis_PowerLaw2_ModelMap.fits irfs="P8R3_SOURCE_V2" evtype=3 expcube=/home/parth/SINP/1ES1218+304/1ES1218+304_LAT_Analysis_ltCube.fits bexpmap=/home/parth/SINP/1ES1218+304/1ES1218+304_LAT_Analysis_BinnedMap.fits convol=yes resample=yes rfactor=2 outtype="CMAP" psfcorr=yes edisp=no chatter=2 clobber=yes debug=no gui=no mode="ql"

WARNING: version mismatch between CFITSIO header (v3.43) and linked library (v3.41).

Using evtype=3 (i.e., FRONT/BACK irfs) real 61.48 user 59.56 sys 0.77 Traceback (most recent call last): File "/home/parth/SINP/enrico/bin/enrico_sed", line 53, in sed(config,infile) File "/home/parth/SINP/enrico/bin/enrico_sed", line 13, in sed run(infile) File "/home/parth/SINP/enrico/enrico/RunGTlike.py", line 196, in run FitRunner.ModelMap(outXml) File "/home/parth/SINP/enrico/enrico/fitmaker.py", line 473, in ModelMap self.obs.ModelMaps(xml) File "/home/parth/SINP/enrico/enrico/gtfunction.py", line 424, in ModelMaps utils.SubtractFits(self.cmapfile,self.ModelMap,self.Configuration) File "/home/parth/SINP/enrico/enrico/utils.py", line 120, in SubtractFits fits.writeto(abs_diff_file, data1 - data2, head) File "/home/parth/anaconda2/envs/fermi/lib/python2.7/site-packages/astropy/utils/decorators.py", line 508, in wrapper return function(*args, kwargs) File "/home/parth/anaconda2/envs/fermi/lib/python2.7/site-packages/astropy/io/fits/convenience.py", line 433, in writeto checksum=checksum) File "/home/parth/anaconda2/envs/fermi/lib/python2.7/site-packages/astropy/utils/decorators.py", line 508, in wrapper return function(*args, *kwargs) File "/home/parth/anaconda2/envs/fermi/lib/python2.7/site-packages/astropy/io/fits/hdu/base.py", line 377, in writeto checksum=checksum) File "/home/parth/anaconda2/envs/fermi/lib/python2.7/site-packages/astropy/utils/decorators.py", line 508, in wrapper return function(args, kwargs) File "/home/parth/anaconda2/envs/fermi/lib/python2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 872, in writeto self.verify(option=output_verify) File "/home/parth/anaconda2/envs/fermi/lib/python2.7/site-packages/astropy/io/fits/verify.py", line 121, in verify raise VerifyError('\n' + '\n'.join(messages)) astropy.io.fits.verify.VerifyError: Verification reported errors: HDU 0: NAXISj keyword out of range ('NAXIS3' when NAXIS == 2) Note: astropy.io.fits uses zero-based indexing.

davidsanchez commented 5 years ago

Hi I am aware of this and I have no solution yet cheers

mireianievas commented 5 years ago

Is this already fixed? I see a head.remove('NAXIS3') statement in the code and I have never encountered this issue.