orientation_similarity_map#
- kikuchipy.indexing.orientation_similarity_map(xmap: CrystalMap, n_best: int | None = None, simulation_indices_prop: str = 'simulation_indices', normalize: bool = False, from_n_best: int | None = None, footprint: ndarray | None = 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].
- Parameters:
- xmap
A crystal map with a ranked list of the array indices of the best matching simulated patterns among its properties.
- n_best
Number of ranked indices to compare. If not given (default), all indices are compared.
- simulation_indices_prop
Name of simulated indices array in the crystal maps’ properties. Default is
"simulation_indices"
.- normalize
Whether to normalize the number of equal indices to the range [0, 1], by default
False
.- from_n_best
Return an OSM for each n in the range
[from_n_best, n_best]
. If not given (default), the OSM forn_best
indices is returned.- footprint
Boolean 2D array specifying which neighbouring points to compare lists with, by default the four nearest neighbours.
- center_index
Flat index of central navigation point in the truthy values of footprint, by default
2
.
- Returns:
osm
Orientation similarity map(s). If
from_n_best
is given, the returned array has three dimensions, wheren_best
is atosm[:, :, 0]
andfrom_n_best
atosm[:, :, -1]
.
Notes
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 toFalse
.