fermi-lat / Likelihood

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

"Floating point exception" | gtlike #88

Open omersajid9 opened 4 years ago

omersajid9 commented 4 years ago

Hi,

I am having a problem running the gtlike properly. When I input the parameters "plot=yes" and "refit=yes" with the gtlike command, I get a "floating point exception". With this the source_model.xml file and the results.dat file is produced but the counts_spectra.fits file isn't. The following is the log file of me running the command: floating point error.txt I have tried running it with different data sets from different sources, but always get the same error.

Best, Omer

nmirabal commented 3 years ago

Does it work if you set plot=no?

omersajid9 commented 3 years ago

Yes. The error only appears when plot=yes.

dagorym commented 3 years ago

So I see this issue in version 1.2.23, 1.4.0, and 2.0.0 on Linux (Centos 7 in a docker container). With plot=no the problem doesn't occur. The actual error is happening way down in numpy, 123 stack frames deep into the program. the "offending" call is in the constructor of the MPLPlotFrame class (way back on stack frame 6) where it tries to set up the sub plot parameters (i.e. spacing) for the individual plots. It then descends into a bunch of python calls and dies in a call to the longdouble_multiply() method in a numpy package. It dies in the same place in all three versions of the tools although the depth of the stack traces vary.

I call this the "offending" function call because even if I remove it, and just go with the defaults for the look of the subplots, I still get the floating point error and crash. I haven't run a stack trace on that version yet but suspect it will basically be the same thing.

It's looking like this is a very weird bug that only manifests when calling the python from the C++ code, probably something not initializing properly or misaligned compiler settings across the various dependencies. The error seems to be a bit different on a Mac but I can't check that since I don't have a Mac handy (yet) and this involves the GUI interactions which I can't do remotely. I'll keep poking into this and see if I can figure out what exactly is happening.

dagorym commented 3 years ago

I just confirmed that the plotting works in last the last version of the ScienceTools (v11r5p3) but generates the floating point exception with version 1.0.2 of the Fermitools on the exact same docker container running CentOS 7. I'll be trying a full CentOS 7 install on bare metal to see if there is some issue with the docker container preventing the more recent Fermitools version from working.

aminasuneer commented 3 years ago

I do have the same problem with gtlike analysis. I am using the latest version of the fermitools 2.0.8. but still the problem persists.

when I activate the fermi environment ,I have a warning like

"You have LD_LIBRARY_PATH set. This might interfere with the correct functioning of conda and the Fermi ST" is it because of this?

nmirabal commented 3 years ago

The LD_LIBRARY_PATH warning should be harmless. We are still trying to understand the plotting issue for gtlike from the command line. Our suggestion for now is to use the plot within python directly as explained in the following link

https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/python_tutorial.html

aminasuneer commented 3 years ago

Thanks @nmirabal I have followed that tutorial and got the plots of likelihood fitting. Actually I need to extract the SED points. for that as given in the tutorial I have downloaded likeSED.py in the working directory. But when I try to import, it shows module not found error

*_from likeSED import _ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'likeSED'**

can you please tell me where should I download the likeSED for proper functioning?

nmirabal commented 3 years ago

likeSED is part of SED_scripts_v13.1.tgz that can be downloaded from the following link

https://fermi.gsfc.nasa.gov/ssc/data/analysis/user/

Make sure to tar it, then "cd SED_scripts_v13.1", and start python from that directory. Unfortunately, this is a user contributed software that hasn't been updated for python3 and will not work with the current version of the Fermitools. The FSSC does not directly support it, so the python file needs to be directly edited by the user.