bennomeier / leCroyParser

A Python Module to parse LeCroy Binary Trace Files
MIT License
12 stars 8 forks source link

buffer error #16

Open rde-girl opened 3 months ago

rde-girl commented 3 months ago

Hello, I took some data with my scope, but I'm getting an error that I've never gotten before on some of the data sets although they were taken on the same day and nothing was changed on the data acquisition side with the scope. File sizes are the same. I run the command: data = lecroyparser.ScopeData(path, parseAll = True) Would you know what is giving me the error?

File ~.conda\envs\radis_py38\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec exec(code, globals, locals)

File c:\users\onedrive\documents\hapi\post_processing.py:68 data = lecroyparser.ScopeData(path, parseAll = True)

File ~.conda\envs\radis_py38\lib\site-packages\lecroyparser__init.py:52 in init__ x, y = self.parseFile(f, sparse=sparse)

File ~.conda\envs\radis_py38\lib\site-packages\lecroyparser__init__.py:77 in parseFile return self.parseData(data=fileContent, sparse=sparse)

File ~.conda\envs\radis_py38\lib\site-packages\lecroyparser__init__.py:137 in parseData y = np.frombuffer(self.data[start:start + self.waveArray1], dtype=np.dtype((self.endianness + "i2", length)), count=1)[0]

ValueError: buffer is smaller than requested size`

bennomeier commented 2 months ago

Hi, this error says that the length of data in the buffer is not as long as expected. Can you check whether the file you are trying to parse has approximately the right size? Alternatively, if you can share the file, I can try to parse it and see where the problem is.