fermi-lat / Likelihood

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

gtdiffrsp returns "EventContainer::getEvents: efficiency < 0" #37

Closed knalew closed 5 years ago

knalew commented 5 years ago

I receive runtime errors from gtdiffrsp.

This happened for the first time trying to process P8R3 data, switching to the fermitools on conda (see below). I can successfully run gtvcut, gtselect, gtmktime, gtltcube, gtexpmap. In python, UnbinnedObs(eventFile=sys.argv[4], scFile=sys.argv[5], expMap=sys.argv[6], expCube=sys.argv[7], irfs=sys.argv[8]) is successful, while UnbinnedAnalysis(obs, srcModel=sys.argv[9], optimizer='Drmngb') returns: "RuntimeError: Event::diffuseResponse: Diffuse component p8r3_source_v2__gll does not have an associated diffuse response."

gtdiffrsp irfs=$irfs srcmdl=$SM evfile=$PH scfile=$SC chatter=4 debug=yes WARNING: version mismatch between CFITSIO header (v3.43) and linked library (v3.41). This is gtdiffrsp version HEAD ResponseFunctions::load: IRF used: P8R3_SOURCE_V2 event_types: 0 1 Creating source named 3FGL JXXXX [xN] Creating source named gll MapBase::readFitsFile: creating WcsMap2 object Creating source named iso adding source gll adding source iso Working on... PH.fits terminate called after throwing an instance of 'std::runtime_error' what(): EventContainer::getEvents: efficiency < 0

conda list fermitools

packages in environment at /XXX:

Name Version Build Channel

fermitools 1.0.1 py27h39e3cac_0 fermi fermitools-data 0.16 0 fermi

uname -a Linux 3.10.0-693.17.1.el7.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux

nmirabal commented 5 years ago

Make sure that the diffuse/isotropic models in the XML file are properly defined and in the correct location. The following link provides an example on how to use the latest 4FGL models https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/data/Likelihood/3C279input_model.xml

knalew commented 5 years ago

Problem has been resolved when gtdiffrsp is called for events file filtered with gtmktime. Previously, it has been possible to run gtdiffrsp on event files taken straight from the LAT query. Thank you