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:
- 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
filename
.- filename
str
,optional
Name of file with EBSD patterns. If not given,
patsin
must be passed.- phaselist
list
of
str
,optional
Options are
"FCC"
and"BCC"
. Default is["FCC"]
.- vendor
str
,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"
.- PC
list
,optional
Pattern center (PCx, PCy, PCz) in the
indexer.vendor
orvendor
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). Ifvendor="EMSOFT"
, the PC must be four numbers, the final number being the pixel size.- sampleTilt
float
,optional
Sample tilt towards the detector in degrees. Default is 70 degrees. Unused if
ebsd_indexer_obj
is passed.- camElev
float
,optional
Camera elevation in degrees. Default is 5.3 degrees. Unused if
ebsd_indexer_obj
is passed.- bandDetectPlan
pyebsdindex.band_detect.BandDetect
,optional
Collection of parameters using in band detection. Unused if
ebsd_indexer_obj
is passed.- nRho
int
,optional
Default is 90 degrees. Unused if
ebsd_indexer_obj
is passed.- nTheta
int
,optional
Default is 180 degrees. Unused if
ebsd_indexer_obj
is passed.- tSigma
float
,optional
Unused if
ebsd_indexer_obj
is passed.- rSigma
float
,optional
Unused if
ebsd_indexer_obj
is passed.- rhoMaskFrac
float
,optional
Default is 0.1. Unused if
ebsd_indexer_obj
is passed.- nBands
int
,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
.- 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
.- return_indexer_objbool,
optional
Whether to return the EBSD indexer. Default is
False
.- ebsd_indexer_obj
EBSDIndexer
,optional
EBSD indexer. If not given, many of the above parameters must be passed. Otherwise, these parameters are retrieved from this indexer.
- clparams
list
,optional
OpenCL parameters passed to
pyopencl
if the package is installed.- 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 528.
- gpu_id
int
,optional
ID of GPU to use if
pyopencl
is installed.
- patsin
- Returns:
- indxData
numpy.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 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.- 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()
)
- indexer
EBSDIndexer
EBSD indexer, returned if
return_indexer_obj=True
.
- indxData