Python How do I fix this galactic source analysis using python?

Click For Summary
The discussion centers on a runtime error encountered while running a Python script related to astronomy, specifically when attempting to free up sources on a TS map for a galactic source. The error traceback indicates issues with the Minuit optimization process, specifically the HESSE results being invalid. The user attempted to debug the script by adding print statements and running previous iterations but continued to face the same error. Guidance was sought on the forum regarding the appropriate use of the HESSE function, with a suggestion to refer to the iminuit documentation. The documentation notes that HESSE is suitable for parabolic error curves, while the alternative function, MINOS, does not have this constraint, potentially offering a solution to the user's problem.
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 occurence 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.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 16 ·
Replies
16
Views
6K
Replies
55
Views
6K
  • · Replies 16 ·
Replies
16
Views
4K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · 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
5K