merge_crystal_maps#

kikuchipy.indexing.merge_crystal_maps(crystal_maps: List[CrystalMap], mean_n_best: int = 1, greater_is_better: Optional[int] = None, scores_prop: str = 'scores', simulation_indices_prop: Optional[str] = None) CrystalMap[source]#

Merge a list of at least two single phase CrystalMap with a 1D or 2D navigation shape into one multi phase map.

It is required that all maps have the same number of rotations and scores (and simulation indices if applicable) per point.

Parameters:
crystal_maps

A list of crystal maps with simulated indices and scores among their properties.

mean_n_best

Number of best metric results to take the mean of before comparing. Default is 1. If given with a negative sign and greater_is_better is not given, the n lowest valued metric results are chosen.

greater_is_better

True if a higher score means a better match. If not given, the sign of mean_n_best is used, with a positive sign meaning True.

scores_prop

Name of scores array in the crystal maps’ properties. Default is "scores".

simulation_indices_prop

Name of simulated indices array in the crystal maps’ properties. If not given (default), the merged crystal map will not contain an array of merged simulation indices from the input crystal maps’ properties. If a string, there must be as many simulation indices per point as there are scores.

Returns:
merged_xmap

A crystal map where the rotation of the phase with the best matching score(s) is assigned to each point. The best matching scores, merge sorted, are added to its properties with a name equal to whatever passed to scores_prop with “merged” as a suffix. If simulation_indices_prop is passed, the best matching simulation indices are added in the same way as the scores.

Notes

Changed in version 0.5: The greater_is_better parameter replaced metric.