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:
patsinnumpy.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.

patstartint, optional

Starting index of the patterns to index. Default is 0.

npatsint, optional

Number of patterns to index. Default is -1, which will index up to the final pattern in patsin.

clparamslist, optional

OpenCL parameters passed to pyopencl.

PClist, 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. If vendor is "EMSOFT", the PC must be four numbers, the final number being the pixel size.

verboseint, optional

0 - no output (default), 1 - timings, 2 - timings and the Radon transform of the first pattern with detected bands highlighted.

chunksizeint, optional

Default is 512.

Returns:
indxDatanumpy.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 of vendor or indexer.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.

bandDatanumpy.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())

patstartint

Starting index of the indexed patterns.

npatsint

Number of patterns indexed. This and patstart are useful for the distributed indexing procedures.