Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't open .raw file in Ubuntu, but in Windows works. #27

Open
TommasoBendinelli opened this issue Aug 31, 2023 · 3 comments
Open

Can't open .raw file in Ubuntu, but in Windows works. #27

TommasoBendinelli opened this issue Aug 31, 2023 · 3 comments

Comments

@TommasoBendinelli
Copy link

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?

@mario-fink
Copy link
Collaborator

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

@TommasoBendinelli
Copy link
Author

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

@techolga
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants