optimize#
- pyebsdindex.pcopt.optimize(pats, indexer, PC0=None, batch=False)[source]#
Optimize pattern center (PC) (PCx, PCy, PCz) in the convention of the
indexer.vendorwith Nelder-Mead.- Parameters:
- pats
numpy.ndarray EBSD pattern(s), of shape
(n detector rows, n detector columns), or(n patterns, n detector rows, n detector columns).- indexer
pyebsdindex.ebsd_index.EBSDIndexer EBSD indexer instance storing all relevant parameters for band detection.
- PC0
list,optional Initial guess of PC. If not given,
indexer.PCis used. Ifindexer.vendoris"EMSOFT", the PC must be four numbers, the final number being the pixel size.- batchbool,
optional Default is
Falsewhich indicates the fit for a set of patterns should be optimized using the cumulative fit for all the patterns, and one PC will be returned. IfTrue, then an optimization is run for each individual pattern, and an array of PC values is returned.
- pats
- Returns:
numpy.ndarrayOptimized PC.
Notes
SciPy’s Nelder-Mead minimization function is used with a tolerance
fatol=0.00001between each iteration, ending the optimization when the improvement is below this value.