Closed grburgess closed 1 year ago
update: if one forces numpy==1.22.4 in the environment, all works.
@hayalaso could this be related to the weirdness you were seeing in the plots of the model maps (see attached image)?
In case it is related to the same underlying problem: @hayalaso was seeing this issue with numpy 1.23.5
, while my model maps looked fine with numpy 1.24
.
I'm not sure. I just re-run the program I have and I still got the same problem with numpy 1.24. I tried to print a model map before the fit and I still got the same map.
This is the code I used for that.
gta = GTAnalysis('config.yaml', logging={'verbosity':3})
gta.setup()
gta.optimize()
gta.print_roi()
gta.write_roi("optimize_model",make_plots=True)
I see. Sorry for the confusion @hayalaso , I guess you should open a new issue then.
I ran into the same issue. Here is an error message.
/Users/htajima/opt/anaconda3/envs/fermi-root/lib/python3.9/site-packages/fermipy/irfs.py:51: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)]
instead of arr[seq]
. In the future this will be interpreted as an array index, arr[np.array(seq)]
, which will result either in an error or a different result.
log_ratio = np.log(x[xs1] / x[xs0])
/Users/htajima/opt/anaconda3/envs/fermi-root/lib/python3.9/site-packages/fermipy/irfs.py:52: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)]
instead of arr[seq]
. In the future this will be interpreted as an array index, arr[np.array(seq)]
, which will result either in an error or a different result.
return 0.5 (y[ys0] x[xs0] + y[ys1] x[xs1]) log_ratio
2023-01-17 14:31:03 INFO GTBinnedAnalysis._create_expcube(): Skipping gtexpcube.
WARNING: FITSFixedWarning: RADECSYS= 'FK5 '
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: 'datfix' made the change 'Set DATEREF to '2001-01-01T00:01:04.184' from MJDREF.
Set MJD-OBS to 54682.655283 from DATE-OBS.
Set MJD-END to 56874.155220 from DATE-END'. [astropy.wcs.wcs]
2023-01-17 14:31:03 INFO GTBinnedAnalysis._create_srcmaps(): Skipping gtsrcmaps.
2023-01-17 14:31:03 INFO GTBinnedAnalysis.setup(): Finished setup for component 00
2023-01-17 14:31:03 INFO GTBinnedAnalysis._create_binned_analysis(): Creating BinnedAnalysis for component 00.
2023-01-17 14:31:11 INFO GTAnalysis.setup(): Initializing source properties
2023-01-17 14:31:15 INFO GTAnalysis.setup(): Finished setup.
2023-01-17 14:31:15 INFO GTBinnedAnalysis.write_xml(): Writing /Users/htajima/pCloud/Work/GLAST/fermipy/test/mkn421/fit0_00.xml...
2023-01-17 14:31:15 INFO GTAnalysis.write_fits(): Writing /Users/htajima/pCloud/Work/GLAST/fermipy/test/mkn421/fit0.fits...
WARNING: Format %s cannot be mapped to the accepted TDISPn keyword values. Format will not be moved into TDISPn keyword. [astropy.io.fits.column]
WARNING: Format %f cannot be mapped to the accepted TDISPn keyword values. Format will not be moved into TDISPn keyword. [astropy.io.fits.column]
WARNING: Format %s cannot be mapped to the accepted TDISPn keyword values. Format will not be moved into TDISPn keyword. [astropy.io.fits.column]
2023-01-17 14:31:28 INFO GTAnalysis.write_roi(): Writing /Users/htajima/pCloud/Work/GLAST/fermipy/test/mkn421/fit0.npy...
2023-01-17 14:31:28 INFO GTAnalysis.optimize(): Starting
Joint fit ['isodiff', 'galdiff', '3FGL J1104.4+3812', '3FGL J1112.4+3449', '3FGL J1127.8+3618']
/Users/htajima/opt/anaconda3/envs/fermi-root/lib/python3.9/site-packages/scipy/interpolate/_fitpack2.py:298: UserWarning:
The maximal number of iterations maxit (set to 20 by the program)
allowed for finding a smoothing spline with fp=s has been reached: s
too small.
There is an approximation returned but the corresponding weighted sum
of squared residuals does not satisfy the condition abs(fp-s)/s < tol.
warnings.warn(message)
@grburgess, @hayalaso, The numpy 1.24 issue should have been fixed in fermipy version 1.2.0. Please use pip to install that version and try again.
FermiBottle needs to be updated to fermipy version 1.2 as well. Please open an issue at https://github.com/fermi-lat/FermiBottle/issues to encourage this.
thanks!
Tested and this works. Thanks again.
Describe the error I am using the FermiBottle docker with the preinstalled fermipy. I need to install a few additional packages including multinest which results in bumping numpy from 1.22 -> 1.24. This then makes it incompatible with numba and is thus downgraded to 1.23.
Before all of this, my analysis runs fine. But after the above numpy changes (the only ones that I can see have an effect) I get the following error:
It is odd that this would be related to the bumpy version... and the operation looks completely valid.
NOTE: This is for errors in fermipy and not for questions about data analysis or issues with fermitools.
To Reproduce
After pulling fermi bottle and activating the fermi condo env:
1) conda install multinest pymultinest numba. (this is required so that all versions are consistent... though it makes no sense from the requirements of the packages)
I am using Fermipy through 3ML, an example script would be:
Expected behavior
Everything works fine BEFORE the installation of other packages which results in a change in numpy 1.22 -> 1.23
Log files
Above
Environment (please complete the following information):
fermipy: v1.1.1 fermibottle::latest fermitools has no .version but I assume it is what is pulled in the fermibottle