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

FERMI LAT data analysis using fermipy #561

Open
NithyaSathyan opened this issue Jan 2, 2024 · 5 comments
Open

FERMI LAT data analysis using fermipy #561

NithyaSathyan opened this issue Jan 2, 2024 · 5 comments

Comments

@NithyaSathyan
Copy link

Data Analysis Question

How do I...

Not sure if a certain command exists in fermipy or how to use it? Looking for examples or best practices? Ask here!

To reproduce
Please let us know which data file, instrument response function etc. you are using, and include your model(s) and analysis script.

@NithyaSathyan
Copy link
Author

I am doing FERMI LAT data analysis using fermipy. Recently i had to reinstall fermipy. However, after the installation, I encounter the following error message after running the analysis script.

File "/home/dell/Documents/1H1914-194/xx.py", line 3, in
from gammapy.irf.io import IRF_DL3_AXES_SPECIFICATION
File "/home/dell/miniconda3/envs/fermipy/lib/python3.9/site-packages/gammapy/irf/init.py", line 6, in
from .background import Background2D, Background3D
File "/home/dell/miniconda3/envs/fermipy/lib/python3.9/site-packages/gammapy/irf/background.py", line 10, in
from .core import IRF
File "/home/dell/miniconda3/envs/fermipy/lib/python3.9/site-packages/gammapy/irf/core.py", line 17, in
from .io import IRF_DL3_HDU_SPECIFICATION, IRF_MAP_HDU_SPECIFICATION, gadf_is_pointlike
File "/home/dell/miniconda3/envs/fermipy/lib/python3.9/site-packages/gammapy/irf/io.py", line 4, in
from gammapy.data.hdu_index_table import HDUIndexTable
File "/home/dell/miniconda3/envs/fermipy/lib/python3.9/site-packages/gammapy/data/init.py", line 3, in
from .data_store import DataStore
File "/home/dell/miniconda3/envs/fermipy/lib/python3.9/site-packages/gammapy/data/data_store.py", line 15, in
from .observations import Observation, ObservationChecker, Observations
File "/home/dell/miniconda3/envs/fermipy/lib/python3.9/site-packages/gammapy/data/observations.py", line 22, in
from .event_list import EventList, EventListChecker
File "/home/dell/miniconda3/envs/fermipy/lib/python3.9/site-packages/gammapy/data/event_list.py", line 8, in
from astropy.coordinates.angle_utilities import angular_separation
ModuleNotFoundError: No module named 'astropy.coordinates.angle_utilities'

The analysis script is given below.

from fermipy.gtanalysis import GTAnalysis
gta = GTAnalysis('config.yaml',logging={'verbosity': 3})
gta.setup()
gta.free_sources(distance=3.0,pars='norm')
gta.free_source('galdiff')
gta.free_source('isodiff')
gta.free_sources(minmax_ts=[10,None],pars='norm')
gta.free_source('4FGL J1917.7-1921')
gta.fit()
gta.write_roi('fit_model')
import numpy as np
sed=gta.sed('4FGL J1917.7-1921', make_plots=True)

Please help me solve this issue. Thanks in advance

@nyctophile-aayu
Copy link

@NithyaSathyan

Have you tried installing the astropy using conda after activating the conda environment for fermipy? Also, try installing astropy with pip. Hopefully that should work.

-Ayush

@NithyaSathyan
Copy link
Author

NithyaSathyan commented Jan 12, 2024 via email

@NithyaSathyan
Copy link
Author

NithyaSathyan commented Mar 5, 2024 via email

@omodei
Copy link
Member

omodei commented Apr 4, 2024

The minmax_ts option in gta.free_sources is used to free the sources in the ROI with TS>10, not to set a minimum threshold for datapoint/upper limits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants