Closed quentin-sem closed 3 months ago
Quentin - Good question. The example for HDF5 is for any generic HDF5 file that stores their patterns in a dataset -- they only need to be laid out as (nPat, nY, nX) -- and is not vendor specific. There is support for reading HDF5 formats as a file (similar to the examples above for up1/2) from EmSoft/EDAX/Bruker/Oxford. However, this particular example shows how one can read from an unsupported HDF5 file (or if something breaks with the supported reader types I guess).
You are correct that the default for data collection for EDAX is to store the patterns in a up1/2 file with the ebsd data in either an .osc or HDF5 file (I forget what the extension is exactly). However, OIM analysis will output a datafile with patterns as an HDF5. Earlier in the tutorial, there are the examples for up1/2, and examples of how to read into a numpy/dask array, which is similar to the example for the generic HDF5. Hope this helps.
Hello Dave, Okay, generic format noted. I won't have any problem working with .up1 I think. I would have liked to work with exdaxh5 because it contains a lot of additional "easily accessible" information such as PC coordinates, phases used, and much more. I'll keep looking.
@quentin-sem h5py is really easy to work with, and writing a couple of dedicated functions for edaxh5 to yank the relevant info out of the file would not be hard. Not sure I will get to it quickly as it might be hard to make it useful for everyone's workflows (the edaxh5 can store multiple scans, with multiple names for the data groups ... makes it messy for a generic solution), but if you have a set workflow for your data, it should be relatively easy to extract that info.
Phases are the one thing that might be a bit tricky ... but not terribly hard. EDAX, I think, includes the space group for each phase using the same IUC numbering that PyEBSDIndex uses. I will note that PyEBSDIndex expects lattice parameters in nanometers.
Finally I will note, that kikuchipy integrates pyebsdindex for its non-dictionary indexing (Hough/Radon), and has many more of these types of helper functions built in.
Hi,
In the "Loading data from an HDF5 File" section of your tutorial, you include an example with:
"h5file = '/Path/to/hdf5/file.h5' f = h5py.File(h5file, 'r') # this is an HDF5 file type used by EDAX. h5pats = f['/Scan 1/EBSD/Data/Pattern'] # location of the pattern array within the HDF5 file. index the first 1000 h5data, h5bnddata, indxer=ebsd_index.index_pats(patsin = h5pats[0:1000,:,:], patstart = 0, npats = 1000,return_indexer_obj = True, backgroundSub = backgroundsub, nTheta = nT, nRho=nR, tSigma = tSig, rSigma = rSig,rhoMaskFrac=rhomask,nBands=nbands, \ phaselist = phaselist, PC = PC, verbose = 2)
now index them all
h5data, h5banddata = ebsd_index.index_pats_distributed(patsin = h5pats, ebsd_indexer_obj = indxer, ncpu = 28)"
But in the *.edaxh5 files, there are no patterns. The patterns are in the up1/2 files, right?
Maybe I'm missing something.
Thanks for your help.
Quentin