gammapy/enrico

Issue with enrico_sed please help

Closed this issue · 2 comments

Hi,
When I try to run "enrico_sed myanalysis.conf" as the Tutorial, the result of global fit is ok, but when it calculates the bins of energy,there will be errors, but the calculation will not stop until all the calculation of the 20 bins.
Here is the error:

************************************************************

*** 6 gtexpmap --- Make an exposure map

************************************************************

time -p /home/jin/softwares/ScienceTools-v10r0p5-fssc-20150518A-source/x86_64-unknown-linux-gnu-libc2.21-0/bin/gtexpmap evfile=/home/jin/001/01/pl/Ebin20/1_01_Ebin20_19_Evt.fits evtable="EVENTS" scfile=/home/jin/001/01/pl/L170411041160C3DADF5498_SC00.fits sctable="SC_DATA" expcube=/home/jin/001/01/pl/Ebin20/1_01_Ebin20_19_ltCube.fits outfile=/home/jin/001/01/pl/Ebin20/1_01_Ebin20_19_ExpMap.fits irfs="CALDB" evtype="INDEF" srcrad=20.0 nlong=120 nlat=120 nenergies=1 submap=no nlongmin=0 nlongmax=0 nlatmin=0 nlatmax=0 chatter=2 clobber=yes debug=no gui=no mode="ql"
The exposure maps generated by this tool are meant
to be used for unbinned likelihood analysis only.
Do not use them for binned analyses.
Parameter nenergies: value 1 is less than minimum value 2.
Caught N5hoops12ApeExceptionE at the top level: Exception while querying for int parameter nenergies for component gtexpmap; Ape exception code 34 (at hoops_ape.cxx: 575)
Traceback (most recent call last):
File "/home/jin/enrico/enrico/RunGTlike.py", line 92, in
run(infile)
File "/home/jin/enrico/enrico/RunGTlike.py", line 57, in run
FitRunner,Fit = GenAnalysisObjects(config)
File "/home/jin/enrico/enrico/RunGTlike.py", line 41, in GenAnalysisObjects
FitRunner = Analysis(folder, config, tag="", verbose = verbose)
File "/home/jin/enrico/enrico/RunGTlike.py", line 16, in Analysis
FitRunner.GenerateFits() #Generates fits files
File "/home/jin/enrico/enrico/fitmaker.py", line 71, in GenerateFits
self.obs.ExpMap()
File "/home/jin/enrico/enrico/gtfunction.py", line 300, in ExpMap
expMap.run()
File "/home/jin/softwares/ScienceTools-v10r0p5-fssc-20150518A-source/x86_64-unknown-linux-gnu-libc2.21-0/lib/python/GtApp.py", line 72, in run
raise RuntimeError, self.appName + " execution failed"
RuntimeError: gtexpmap execution failed
Plotter is MatPlotlib

************************************************************

*** SUMMARY: ***

************************************************************

Source = 1
RA = 343.491 degrees
Dec = 16.1482 degrees
Start = 311653442.0 MET (s)
Stop = 311990402.0 MET (s)
ROI = 10.0 degrees
E min = 201031.999378 MeV
E max = 300000.0 MeV
IRFs = CALDB
evclass = 128
evtype = 3
Corresponding IRFs = ('P8R2_SOURCE_V6', ['BACK', 'FRONT'])

************************************************************

*** 1 gtselect --- Select data from library

************************************************************

time -p /home/jin/softwares/ScienceTools-v10r0p5-fssc-20150518A-source/x86_64-unknown-linux-gnu-libc2.21-0/bin/gtselect infile=/home/jin/001/01/pl/1_01_Evt.fits outfile=/home/jin/001/01/pl/Ebin20/1_01_Ebin20_19_Evt.fits ra=343.491 dec=16.1482 rad=10.0 tmin=311653442.0 tmax=311990402.0 emin=201031.999378 emax=300000.0 zmin=0.0 zmax=90.0 evclass=128 evclsmin=0 evclsmax=10 evtype=3 convtype=-1 phasemin=0.0 phasemax=1.0 evtable="EVENTS" chatter=2 clobber=yes debug=no gui=no mode="ql"
Done.
real 0.13
user 0.12
sys 0.00
......

And when I run enrico_plot_sed myanalysis.conf,:
jin@jin-Lenovo:~/001/01/pl$ enrico_plot_sed myanalysis.conf
[Message]: Save Ebin results in
[Message]: Reading /home/jin/001/01/pl/Ebin20/1_0.conf
[Message] Warning: cannot read the Results of energy 122
[Message]: Reading /home/jin/001/01/pl/Ebin20/1_1.conf
[Message] Warning: cannot read the Results of energy 182
[Message]: Reading /home/jin/001/01/pl/Ebin20/1_2.conf
[Message] Warning: cannot read the Results of energy 272
[Message]: Reading /home/jin/001/01/pl/Ebin20/1_3.conf

And there is no flux points in the spectrum.I want to know what went wrong :(

myanalysis.txt

Hi
This is a problem with the ST. my guess is that you have a too small energy bin and the you end up with only one energy bin in the map.
there is an option in the config file named enumbins_per_decade. you can increase it but I would not recommand that.

cheers

Thanks a lot david, and it works again, maybe I should check my data now.