file_reader#

kikuchipy.io.plugins.edax_binary.file_reader(filename: str | Path, nav_shape: Tuple[int, int] | None = None, lazy: bool = False) List[dict][source]#

Read EBSD patterns from an EDAX binary UP1/2 file.

Not meant to be used directly; use load().

Parameters:
filename

File path to UP1/2 file with "up1" or "up2" extension.

nav_shape

Navigation shape, as (n map rows, n map columns), of the returned EBSD signal, matching the number of patterns in the file. If not given, this shape will be attempted to be determined from the file. If it could not be, the returned signal will have only one navigation dimension. If patterns were acquired in an hexagonal grid, the returned signal will have only one navigation dimension irrespective of this parameter’s value.

lazy

Read the data lazily without actually reading the data from disk until required. Default is False.

Returns:
scan

Data, axes, metadata and original metadata.

Raises:
ValueError

If file version is 2, since only version 1 or >= 3 is supported.

ValueError

If nav_shape does not match the number of patterns in the file.

Warns:
UserWarning

If patterns were acquired in an hexagonal grid, since then the returned signal will have only one navigation dimension, even though nav_shape is given.

Notes

Reader adapted from the EDAX UP1/2 reader in PyEBSDIndex.