Bug #1246

LogParabola model does not work

Added by Buehler Rolf almost 10 years ago. Updated about 9 years ago.

Status:ClosedStart date:07/08/2014
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:1.0.0
Duration:

Description

Attached is an example script which simulates and fits the Crab nebula. When changing the spectral model from a parabola to log parabola the script crashes:

RuntimeError: *** ERROR in GOptimizerPar::factor_value(double&): Invalid argument.
Specified value factor 3.2e-17 is smaller than the minimum boundary 0.1.

The minimum is indeed set at line 812 in GModelSpectralLogParabola.cpp:

m_norm.min(0.1);

When I set this to zero and recompile the following error appears:

+++ WARNING in GIntegral::romb(100000, 1e+08, 5): Integration uncertainty nan exceeds tolerance of nan after 21 iterations. Result -nan is inaccurate.

The prefactor of the logparabola is fit towards zero:

Prefactor ................: 1.8054e-20 +/- 6.23361e-20

To run the script the caldb needs to be in the same folder.

logpar_example.py Magnifier - example script (1.77 KB) Buehler Rolf, 07/08/2014 11:08 AM

caldb.zip - used caldb (76 KB) Buehler Rolf, 07/08/2014 11:08 AM

logpar_example.py Magnifier (1.75 KB) Knödlseder Jürgen, 10/30/2014 11:44 AM

ctlike.log (8.68 KB) Knödlseder Jürgen, 10/30/2014 11:44 AM

prefactor.png (44.7 KB) Knödlseder Jürgen, 02/10/2015 11:23 PM

index.png (43.7 KB) Knödlseder Jürgen, 02/10/2015 11:23 PM

curvature.png (44.8 KB) Knödlseder Jürgen, 02/10/2015 11:23 PM

Prefactor Index Curvature

Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen almost 10 years ago

  • Project changed from ctools to GammaLib

#2 Updated by Knödlseder Jürgen almost 10 years ago

  • Target version set to 1.0.0

#3 Updated by Knödlseder Jürgen over 9 years ago

  • File logpar_example.pyMagnifier added
  • File ctlike.log added
  • Status changed from New to Feedback
  • Assigned To set to Knödlseder Jürgen
  • % Done changed from 0 to 100

I’m not sure why the minimum has been set to 0.1 in the code, I set it now to 0.0.

I redid you test with the latest version after slightly adapting your script to my environment (see logpar_example.py). It seems to work now (see attached ctlike logfile: ctlike.log).

I put this issue now on feedback and will close you with the next release in case that I hear not back from you.

#4 Updated by Knödlseder Jürgen about 9 years ago

Below the result from a pull distribution test using a point source and the log parabola model. Everything seems okay. I close now the issue.

Also available in: Atom PDF