index_pats#

pyebsdindex.ebsd_index.index_pats(patsin=None, filename=None, phaselist=['FCC'], vendor=None, PC=None, sampleTilt=70.0, camElev=5.3, bandDetectPlan=None, nRho=90, nTheta=180, tSigma=None, rSigma=None, rhoMaskFrac=0.1, nBands=9, backgroundSub=False, patstart=0, npats=-1, return_indexer_obj=False, ebsd_indexer_obj=None, clparams=None, verbose=0, chunksize=528, gpu_id=None)[source]#

Index EBSD patterns on a single thread.

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 filename.

filenamestr, optional

Name of file with EBSD patterns. If not given, patsin must be passed.

phaselistlist of str, optional

Options are "FCC" and "BCC". Default is ["FCC"].

vendorstr, optional

Which vendor convention to use for the pattern center (PC) and the returned orientations. The available options are "EDAX" (default), "BRUKER", "OXFORD", "EMSOFT", "KIKUCHIPY".

PClist, optional

Pattern center (PCx, PCy, PCz) in the indexer.vendor or 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 passed, this is set to (x*, y*, z*) = (0.471659, 0.675044, 0.630139). If vendor="EMSOFT", the PC must be four numbers, the final number being the pixel size.

sampleTiltfloat, optional

Sample tilt towards the detector in degrees. Default is 70 degrees. Unused if ebsd_indexer_obj is passed.

camElevfloat, optional

Camera elevation in degrees. Default is 5.3 degrees. Unused if ebsd_indexer_obj is passed.

bandDetectPlanpyebsdindex.band_detect.BandDetect, optional

Collection of parameters using in band detection. Unused if ebsd_indexer_obj is passed.

nRhoint, optional

Default is 90 degrees. Unused if ebsd_indexer_obj is passed.

nThetaint, optional

Default is 180 degrees. Unused if ebsd_indexer_obj is passed.

tSigmafloat, optional

Unused if ebsd_indexer_obj is passed.

rSigmafloat, optional

Unused if ebsd_indexer_obj is passed.

rhoMaskFracfloat, optional

Default is 0.1. Unused if ebsd_indexer_obj is passed.

nBandsint, optional

Number of detected bands to use in triplet voting. Default is 9. Unused if ebsd_indexer_obj is passed.

backgroundSubbool, optional

Whether to subtract a static background prior to indexing. Default is False.

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.

return_indexer_objbool, optional

Whether to return the EBSD indexer. Default is False.

ebsd_indexer_objEBSDIndexer, optional

EBSD indexer. If not given, many of the above parameters must be passed. Otherwise, these parameters are retrieved from this indexer.

clparamslist, optional

OpenCL parameters passed to pyopencl if the package is installed.

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 528.

gpu_idint, optional

ID of GPU to use if pyopencl is installed.

Returns:
indxDatanumpy.ndarray

Complex numpy array (or array of structured data), 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.

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

indexerEBSDIndexer

EBSD indexer, returned if return_indexer_obj=True.