kikuchipy icon indicating copy to clipboard operation
kikuchipy copied to clipboard

Reading of master patterns generated with EDAX

Open hakonanes opened this issue 1 year ago • 4 comments

I've received a master pattern file generated with EDAX OIM Matrix from a colleague. It's a binary file with file extension .oem of 157.3 MB (157 286 400 bytes). I know nothing of the contents of the file, but I assume it contains master patterns of nickel, possibly for more than one beam energy. Thus, I cannot create a reader for it for kikuchipy at the moment.

@IMBalENce, you have access to EDAX OIM Matrix, right? Are you familiar with .oem files and their contents?

I'll leave this issue open if anyone with more information on this file format stumbles upon kikuchipy.

hakonanes avatar Nov 08 '23 12:11 hakonanes

@hakonanes Yes, we do have EDAX OIM Matrix. But I have not used the .oem format yet. I'll take a look to see if I can find any clue.

IMBalENce avatar Nov 16 '23 22:11 IMBalENce

Hm, I remember you saying that they are stored as HDF5 files identical to EMsoft's HDF5 files, right?

hakonanes avatar Nov 17 '23 07:11 hakonanes

Just confirmed .oem format is actually a hdf5 compatible format, I can use the HDFview package to browser the data structure.

And h5py also works:

import h5py as h5

with h5.File(file) as oem:
    print(oem.keys())

<KeysViewHDF5 ['CrystalData', 'EMData', 'EMheader', 'ExperimentalPatterns', 'NMLparameters']>

I have been using the hdf5 master pattern generated from EMsoft in OIM Matrix without any issue, but have not generate any in OIM yet. Based on facts that OIM Matrix seems can get confused by the EMsoft document/.config/EMsoftConfig.json file, and there are several files in the OIM bin folder resemble the EMsoft equivalent files. There is a good chance that OIM Matrix is simply accessing the EMsoft modules through Fortran wrapper. So file format should be the same.

IMBalENce avatar Nov 19 '23 23:11 IMBalENce

Aha, thank you for checking! I should of course have checked this myself.

Unless EDAX makes any significant changes to the way they write master pattern HDF5 files compared to the EMsoft way, we should be able to include the "oem" extension in https://github.com/pyxem/kikuchipy/blob/243ec481f04c3b8b5de67e4d8662d4f5ddb766a0/kikuchipy/io/plugins/emsoft_ebsd_master_pattern.py#L39

hakonanes avatar Nov 23 '23 12:11 hakonanes