index_pats#
- EBSDIndexer.index_pats(patsin=None, patstart=0, npats=-1, xyloc=None, clparams=None, PC=None, verbose=0, chunksize=512)[source]#
Index EBSD patterns.
- Parameters:
- patsin
numpy.ndarray
,optional
EBSD patterns in an array of shape (n points, n pattern rows, n pattern columns). If not given, these are read from
self.filename
.- patstart
int
,optional
Starting index of the patterns to index. Default is
0
.- npats
int
,optional
Number of patterns to index. Default is
-1
, which will index up to the final pattern inpatsin
.- clparams
list
,optional
OpenCL parameters passed to
pyopencl
.- PC
list
,optional
Pattern center (PC) parameters (PCx, PCy, PCz) in the vendor convention. For EDAX TSL, this is (x*, y*, z*), defined in fractions of pattern width with respect to the lower left corner of the detector. If not given, this is read from
self.PC
. Ifvendor
is"EMSOFT"
, the PC must be four numbers, the final number being the pixel size.- verbose
int
,optional
0 - no output (default), 1 - timings, 2 - timings and the Radon transform of the first pattern with detected bands highlighted.
- chunksize
int
,optional
Default is 512.
- patsin
- Returns:
- indxData
numpy.ndarray
Structured numpy array, that is [nphases + 1, npoints]. The data is stored for each phase used in indexing and the
indxData[-1]
layer uses the best guess on which is the most likely phase, based on the fit, and number of bands matched for each phase. Each data entry contains the orientation expressed as a quaternion (‘quat’) (using the convention ofvendor
orindexer.vendor
), Pattern Quality (‘pq’), Confidence Metric (‘cm’), Phase ID (‘phase’), Fit (‘fit’) and Number of Bands Matched (‘nmatch’). There are some other metrics reported, but these are mostly for debugging purposes. The number and order of fields are not guaranteed to remain the same, but fields listed here are stable. (phase) parameter will be set to -1 for any no-solution point.- bandData
numpy.ndarray
Band identification data from the Radon transform. Stored as a structured numpy array, of dimensions [npoints, nbands].
- With fields that include:
id: band ID
max: peak max intesensity (used to calculate pattern quality)
maxloc: nearest integer location of the Radon peak
avemax: nearest neighbor average of the max peak intensity
aveloc: sub-pixel location of the Radon peak
width: a metric of the band width
theta: the theta value of the sub-pixel location on the Radon (lower-left origin)
rho: the rho value of the sub-pixel location on the Radon (lower-left origin)
valid: was the peak detected
band_match_index: index for phase number and pole number that indexed to this band (use
getmatchedpole()
)
- patstart
int
Starting index of the indexed patterns.
- npats
int
Number of patterns indexed. This and patstart are useful for the distributed indexing procedures.
- indxData