Closed hakonanes closed 2 hours ago
For loading "Unprocessed Patterns" from .h5oina files, it probably also makes sense that the static BG is also loaded from the file. I'm not sure if this is currently done already...
The static background is loaded
and available in the property EBSD.static_background. This is also mentioned in the IO user guide.
@Tijmenvermeij, I made a fix for the processed/unprocessed patterns from H5OINA in https://github.com/hakonanes/kikuchipy/tree/692-h5oina-un-processed-patterns and #702.
Could you try it out? python -m pip install kikuchipy@git+https://github.com/hakonanes/kikuchipy.git@692-h5oina-un-processed-patterns
Should be fixed in #702.
Sorry for the spam, but I solved this issue, at least temporarily. I found the line that specifies that the pattern dataset should not be read into memory (I think), and added "Unprocessed Patterns" to it. I changed line 99 in oxford_h5ebsd.py to the following:
dd = _hdf5group2dict(group["EBSD/Data"], data_dset_names=[self.patterns_name, "Unprocessed Patterns"])
This solves the issue for me. Perhaps this is not a suitable permanent solution though. I guess the user would need to have the option to import unprocessed patterns, if they like, instead of processed patterns...Originally posted by @Tijmenvermeij in https://github.com/pyxem/kikuchipy/issues/690#issuecomment-2405719172
I did not think about H5OINA files storing both processed and unprocessed patterns when writing the reader. Thank you for spotting the bug, @Tijmenvermeij!
The solution is, as you say, to give the user the opportunity to load either of them (or both, if they load consecutively). The other, if present, should not be read into memory.
We should look at releasing a ~v0.11.0~ 0.12.0 within the next couple weeks with these changes.