kikuchipy.indexing.orientation_similarity_map(xmap: CrystalMap, n_best: Optional[int] = None, simulation_indices_prop: str = 'simulation_indices', normalize: bool = False, from_n_best: Optional[int] = None, footprint: Optional[ndarray] = None, center_index: int = 2) ndarray[source]#

Compute an orientation similarity map (OSM) where the ranked list of the dictionary indices of the best matching simulated patterns in one point is compared to the corresponding lists in the nearest neighbour points [Marquardt et al., 2017].


A crystal map with a ranked list of the array indices of the best matching simulated patterns among its properties.


Number of ranked indices to compare. If not given (default), all indices are compared.


Name of simulated indices array in the crystal maps’ properties. Default is "simulation_indices".


Whether to normalize the number of equal indices to the range [0, 1], by default False.


Return an OSM for each n in the range [from_n_best, n_best]. If not given (default), the OSM for n_best indices is returned.


Boolean 2D array specifying which neighbouring points to compare lists with, by default the four nearest neighbours.


Flat index of central navigation point in the truthy values of footprint, by default 2.


Orientation similarity map(s). If from_n_best is given, the returned array has three dimensions, where n_best is at osm[:, :, 0] and from_n_best at osm[:, :, -1].


If the set \(S_{r,c}\) is the ranked list of best matching indices for a given point \((r,c)\), then the orientation similarity index \(\eta_{r,c}\) is the average value of the cardinalities (#) of the intersections with the neighbouring sets

\[\eta_{r,c} = \frac{1}{4} \left( \#(S_{r,c} \cap S_{r-1,c}) + \#(S_{r,c} \cap S_{r+1,c}) + \#(S_{r,c} \cap S_{r,c-1}) + \#(S_{r,c} \cap S_{r,c+1}) \right).\]

Changed in version 0.5: Default value of normalize changed to False.