How do I fix this galactic source analysis using python?

Click For Summary
SUMMARY

The discussion focuses on resolving a RuntimeError encountered in a Python script related to galactic source analysis using the ScienceTools library (version 10r0p5). The error, specifically "Minuit HESSE results invalid," indicates issues with the error matrix evaluation during optimization. The recommended solution involves utilizing the "minos" function from the iminuit library as an alternative to "hesse," which is suitable when the error curve is not parabolic. Debugging efforts included adding print statements and testing previous iterations, but the error persisted.

PREREQUISITES
  • Familiarity with Python programming
  • Understanding of optimization techniques in data analysis
  • Knowledge of the ScienceTools library (version 10r0p5)
  • Basic concepts of error analysis in statistical modeling
NEXT STEPS
  • Research the iminuit library and its functions, particularly "minos" for error analysis
  • Explore optimization techniques in Python, focusing on the Minuit optimizer
  • Study the ScienceTools documentation for best practices in galactic source analysis
  • Investigate common RuntimeErrors in Python and their debugging strategies
USEFUL FOR

Astronomers, data analysts, and Python developers working on optimization problems in scientific computing, particularly those involved in galactic source analysis.

Carphysics
Messages
6
Reaction score
0

Homework Statement


This is related to Astronomy & python . I am trying free-up sources on TS map on a galactic source with python script. But when I run the script, at the end of the process, I get the following run time error.

Code:
Traceback (most recent call last):
  File "find_new_sources.py", line 149, in <module>
    like1.fit()
  File "/opt/ScienceTools-v10r0p5-fssc-20150518-x86_64-unknown-linux-gnu-libc2.19-0/x86_64-unknown-linux-gnu-libc2.19-0/lib/python/AnalysisBase.py", line 99, in fit
    optObject=optObject)
  File "/opt/ScienceTools-v10r0p5-fssc-20150518-x86_64-unknown-linux-gnu-libc2.19-0/x86_64-unknown-linux-gnu-libc2.19-0/lib/python/AnalysisBase.py", line 142, in _errors
    myOpt.find_min(verbosity, tol, self.tolType)
  File "/opt/ScienceTools-v10r0p5-fssc-20150518-x86_64-unknown-linux-gnu-libc2.19-0/x86_64-unknown-linux-gnu-libc2.19-0/lib/python/pyLikelihood.py", line 2093, in find_min
    return lib_pyLikelihood.Optimizer_find_min(*args)
RuntimeError: Minuit HESSE results invalid

Homework Equations

The Attempt at a Solution



I tried debugging the code by adding print statements on various spots in the script, as well as running the script on a previous iteration of this freeing process to see whether I would get the same xml file, but both of these methods resulted in the same error.

As I find my python related questions in this forum, I am posting it here. If this is not a correct forum, let me know, where can I seek guidance.

Thanks for guidance.
 
Technology news on Phys.org
Never used Python. Try looking at http://iminuit.readthedocs.io/en/latest/api.html and searching for "hesse" on the page (it's the 3rd occurrence on the page). It gives a brief description and an alternative error checking function named "minos".

Essentially it says that "hesse" is good for evaluating the error matrix if the error curve shape is parabolic. "minos" does the same without the parabolic constraint.
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
6K
Replies
55
Views
7K
  • · Replies 16 ·
Replies
16
Views
4K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 18 ·
Replies
18
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 6 ·
Replies
6
Views
6K