ranieremenezes/easyfermi

Regarding errors

Closed this issue · 1 comments

hello

I have install fermitools , fermipy and easyfermi in my machine. Getting errors when I try to run the easyfermi.

(fermi2) ajaysharma@ajays-MacBook-Air New_work % python
Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 05:57:50)
[Clang 11.1.0 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import easyFermi
Coords checked!
Energy checked!
/opt/anaconda3/envs/fermi2/lib/python3.7/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])
/opt/anaconda3/envs/fermi2/lib/python3.7/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
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 54955.655266 from DATE-OBS.
Set MJD-END to 55047.655255 from DATE-END'. [astropy.wcs.wcs]
WARNING: AstropyDeprecationWarning: "clobber" was deprecated in version 2.0 and will be removed in a future version. Use argument "overwrite" instead. [easyFermi.easyFermi]
Joint fit ['galdiff', 'isodiff', '4FGL J0721.9+7120', '4FGL J0841.3+7053', '4FGL J0814.6+6430']
/opt/anaconda3/envs/fermi2/lib/python3.7/site-packages/scipy/interpolate/fitpack2.py:253: 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)
Drm_Cache::update Measured counts < 0 4FGL J0730.1+6852 27 -2.95273e-11 6.06827e-11
0.00350776 0.00961337 0.0218708 0.0423171 0.0716814 0.106622 0.139232 0.161364 0.166147 0.150242 0.119101 0.0831929 0.0513144 0.0281947 0.0139389 0.00623288 0.00247622 0.000879918 0.000279614 7.98433e-05 2.05352e-05 4.705e-06 9.55619e-07 1.73063e-07 2.80135e-08 4.05271e-09 5.24237e-10 6.06827e-11
Fitting shape 4FGL J0721.9+7120 TS: 3015.786
Fitting shape galdiff TS: 1550.076
Fitting shape isodiff TS: 321.785
Fitting shape 4FGL J0814.6+6430 TS: 136.547
Fitting shape 4FGL J0706.8+7742 TS: 64.221
Fitting shape 4FGL J0805.4+7534 TS: 59.687
Fitting shape 4FGL J0744.1+7434 TS: 38.574
Fitting shape 4FGL J0841.3+7053 TS: 36.941
2022-04-20 17:39:04 WARNING GTAnalysis.tsmap(): Saving TS maps in .npy files is disabled b/c of incompatibilities in python3, remove the maps from the /Users/ajaysharma/Downloads/New_work/sourcefind_00_pointsource_powerlaw_2.00_tsmap.npy
2022-04-20 17:39:44 WARNING GTAnalysis.tsmap(): Saving TS maps in .npy files is disabled b/c of incompatibilities in python3, remove the maps from the /Users/ajaysharma/Downloads/New_work/sourcefind_01_pointsource_powerlaw_2.00_tsmap.npy
2022-04-20 17:40:25 WARNING GTAnalysis.tsmap(): Saving TS maps in .npy files is disabled b/c of incompatibilities in python3, remove the maps from the /Users/ajaysharma/Downloads/New_work/sourcefind_02_pointsource_powerlaw_2.00_tsmap.npy
2022-04-20 17:40:46 WARNING GTAnalysis.tsmap(): Saving TS maps in .npy files is disabled b/c of incompatibilities in python3, remove the maps from the /Users/ajaysharma/Downloads/New_work/sourcefind_03_pointsource_powerlaw_2.00_tsmap.npy
/opt/anaconda3/envs/fermi2/lib/python3.7/site-packages/scipy/interpolate/fitpack2.py:253: 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)
Traceback (most recent call last):
File "/opt/anaconda3/envs/fermi2/lib/python3.7/site-packages/astropy/table/table.py", line 3039, in insert_row
newcol = col.insert(index, val, axis=0)
File "/opt/anaconda3/envs/fermi2/lib/python3.7/site-packages/astropy/table/column.py", line 1202, in insert
self_for_insert = _expand_string_array_for_values(self, values)
File "/opt/anaconda3/envs/fermi2/lib/python3.7/site-packages/astropy/table/column.py", line 137, in _expand_string_array_for_values
values_str_len = np.char.str_len(values).max()
File "<array_function internals>", line 6, in str_len
File "/opt/anaconda3/envs/fermi2/lib/python3.7/site-packages/numpy/core/defchararray.py", line 283, in str_len
return vec_string(a, int, 'len')
TypeError: string operation on non-string array

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/anaconda3/envs/fermi2/lib/python3.7/site-packages/easyFermi/easyFermi.py", line 58, in run_gtsetup
ui.analysisBasics()
File "/opt/anaconda3/envs/fermi2/lib/python3.7/site-packages/easyFermi/easyFermi.py", line 1605, in analysisBasics
self.gta.write_roi(self.OutputDir+'Results',make_plots=True)
File "/opt/anaconda3/envs/fermi2/lib/python3.7/site-packages/fermipy/gtanalysis.py", line 3722, in write_roi
self.write_fits(fitsfile)
File "/opt/anaconda3/envs/fermi2/lib/python3.7/site-packages/fermipy/gtanalysis.py", line 3760, in write_fits
tab = self.roi.create_table()
File "/opt/anaconda3/envs/fermi2/lib/python3.7/site-packages/fermipy/roi_model.py", line 2224, in create_table
s.add_to_table(tab)
File "/opt/anaconda3/envs/fermi2/lib/python3.7/site-packages/fermipy/roi_model.py", line 522, in add_to_table
tab.add_row(row)
File "/opt/anaconda3/envs/fermi2/lib/python3.7/site-packages/astropy/table/table.py", line 2931, in add_row
self.insert_row(len(self), vals, mask)
File "/opt/anaconda3/envs/fermi2/lib/python3.7/site-packages/astropy/table/table.py", line 3063, in insert_row
.format(name, err))
ValueError: Unable to insert row because of exception in column 'Spatial_Filename':
string operation on non-string array
zsh: abort python
(fermi2) ajaysharma@ajays-MacBook-Air New_work %

how can I resolve this problem.
error.txt

Dear @ajaykhoj

Could you please open the fermi environment on conda and do:
$ python

from fermipy.gtanalysis import GTAnalysis

I think your problem is with the installation of the fermitools or fermipy. If the command above doesn't work, then fermipy/fermitools are not properly installed and I recommend you to reinstall both of them (you can follow the steps here on easyFermi github webpage).

By the way, since you are using a MacBook, maybe the problem is with the version of Xcode that you are using. The fermitools only work with Xcode 13.0 or less. Please take a look at which version of Xcode you are using.

easyFermi can only run properly if the fermitools and fermipy are correctly installed. Please let me know if you have any more troubles. If your problem is indeed related to the installation of fermipy and fermitools, I recommend you to also take a look here: https://github.com/fermiPy/fermipy and here: https://github.com/fermi-lat/Fermitools-conda