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

Unpacking error: error('unpack requires a buffer of 4 bytes',) #23

Open
JianYugen opened this issue Sep 10, 2021 · 4 comments
Open

Unpacking error: error('unpack requires a buffer of 4 bytes',) #23

JianYugen opened this issue Sep 10, 2021 · 4 comments

Comments

@JianYugen
Copy link

JianYugen commented Sep 10, 2021

Hi. I've met an issue recently when using OOMMFDecode to convert .ovf files into MATLAB data files. The program runs correctly for vector files in most cases. But when it comes to some scalar files, there arises error message as below:

Data indicator: # Begin: Data Binary 4
Little-endian 4-byte detected.
unpack requires a buffer of 4 bytes
Traceback (most recent call last):
  File "D:\OOMMFTools\oommftools\user_interfaces\gui\oommfdecode.py", line 216, in OnDropFiles
    maximum=len(oommf)))
  File "D:\OOMMFTools\oommftools\user_interfaces\gui\oommfdecode.py", line 243, in groupUnpack
    return (decodedArrays, headers, extraData)
UnboundLocalError: local variable 'decodedArrays' referenced before assignment

error

In OOMMF, the relevant quantities of scalar files are saved in the X coordinate, so they are still vectors in fact. Actually I can check scalar files through other ways, and I'm just wondering what goes wrong. Thanks.

@deparkes
Copy link
Owner

Hi, Would you be able to share an example of a file that causes this error?

@JianYugen
Copy link
Author

There's a file output by mumax3 (mumax3 is a GPU-accelerated micromagnetic simulation program). It saved the temperature distribution of the system, where I defined a thermal gradient (300-500K) along the X direction. Fig.1 shows what it views in OOMMF. Fig.2 is the bitmap file converted by OOMMFConvert.

example.zip

@deparkes
Copy link
Owner

deparkes commented Oct 1, 2021

Thanks, I can recreate the error now. I'll see if I can find and fix the problem, but I'm glad you're able to check the scalar files in other ways in case I can't fix it!

@JianYugen
Copy link
Author

Good luck! MATLAB data files would be always easier for me to analyse.

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

2 participants