How do I fix this galactic source analysis using python?

In summary, the conversation discusses a runtime error related to using a python script for freeing up sources on a TS map on a galactic source. The error is traced back to an invalid result from the Minuit HESSE function. The individual asking for help has tried debugging and running previous versions of the script, but still receives the same error. They are seeking guidance on how to resolve this issue.
  • #1
Carphysics
6
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
  • #2
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.
 

1. How do I import the necessary libraries for galactic source analysis in python?

To import the necessary libraries for galactic source analysis in python, you can use the "import" statement followed by the name of the library. For example, to import the numpy library, you would use "import numpy". You can also import specific functions or modules from a library by using the "from" keyword. For example, to import the "mean" function from the statistics module in the numpy library, you would use "from numpy import statistics.mean".

2. How do I read and manipulate data from a galactic source using python?

To read and manipulate data from a galactic source using python, you can use the pandas library. This library provides functions for reading data from various file formats such as CSV, Excel, and HDF5. Once the data is imported into a pandas dataframe, you can use built-in functions to manipulate and analyze the data, such as selecting specific columns or rows, filtering data, and performing calculations.

3. How do I plot and visualize galactic source data using python?

To plot and visualize galactic source data using python, you can use the matplotlib library. This library provides a variety of functions for creating different types of graphs and charts, such as line plots, scatter plots, histograms, and more. You can customize the appearance of your plots by adding labels, titles, and legends, and by adjusting colors, markers, and axes. Other useful libraries for data visualization in python include seaborn and plotly.

4. How do I perform statistical analysis on galactic source data using python?

To perform statistical analysis on galactic source data using python, you can use the scipy library. This library provides functions for common statistical tests, such as t-tests, ANOVA, and regression analysis. You can also use the numpy library for basic statistical calculations, such as mean, median, standard deviation, and correlation. Additionally, pandas has built-in functions for descriptive statistics and data aggregation.

5. How do I apply machine learning techniques to galactic source data using python?

To apply machine learning techniques to galactic source data using python, you can use the scikit-learn library. This library provides a wide range of machine learning algorithms for tasks such as classification, regression, and clustering. You can also use other libraries like tensorflow and keras for deep learning applications. Before applying machine learning techniques, it is important to preprocess and clean the data, and to split it into training and testing sets.

Similar threads

  • Programming and Computer Science
Replies
16
Views
5K
  • Programming and Computer Science
2
Replies
55
Views
4K
  • Programming and Computer Science
Replies
3
Views
894
  • Programming and Computer Science
Replies
16
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
388
Replies
2
Views
2K
  • Programming and Computer Science
Replies
6
Views
3K
  • Programming and Computer Science
Replies
4
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
4
Views
1K
Back
Top