spe2py icon indicating copy to clipboard operation
spe2py copied to clipboard

Error When loading file

Open qyangcaltech opened this issue 7 years ago • 2 comments

Hi,

I got the following error for loading spe file generated by LightField6.7. Could you help me check what might be the problem? Thanks!

In [1]: import spe2py as spe

In [2]: loaded_files = spe.load()

ValueError Traceback (most recent call last) in () ----> 1 loaded_files = spe.load()

~\pyLabLib-dev\spe2py\spe2py.py in load(filepaths) 273 batch = [[] for _ in range(0, len(filepaths))] 274 for file in range(0, len(filepaths)): --> 275 batch[file] = SpeFile(filepaths[file]) 276 return_type = "list of SpeFile objects" 277 if len(batch) == 1:

~\pyLabLib-dev\spe2py\spe2py.py in init(self, filepath) 53 # Note: these methods depend on self.footer 54 self.xdim, self.ydim = self._get_dims() ---> 55 self.roi, self.nroi = self._get_roi_info() 56 self.wavelength = self._get_wavelength() 57

~\pyLabLib-dev\spe2py\spe2py.py in _get_roi_info(self) 148 else: 149 nroi = 1 --> 150 roi = np.array([regionofinterest]) 151 152 return roi, nroi

ValueError: cannot copy sequence with size 0 to array axis with dimension 1

qyangcaltech avatar Dec 12 '18 21:12 qyangcaltech

I encountered the same problem - I suspect that it may be due to the Windows version (the same code worked on a Windows 7 machine but not Windows 10 machine)

matthew-hsr avatar Sep 19 '19 23:09 matthew-hsr

Is there any resolution to this bug, or is this software just useless now?

elliewilliamson26 avatar Feb 05 '24 16:02 elliewilliamson26