Error importing .mib data
@taramatsci is already working on this.
Since Jun 8, 2023.
- Dominant language
- Python
- Stars
- 279
- Forks
- 177
- PR merge metrics
- No merged PRs in 30d
Description
With Python 3.19.6 and py4DSTEM 0.13.17
Hi, I was using py4DSTEM.io.import_file to load .mib files. When importing data acquired from a single chip (256X256 in the diffraction plane), that works very well.
Then I want to import a .mib file acquired from combined 4 chips (514X514 in the diffraction plane), and it comes to an error like this:
KeyError Traceback (most recent call last)
Cell In[5], line 3
-> 3 dataset_vac = py4DSTEM.io.import_file(filepath = vac_file_path, scan = (300,301))
File ~\anaconda3\envs\yining4dstem\lib\site-packages\py4DSTEM\io\import_file.py:75, in import_file(filepath, mem, binfactor, filetype, **kwargs)
72 # elif filetype == "kitware_counted":
73 # data = read_kitware_counted(filepath, mem, binfactor, metadata=metadata, **kwargs)
74 elif filetype == "mib":
-> 75 data = load_mib(filepath, mem=mem, binfactor=binfactor,**kwargs)
76 else:
77 raise Exception("Bad filetype!")
File ~\anaconda3\envs\yining4dstem\lib\site-packages\py4DSTEM\io\nonnative\read_mib.py:28, in load_mib(file_path, mem, binfactor, reshape, flip, scan, **kwargs)
26 # Get scan info from kwargs
27 header = parse_hdr(file_path)
-> 28 width = header["width"]
29 height = header["height"]
30 width_height = width * height
KeyError: 'width'
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.