fermi-lat / Likelihood

BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

RuntimeError: gtexpmap execution failed #107

Closed aminasuneer closed 2 years ago

aminasuneer commented 3 years ago

I have been doing fermi unbinned analysis in python prompt, when I ran the expMap.run() I got the error as below _Caught St13runtimeerror at the top level: RoiCuts::sortCuts: Traceback (most recent call last): File "exp.py", line 12, in my_apps.expMap.run() File "/home/amina/anaconda3/envs/fermi/lib/python3.7/site-packages/fermitools/GtApp.py", line 76, in run raise RuntimeError (self.appName + " execution failed") RuntimeError: gtexpmap execution failed

But I got the expmap when I do the unbinned likelihood analysis threads. here in the example, the source radius given is 20. I took the data in 10 degree radius. In unbinned tutorial src radius is 30 degree is it beacuse ROI 10 + src 20? I have tried the above expMap task with 20 degree and 30 degree, but the same error. Can anyone fix this? Thanks in advance..

nmirabal commented 3 years ago

You should follow the ROI definitions specified in the following link. https://fermi.gsfc.nasa.gov/ssc/data/p7rep/analysis/scitools/python_tutorial.html

nyctophile-aayu commented 2 years ago

I am getting this error and even after following the above sheet, the error persists. Can anyone help, please?

my_apps.expMap['evfile'] = '1633+382_filtered_gti.fits' my_apps.expMap['scfile'] = 'spacecraft.fits' my_apps.expMap['expcube'] = '1633+382_ltCube.fits' my_apps.expMap['outfile'] = '1633+382_expMap.fits' my_apps.expMap['irfs'] = 'CALDB' my_apps.expMap['srcrad'] = 20 my_apps.expMap['nlong'] = 120 my_apps.expMap['nlat'] = 120 my_apps.expMap['nenergies'] = 20 my_apps.expMap.run() time -p gtexpmap evfile=1633+382_filtered_gti.fits evtable="EVENTS" scfile=spacecraft.fits sctable="SC_DATA" expcube=1633+382_ltCube.fits outfile=1633+382_expMap.fits irfs="CALDB" evtype="INDEF" srcrad=20.0 nlong=120 nlat=120 nenergies=20 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. Caught St13runtime_error at the top level: RoiCuts::sortCuts: Traceback (most recent call last): File "", line 1, in File "/home/doc_ayush/anaconda3/envs/fermi/lib/python3.7/site-packages/fermitools/GtApp.py", line 76, in run raise RuntimeError (self.appName + " execution failed") RuntimeError: gtexpmap execution failed

Thanks in advance -Ayush

nmirabal commented 2 years ago

Run 'punlearn gtexpmap' in the fermi environment prior to starting python, then complete the following analysis thread from beginning to end https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/python_tutorial.html. Please contact fermihelp@milkyway.gsfc.nasa.gov if you still find an expmap error in your local installation

nyctophile-aayu commented 2 years ago

Run 'punlearn gtexpmap' in the fermi environment prior to starting python, then complete the following analysis thread from beginning to end https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/python_tutorial.html. Please contact fermihelp@milkyway.gsfc.nasa.gov if you still find an expmap error in your local installation

Hi, I am getting the similar issue, even when I work without python in Unbinned LIkelihood Analysis. Please check the error below:

gtexpmap The exposure maps generated by this tool are meant to be used for unbinned likelihood analysis only. Do not use them for binned analyses. Event data file[] 1633+382_region_filtered_gti.fits Spacecraft data file[] spacecraft.fits Exposure hypercube file[] 1633+382_ltcube.fits output file name[] 1633+382_unbin_expmap.fits Response functions[CALDB] Radius of the source region (in degrees)[30] 25 Number of longitude points (2:1000) [120] 120 Number of latitude points (2:1000) [120] 120 Number of energies (2:100) [20] 30 Caught St13runtime_error at the top level: RoiCuts::sortCuts: There should be exactly one energy range cut, one acceptance cone cut, and at least one time range and/or GTI cut. The event file contains the following DSS selections:

DSTYP1: BIT_MASK(EVENT_CLASS,128,P8R3) DSUNI1: DIMENSIONLESS DSVAL1: 1:1

DSTYP2: POS(RA,DEC) DSUNI2: deg DSVAL2: CIRCLE(248.814554,38.134583,15)

DSTYP3: POS(RA,DEC) DSUNI3: deg DSVAL3: CIRCLE(248.815,38.1346,15)

DSTYP4: BIT_MASK(EVENT_TYPE,3,P8R3) DSUNI4: DIMENSIONLESS DSVAL4: 1:1

DSTYP5: ENERGY DSUNI5: MeV DSVAL5: 100:300000

DSTYP6: ZENITH_ANGLE DSUNI6: deg DSVAL6: 0:90

DSTYP7: TIME DSUNI7: s DSVAL7: TABLE DSREF7: :GTI

GTIs: (suppressed)


For both of the analysis, I am using these values for source: 1633+382

Equatorial coordinates (degrees) | (248.815,38.1346) Time range (MET) | (660799526,676351526) Time range (Gregorian) | (2021-12-10 03:25:21,2022-06-08 03:25:21) Energy range (MeV) | (100,300000) Search radius (degrees) | 15

And these errors are on repeated mode, even if I chance the values. Please suggest what and where I am going wrong. Plus, why am I getting runtime error so frequently?

Thanks in advance -Ayush

nmirabal commented 2 years ago

You have two ROI selections in the header of the 1633+382_region_filtered_gti.fits file. Try deleting one of the following two entries from the header(see below) or redo the analysis from the original event files keeping the same RA,Dec throughout your analysis. DSTYP2: POS(RA,DEC) DSUNI2: deg DSVAL2: CIRCLE(248.814554,38.134583,15)

DSTYP3: POS(RA,DEC) DSUNI3: deg DSVAL3: CIRCLE(248.815,38.1346,15)