A method of vector3d.

the mean direction of a list of vectors, of axes, or of crystal directions

Syntax

m = mean(v)

The arithmetic mean over all vectors.

m = mean(v, axis=0)

Along the first axis.

m = mean(v, weights=w)

The normalised weighted sum.

m = mean(v, antipodal=True)

The mean axis.

m = mean(v, robust=True)

Without the farthest fifth.

m, hProjected = mean(h, return_projected=True)

Also the equivalents averaged, MATLAB’s mSym.

Description

Vectors give their arithmetic mean, with weights the normalised weighted sum. Axes give the eigenvector of the largest eigenvalue of the moment matrix. Crystal directions in a frame with symmetry are first moved to the equivalents closest to the mean, which return_projected=True returns too. robust=True drops the vectors farther from a first mean than 80 percent of them and averages again.

Input

v vector3d
h vector3d in a crystal frame

Keywords

keyword default description
weights None array, a weight per vector
antipodal False average the vectors as axes
robust False leave out the outliers, the vectors farthest from the mean
axis None an axis or a tuple of axes to average over; by default all
symmetry True take the symmetric equivalents of crystal directions into account
return_projected False also return the equivalents the mean was taken over
dtype None NumPy’s argument, refused: a container has no dtype to choose
out None NumPy’s argument, refused: a container has no output buffer
keepdims False keep the averaged axes with length one

Output

m vector3d
hProjected vector3d, the equivalents of the directions the mean was taken over

See also

vector3d.sum, vector3d.unique, VectorsOperations

MATLAB’s Miller.mean

source

Citing this page. This page is part of the documentation of MTEX, a free and open source MATLAB toolbox for analyzing and modeling crystallographic textures. It was written by The MTEX Developers and is published at https://mtex-toolbox.github.io/Miller.mean_py.html. If you use MTEX, or reuse text or figures from this page, in your research, please cite

F. Bachmann, R. Hielscher, H. Schaeben: Texture Analysis with MTEX - Free and Open Source Software Toolbox, Solid State Phenomena 160 (2010), 63-68. 10.4028/www.scientific.net/SSP.160.63

BibTeX
@article{bachmann2010mtex,
  author  = {F. Bachmann and R. Hielscher and H. Schaeben},
  title   = {Texture Analysis with MTEX - Free and Open Source Software Toolbox},
  journal = {Solid State Phenomena},
  volume  = {160},
  pages   = {63-68},
  year    = {2010},
  doi     = {10.4028/www.scientific.net/SSP.160.63},
  url     = {https://doi.org/10.4028/www.scientific.net/SSP.160.63}
}

Other papers describing specific MTEX methods are listed under Publications — please cite the one that best fits your application. The MTEX source code is licensed under the GNU General Public License v2.0; the text and figures of this documentation are licensed under CC BY 4.0, which permits reuse — including by automated systems — provided The MTEX Developers and this page are credited.