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

imod file with unrecognized machine stamp #47

Closed
jdeschamps opened this issue Oct 18, 2022 · 2 comments
Closed

imod file with unrecognized machine stamp #47

jdeschamps opened this issue Oct 18, 2022 · 2 comments

Comments

@jdeschamps
Copy link

jdeschamps commented Oct 18, 2022

Hi,

Using mrcfile==1.4.3 and attempting to read a file exported from imod, i get the following warning:

with mrcfile.open('21.mrc', 'r', header_only=True, permissive=True) as mrc:
     print(mrc.header)

/home/user/miniconda3/envs/blik/lib/python3.9/site-packages/mrcfile/mrcinterpreter.py:219: 
RuntimeWarning: Unrecognised machine stamp: 0x44 0x20 0x20 0x20
  warnings.warn(str(err), RuntimeWarning)
(1024, 1024, 512, 2, 0, 0, 0, 1024, 1024, 512, (1024., 1024., 512.), (90., 90., 90.), 1, 2, 3, -995.9688, 480.2282, -2.2351742e-07,
 0, 0, b'\x00\x00\x00\x00\x00\x00\x00\x00', b'', 0, b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', (0., 0., 0.), b'MAP ', [68, 32, 32, 32], -1., 0, [b'', b'', b'', b'', b'', b'', b'', b'', 
b'', b''])

Without permissive=True this would lead to an error.

The file is from a collaborator, so I don't know whether some export options are responsible for this behaviour. If that's of any interest to the project, I can investigate!

edit: I must warn that I never worked with mrc files before, so I might just not be aware of obvious things to do when saving files in imod. :)

@colinpalmer
Copy link
Member

Hi, thanks for the report, but I think this is an issue for IMOD rather than mrcfile. It looks like the file genuinely does have an incorrect machine stamp (which is a code written to the file header to tell other software how it should read the data in the file). This is definitely a mistake, sometimes the machine stamp can vary but this one is invalid. Normally files from IMOD are fine so this is unusual, but beyond that I can't say why it might have happened. I'd suggest reporting the problem to the IMOD developers.

@jdeschamps
Copy link
Author

Alright! Thanks for the swift answer!

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