Issue with scipy 1.10 and gammapy 1.0 #4392
-
I am currently trying to reproduce the results for the spectral analysis of extended sources from the official gammpy tutorial page (Here's the link) Here's the part of the data reduction code that's showing the error: datasets = Datasets()
for obs in observations:
# A SpectrumDataset is filled in this geometry
dataset = maker.run(dataset_empty.copy(name= f"obs-{obs.obs_id}"), obs)
# Define safe mask
dataset = safe_mask_maker.run(dataset, obs)
# Compute OFF
dataset = bkg_maker.run(dataset, obs)
# Append dataset to the list
datasets.append(dataset)
display(datasets.meta_table) Here's the output I am getting: Observation
obs id : 20326
tstart : 53112.06
tstop : 53112.08
duration : 1683.00 s
pointing (icrs) : 259.3 deg, -39.8 deg
deadtime fraction : 10.9%
/home/ashesh_ak/.local/lib/python3.8/site-packages/gammapy/maps/geom.py:48: RuntimeWarning: invalid value encountered in cast
p_idx = np.rint(p).astype(int)
Output exceeds the [size limit](command:workbench.action.openSettings?%5B%22notebook.output.textLineLimit%22%5D). Open the full output data [in a text editor](command:workbench.action.openLargeOutput?6973ccbf-879b-4adb-8a7c-70cd7c1299e2)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[22], line 6
3 for obs in observations:
4 # A SpectrumDataset is filled in this geometry
5 print(obs)
----> 6 dataset = maker.run(dataset_empty.copy(name= f"obs-{obs.obs_id}"), obs)
7 #dataset = maker.run(dataset_empty.copy(name= "{}".format(obs.obs_id)), obs)
8
9 # Define safe mask
10 dataset = safe_mask_maker.run(dataset, obs)
File [~/.local/lib/python3.8/site-packages/gammapy/makers/map.py:395](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/ashesh_ak/dark_matter_research/~/.local/lib/python3.8/site-packages/gammapy/makers/map.py:395), in MapDatasetMaker.run(self, dataset, observation)
392 kwargs["counts"] = counts
394 if "exposure" in self.selection:
--> 395 exposure = self.make_exposure(dataset.exposure.geom, observation)
396 kwargs["exposure"] = exposure
398 if "background" in self.selection:
File [~/.local/lib/python3.8/site-packages/gammapy/makers/spectrum.py:64](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/ashesh_ak/dark_matter_research/~/.local/lib/python3.8/site-packages/gammapy/makers/spectrum.py:64), in SpectrumDatasetMaker.make_exposure(self, geom, observation)
49 def make_exposure(self, geom, observation):
50 """Make exposure.
51
52 Parameters
(...)
...
342 result = self._evaluate_linear(indices, norm_distances)
File _rgi_cython.pyx:19, in scipy.interpolate._rgi_cython.__pyx_fused_cpdef()
TypeError: No matching signature found The expected result: /home/runner/work/gammapy-docs/gammapy-docs/gammapy/.tox/build_docs/lib/python3.9/site-packages/gammapy/maps/geom.py:48: RuntimeWarning: invalid value encountered in cast
p_idx = np.rint(p).astype(int)
/home/runner/work/gammapy-docs/gammapy-docs/gammapy/.tox/build_docs/lib/python3.9/site-packages/gammapy/maps/geom.py:48: RuntimeWarning: invalid value encountered in cast
p_idx = np.rint(p).astype(int)
/home/runner/work/gammapy-docs/gammapy-docs/gammapy/.tox/build_docs/lib/python3.9/site-packages/gammapy/maps/geom.py:48: RuntimeWarning: invalid value encountered in cast
p_idx = np.rint(p).astype(int)
/home/runner/work/gammapy-docs/gammapy-docs/gammapy/.tox/build_docs/lib/python3.9/site-packages/gammapy/maps/geom.py:48: RuntimeWarning: invalid value encountered in cast
p_idx = np.rint(p).astype(int)
/home/runner/work/gammapy-docs/gammapy-docs/gammapy/.tox/build_docs/lib/python3.9/site-packages/gammapy/maps/geom.py:48: RuntimeWarning: invalid value encountered in cast
p_idx = np.rint(p).astype(int)
/home/runner/work/gammapy-docs/gammapy-docs/gammapy/.tox/build_docs/lib/python3.9/site-packages/gammapy/maps/geom.py:48: RuntimeWarning: invalid value encountered in cast
p_idx = np.rint(p).astype(int)
/home/runner/work/gammapy-docs/gammapy-docs/gammapy/.tox/build_docs/lib/python3.9/site-packages/gammapy/maps/geom.py:48: RuntimeWarning: invalid value encountered in cast
p_idx = np.rint(p).astype(int)
/home/runner/work/gammapy-docs/gammapy-docs/gammapy/.tox/build_docs/lib/python3.9/site-packages/gammapy/maps/geom.py:48: RuntimeWarning: invalid value encountered in cast
p_idx = np.rint(p).astype(int)
/home/runner/work/gammapy-docs/gammapy-docs/gammapy/.tox/build_docs/lib/python3.9/site-packages/gammapy/maps/geom.py:48: RuntimeWarning: invalid value encountered in cast
p_idx = np.rint(p).astype(int)
/home/runner/work/gammapy-docs/gammapy-docs/gammapy/.tox/build_docs/lib/python3.9/site-packages/gammapy/maps/geom.py:48: RuntimeWarning: invalid value encountered in cast
p_idx = np.rint(p).astype(int)
/home/runner/work/gammapy-docs/gammapy-docs/gammapy/.tox/build_docs/lib/python3.9/site-packages/gammapy/maps/geom.py:48: RuntimeWarning: invalid value encountered in cast
p_idx = np.rint(p).astype(int)
/home/runner/work/gammapy-docs/gammapy-docs/gammapy/.tox/build_docs/lib/python3.9/site-packages/gammapy/maps/geom.py:48: RuntimeWarning: invalid value encountered in cast
p_idx = np.rint(p).astype(int)
NAME TYPE ... GEOLAT ALTITUDE
...
--------- -------------------- ... ------------------- ------------------
obs-20326 SpectrumDatasetOnOff ... -23.271777777777796 1834.9999999997835
obs-20327 SpectrumDatasetOnOff ... -23.271777777777796 1834.9999999997835
obs-20349 SpectrumDatasetOnOff ... -23.271777777777796 1834.9999999997835
obs-20350 SpectrumDatasetOnOff ... -23.271777777777796 1834.9999999997835
obs-20396 SpectrumDatasetOnOff ... -23.271777777777796 1834.9999999997835
obs-20397 SpectrumDatasetOnOff ... -23.271777777777796 1834.9999999997835 Can someone please explain what's going wrong and how can I solve this issue? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Merci! We will respond to your issue shortly. In the meantime, try |
Beta Was this translation helpful? Give feedback.
-
It was an issue with scipy version 1.10 (see #4265). It has been addressed in the 1.0.1 release of gammapy (https://docs.gammapy.org/1.0.1/release-notes/v1.0.1.html). Either of the following will resolve your issue:
|
Beta Was this translation helpful? Give feedback.
It was an issue with scipy version 1.10 (see #4265). It has been addressed in the 1.0.1 release of gammapy (https://docs.gammapy.org/1.0.1/release-notes/v1.0.1.html). Either of the following will resolve your issue: