Closed jablevin closed 3 years ago
There is definitely a python bug, but I'm not sure to remember correctly how the rawSpectrum is encoded to correct it and beeing sure that the data you get make sense.... I guess you should predefine li before the while. So add
li=[]
at line 1050
Can you test it with your data and tell me if the results make sens?
Can I get some feedback? Does this solution works?
Hello. I have a similar error when I try to run the following cell from the "Introduction to pySPM a python library for ToF-SIMS data analysis": AI = pySPM.ITM(get_data("Cysteine_B3p_p_01.itm")) sf, k0 = A.auto_mass_cal() try:
res = pySPM.utils.load("Intro_pySPM_tofsims", 'Cysteine_ROI')
except: res = AI.get_raw_spectrum(ROI=[ROI1, ROI2], prog=True, sf=sf, k0=k0) pySPM.utils.save("Intro_pySPM_tofsims", Cysteine_ROI=res)
The error is:
OSError Traceback (most recent call last)
and? did you try the proposed solution? Does it work?
Yes. I did what you suggested before and it worked. Thank you!
OK. I'll add it for next release then. Thank you for the feedback.
When running >>> res = AI.get_raw_spectrum(ROI=[ROI1, ROI2], prog=True, sf=sf, k0=k0) I get the error that local variable "li" is referenced before assignment.
The code from the file is below. The error arises near the end "for k in li"