mtex-toolbox / mtex

MTEX is a free Matlab toolbox for quantitative texture analysis. Homepage:
http://mtex-toolbox.github.io/
GNU General Public License v2.0
281 stars 185 forks source link

Transform orientations with CS1 to orientations with CS2 - syntax problem ? #254

Closed DavidMainprice closed 6 years ago

DavidMainprice commented 7 years ago

We have in MTEX a very useful function transformReferenceFrame, which is used to change reference frame of tensors or Euler angles.

I tried this % % Transform orientations with CS1 to orientations with CS2 % CS1 = {'notIndexed',crystalSymmetry('mmm', [10.225 5.994 4.762], 'mineral', 'Forsterite')}; CS2 = {'notIndexed',crystalSymmetry('mmm', [4.762 10.225 5.994 ], 'mineral', 'Forsterite')}; % Note only difference is order of axes lengths % % Transforms Euler angle Frame CS1 to CS2 % CS1 ebsd('Fo').CS % Orientations with CS1 O1 = ebsd('Fo').orientations % Transform O1 to Orientations with CS2 % Syntex given in
O2 = O1.transformReferenceFrame(CS2);

ans = crystalSymmetry (show methods, plot)

mineral : Forsterite color : light blue symmetry: mmm
a, b, c : 10, 6, 4.8 (THIS CS1 as expected)

O1 = orientation (show methods, plot) size: 250000 x 1 crystal symmetry : Forsterite (mmm) specimen symmetry: 1

Warning: Symmetry missmatch!

In orientation/transformReferenceFrame (line 22) In rotation/subsref (line 22)

O2

O2 = invalid misorientation size: 250000 x 1

Is the syntax correct? Or is this bug?

all the best David

DavidMainprice commented 7 years ago

OK I have found the solution

You make standard MTEX importation with CS where CS is space group (Pcmn) a=10.225,b=5.994,c=4.762 CS = {'notIndexed',crystalSymmetry('mmm', [10.225 5.994 4.762], 'mineral', 'Forsterite')};

%% Transform orientations with CS to orientations with CS2 % Transforms Euler angle Frame CS to CS2 % Orientations with CS space group (Pcmn) O1 = ebsd('Fo').orientations % Transform O1 orientations with CS1(Pcmn) to Orientations with CS2(Pbnm) % CS2 is standard setting for Forsterite (Pbnm) a=4.762 b=10.225 c= 5.994 for Mineralogy CS2 = crystalSymmetry('mmm',[4.762 10.225 5.994 ],'mineral','Fo2'); % Orientations with CS2 reference frame O2 = transformReferenceFrame(O1,CS2)

The problem was caused by the CS2 = {'notIndexed',crystalSymmetry('mmm', [4.762 10.225 5.994 ], 'mineral', 'Forsterite')}; just remove 'notIndexed' or define as I have in comment CS2 = crystalSymmetry('mmm',[4.762 10.225 5.994 ],'mineral','Fo2');

all the best David