I have an hdf5 format file loaded into SMAK and can see channels on the left of the main SMAK window. I have loaded the corresponding MCA file for the data and have checked off "view MCA" in the Image Display window so that when I double-click a pixel in the image i can see the MCA for that position (everything looks good so far, no errors in the terminal window). When I click the [View Config] button in the MCA SPectrum View window I get the default list of peaks, some of which I would like to tweak (add some and remove some). Nevertheless, if I try leaving all the parameters as-is (ensuring the incident energy is set correctly), I get the following pop-up error message:
Error: 1
OSError Exception in Tk callback
Function: <bound method Main.MCAfitAlldata of <__main__.Main object at 0x000002316BEB5810>> (type: <class 'method'>)
Args: ()
Traceback (innermost last):
File "C:\Users\andre\.conda\envs\smakenv\lib\site-packages\Pmw\Pmw_2_1_1\lib\PmwBase.py", line 1761, in call
return self.func(*args)
File "C:\Users\andre\.conda\envs\smakenv\Lib\site-packages\smak\smak.py", line 4181, in MCAfitAlldata
self.MCAfitdata(False)
File "C:\Users\andre\.conda\envs\smakenv\Lib\site-packages\smak\smak.py", line 4376, in MCAfitdata
mcaWrap=pyMcaFitWrapper.Wrapper(pkm=cf)
File "C:\Users\andre\.conda\envs\smakenv\Lib\site-packages\smak\pyMcaFitWrapper.py", line 56, in init
self.mcafit = MCAT.McaTheory(initdict=pkm,maxiter=maxiter,sumflag=sumflag,
File "C:\Users\andre\.conda\envs\smakenv\lib\site-packages\PyMca5\PyMcaPhysics\xrf\ClassMcaTheory.py", line 82, in init
raise IOError("File %s does not exist" % initdict)
OSError: File C:\Users\andre\.conda\envs\smakenv\Lib\site-packages\smakpyMcaConfigs\defaultPyMCAConfig.cfg does not exist
Alternatively, if I first try to modify the list of peaks, such as by highlighting one of them (i.e. "Mn_K") and clicking the [Clear Selected] button at the bottom of the window I get the following pop-up error message:
Error: 16
KeyError Exception in Tk callback
Function: <bound method PyMcaParameterDialog.clearCurPeakLine of <pyMcaParamGUI.PyMcaParameterDialog object at 0x000002137B31E4D0>> (type: <class 'method'>)
Args: ()
Traceback (innermost last):
File "C:\Users\andre\.conda\envs\smakenv\lib\site-packages\Pmw\Pmw_2_1_1\lib\PmwBase.py", line 1761, in call
return self.func(*args)
File "C:\Users\andre\.conda\envs\smakenv\Lib\site-packages\smak\pyMcaParamGUI.py", line 1278, in clearCurPeakLine
self.atomDict[el][1]=2
KeyError: 'S_K'
It does appear as though the Mn K has been removed from the list and if I have my correct incident energy entered and go backl to the MCA SPectrum View window I can click [Fit Current] and I get an appropriate-looking fit, however, if I then click [Fit All MCA] I get the following error message:
Error: 17
FileNotFoundError Exception in Tk callback
Function: <bound method Main.MCAfitAlldata of <__main__.Main object at 0x000002137C245810>> (type: <class 'method'>)
Args: ()
Traceback (innermost last):
File "C:\Users\andre\.conda\envs\smakenv\lib\site-packages\Pmw\Pmw_2_1_1\lib\PmwBase.py", line 1761, in call
return self.func(*args)
File "C:\Users\andre\.conda\envs\smakenv\Lib\site-packages\smak\smak.py", line 4181, in MCAfitAlldata
self.MCAfitdata(False)
File "C:\Users\andre\.conda\envs\smakenv\Lib\site-packages\smak\smak.py", line 4241, in MCAfitdata
self.pyMCAparamDialog.saveConfiguration(cf)
File "C:\Users\andre\.conda\envs\smakenv\Lib\site-packages\smak\pyMcaParamGUI.py", line 1150, in saveConfiguration
self.parameters.write(self.configFile)
File "C:\Users\andre\.conda\envs\smakenv\lib\site-packages\PyMca5\PyMcaIO\ConfigDict.py", line 237, in write
with open(filename, "w") as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\andre\\.conda\\envs\\smakenv\\Lib\\site-packages\\smakpyMcaConfigs\\activePyMCAConfig.cfg'
Not sure where to go from here, but this has been reproduced on two different Windows 10 PCs with SMAK 3.0.8
Permissions for the directory where the data as well as where smak is installed, are not set to read-only. My user account is set to Administrator and have full read/write priviliges to these files and folders.
Thanks for any suggestions!
Can you check your version? I found this error earlier, and its a "silly" one where its missing a \ in the code --
C:\Users\andre\.conda\envs\smakenv\Lib\site-packages\smakpyMcaConfigs\defaultPyMCAConfig.cfg
should really be
C:\Users\andre\.conda\envs\smakenv\Lib\site-packages\smak\pyMcaConfigs\defaultPyMCAConfig.cfg
I think this should be fixed in the latest (3.0.8)? If you are current, let me know and (1) I'll make sure the fix gets in the correct place, and (2) let you know where to edit to code for immediate relief!
S