Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#SED ValueError:Prefactor include infinite value #600

Closed
Suzuran109 opened this issue Aug 2, 2024 · 7 comments
Closed

#SED ValueError:Prefactor include infinite value #600

Suzuran109 opened this issue Aug 2, 2024 · 7 comments
Labels

Comments

@Suzuran109
Copy link

Data Analysis Question

I am doing FERMI LAT data analysis using fermipy. But when I analysed 4FGL J0002.4-5156, I encounter the following error message after running gta.sed().

Traceback (most recent call last):
File "/home/suzuran/fanal/loops.py", line 176, in
sed = gta.sed(Coords, make_plots=True,loge_bins=[2.0,2.5,3.0,3.5,4.0,4.5,5.0])
File "/home/suzuran/miniconda3/envs/easyfermi/lib/python3.9/site-packages/fermipy/sed.py", line 86, in sed
o = self._make_sed(name, **config)
File "/home/suzuran/miniconda3/envs/easyfermi/lib/python3.9/site-packages/fermipy/sed.py", line 484, in _make_sed
lnlp = self.profile_norm(name, logemin=logemin, logemax=logemax,
File "/home/suzuran/miniconda3/envs/easyfermi/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 2433, in profile_norm
xvals = self._find_scan_pts_reopt(name, npts=npts,
File "/home/suzuran/miniconda3/envs/easyfermi/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 2561, in _find_scan_pts_reopt
raise ValueError(
ValueError: Parameter scan points for 4FGL J0002.4-5156::Prefactor include infinite value.

The analysis script is given below.

from fermipy.gtanalysis import GTAnalysis
gta=GTAnalysis('./config.yaml')
gta.setup()
gta.optimize()
gta.print_roi()
gta.free_sources(distance=3.0,pars='norm')
gta.print_params(True)
gta.free_source('galdiff')
gta.free_source('isodiff')
gta.free_source(Coords)
fit_results=gta.fit(min_fit_quality=2,optimizer='NEWMINUIT', reoptimize=True)
gta.write_fits(f'./{Coords1}/output.fits')#

SED

sed = gta.sed(Coords, make_plots=True)

However, when I analyse 4FGL J0001.2+4741 or some other source, I can run sed successfully.
Any help with this issue would be greatly appreciated.

@Suzuran109
Copy link
Author

Coords = '4FGL J0002.4-5156'
Coords1 is a folder.

@omodei
Copy link
Member

omodei commented Aug 12, 2024

Can you post the config.yaml file?

@omodei
Copy link
Member

omodei commented Aug 12, 2024

This is similar to #593

@Suzuran109
Copy link
Author

binning:
binsperdec: 8
binsz: 0.1
roiwidth: 10.0
data:
evfile: ./4FGL_J0002.4-5156/list.txt
scfile: ./4FGL_J0002.4-5156/spacecraft/L240807084614B297BA2031_SC00.fits
gtlike:
edisp: true
edisp_bins: -1
edisp_disable:

  • isodiff
  • galdiff
    irfs: P8R3_SOURCE_V3
    model:
    catalogs:
  • 4FGL-DR3
    galdiff: ./Diffuse/gll_iem_v07.fits
    isodiff: ./Diffuse/iso_P8R3_SOURCE_V3_v1.txt
    src_roiwidth: 10.0
    selection:
    dec: -51.9355
    emax: 300000
    emin: 100
    evclass: 128
    evtype: 3
    filter: DATA_QUAL>0 && LAT_CONFIG==1
    ra: 0.6131
    roicut: 'no'
    tmax: 487987204
    tmin: 456364803
    zmax: 90

Is it because my config.yaml file is old version?
:(
config file.zip

@omodei
Copy link
Member

omodei commented Aug 13, 2024

Thank you! I will look into this more closely, but my suspect is that the time interval is too small (1 year), so you are running out of statistics in some of the energy bin. Can you use more data and see if the problem persists?

@Suzuran109
Copy link
Author

I tried to download the data from 18 June 2015 to 27 September 2017 and I can do the sed analysis through easyfermi but not directly through the code gta.sed()

@omodei
Copy link
Member

omodei commented Sep 24, 2024

I successfully run the analysis, but I had to use this: fit_results=gta.fit(min_fit_quality=2,optimizer='MINUIT', reoptimize=False) I did not have any problem. Can you try (and reopen this issue if you are still running in issues?)

@omodei omodei closed this as completed Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants