IMCtermite
IMCtermite copied to clipboard
Can't open .raw file in Ubuntu, but in Windows works.
Hi there,
In Windows the following code snippet works without any error:
import IMCtermite
def main():
imcraw = IMCtermite.imctermite(b"/export/home/scratch/P31424_500h.raw")
if __name__ == '__main__':
main()
However in Ubuntu, I get the following error:
Traceback (most recent call last):
File "/local/user/toolsr64/linux64_u22_python310/usr/local/lib/python3.10/pdb.py", line 1732, in main
pdb._runscript(mainpyfile)
File "/local/user/toolsr64/linux64_u22_python310/usr/local/lib/python3.10/pdb.py", line 1592, in _runscript
self.run(statement)
File "/local/user/toolsr64/linux64_u22_python310/usr/local/lib/python3.10/bdb.py", line 597, in run
exec(cmd, globals, locals)
File "<string>", line 1, in <module>
File "/csem/divr/users/tbe/repo/3dmoco/test.py", line 9, in <module>
main()
File "/csem/divr/users/tbe/repo/3dmoco/test.py", line 4, in main
imcraw = IMCtermite.imctermite(b"/export/home/scratch/P31424_500h.raw")
File "IMCtermite.pyx", line 26, in IMCtermite.imctermite.__cinit__
RuntimeError: size mismatch between subbuffer (208004) and datatype (52001*8)
Do you have any idea about the issue?
Hi @TommasoBendinelli,
do you actually get correct or reasonable result on Windows? I suspect Windows to simply swallow and hide the error message. The issue originates from a apparent mismatch between the size of the data buffer and the inferred datatype size times the channel length. Can you tell what datatype(s) you expect? Anyway, if you were able to share some exemplary sample of the ".raw" file you are trying to read, it would be extremely helpful in order to fix this.
Best regards
I checked on Windows, and it seems to be working fine. I do get data (i.e. chnydata = channelsdata[0]['ydata'] returns values).
Unfortunately, It's confidential file and I can't share it here. However I will be more than happy to run any code snippet that would be useful for debugging on my Windows or Ubuntu machine
Hi,
I found the same issue, for me I just had to change the commenting from __arm__
to __i386__
in lib/imc_datatype.hpp
like this:
// e.g. ARM Cortex-A72 armv7l gcc version 10.2.0 (Ubuntu 10.2.0-13ubuntu1)
// #ifdef __arm__
// typedef unsigned long int imc_Ulongint;
// typedef signed long int imc_Slongint;
// e.g. Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz x86_64 gcc version 10.2.0 (Ubuntu 10.2.0-13ubuntu1)
// #ifdef i386 __i386 __i386__
typedef unsigned int imc_Ulongint;
typedef signed int imc_Slongint;
Maybe it helps someone in the future.