You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running BXA 4.0.5, UltraNest 3.4.4, Python 3.8.13, Sherpa 4.14.0, on MacOS High Sierra 10.13.6.
I just installed BXA over the weekend and was trying out the xagnfitter.py script, but ran into an error early in the process. After setting up the environment as well as the input files (filenames.txt, the galNH and redshift files), and linking the model directory, I ran the script as directed using 'python xagnfitter.py'. The code crashed somewhere around the 'except' statement on line 262 of the script. Below I've included a partial log of the terminal output and the traceback.
Increasing parameters again...
3 parameters, aic=297.37
4 parameters, aic=297.45
5 parameters, aic=296.76
Final choice: 2 parameters, aic=295.52
Adding Gaussian#1
largest remaining discrepancy at 8.660keV[99], need 447 counts
placing gaussian at 8.66keV, with power 0.01026600881157122
Traceback (most recent call last):
File "xagnfitter.py", line 259, in <module>
bkg_model = CachedModel(get_bkg_model(id))
File "<string>", line 1, in get_bkg_model
File "/anaconda3/envs/ciao-4.14/lib/python3.8/site-packages/sherpa/astro/ui/utils.py", line 9374, in get_bkg_model
raise ModelErr('nobkg', bkg_id, id)
sherpa.utils.err.ModelErr: background model 1 for data set 1 has not been set
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "xagnfitter.py", line 265, in <module>
bkg_model = auto_background(id)
File "/anaconda3/envs/ciao-4.14/lib/python3.8/site-packages/bxa/sherpa/background/pca.py", line 416, in auto_background
bkgmodel.fit()
File "/anaconda3/envs/ciao-4.14/lib/python3.8/site-packages/bxa/sherpa/background/pca.py", line 385, in fit
g.Sigma.max = x[-1] - x[0]
File "/anaconda3/envs/ciao-4.14/lib/python3.8/site-packages/sherpa/utils/__init__.py", line 171, in __setattr__
object.__setattr__(self, name, val)
File "/anaconda3/envs/ciao-4.14/lib/python3.8/site-packages/sherpa/models/parameter.py", line 230, in _set_limit
raise ParameterErr('edge', self.fullname,
sherpa.utils.err.ParameterErr: parameter g_1_99.Sigma has a hard maximum of 20
I spoke to Peter Boorman about this, and he ran into the same issue described above with a separate set of data and bxa installation when diagnosing this issue. He discovered a workaround in the pca.py file (/anaconda3/envs/ciao-4.14/lib/python3.8/site-packages/bxa/sherpa/background/pca.py). Changing in pca.py the line:
seems to work for both of us and bypasses what appears to be a hard limit for the sigma maximum for the Gaussian model in Sherpa. After implementing the workaround, the xagnfitter.py script executes properly and produces the desired plots.
The text was updated successfully, but these errors were encountered:
x[-1] - x[0] is the difference between highest and lowest channel. That's the maximum width I wanted to allow. 20 channels may be narrow or wide, depending on the detector.
I think a more generic solution would be to set just above that line
I am running BXA 4.0.5, UltraNest 3.4.4, Python 3.8.13, Sherpa 4.14.0, on MacOS High Sierra 10.13.6.
I just installed BXA over the weekend and was trying out the xagnfitter.py script, but ran into an error early in the process. After setting up the environment as well as the input files (filenames.txt, the galNH and redshift files), and linking the model directory, I ran the script as directed using 'python xagnfitter.py'. The code crashed somewhere around the 'except' statement on line 262 of the script. Below I've included a partial log of the terminal output and the traceback.
I spoke to Peter Boorman about this, and he ran into the same issue described above with a separate set of data and bxa installation when diagnosing this issue. He discovered a workaround in the pca.py file (/anaconda3/envs/ciao-4.14/lib/python3.8/site-packages/bxa/sherpa/background/pca.py). Changing in pca.py the line:
g.Sigma.max = x[-1] - x[0]
to:
seems to work for both of us and bypasses what appears to be a hard limit for the sigma maximum for the Gaussian model in Sherpa. After implementing the workaround, the xagnfitter.py script executes properly and produces the desired plots.
The text was updated successfully, but these errors were encountered: