VPSC export code for EBSD data

150 views
Skip to first unread message

grandr...@gmail.com

unread,
Nov 17, 2016, 1:40:57 PM11/17/16
to MTEX
If anyone is interested, I just put together some basic input and output scripts for VPSC.   It's a bit trivial, but I couldn't find a good version of this online yet.

To export EBSD data to VPSC

% the following code exports all orientations, one line for each point. 

export_VPSC(ebsd('Magnesium').orientations,'filename.txt')

%A more computationally efficient way (eg 691 orientations vs 47672) to export is to threshold into grains, and use the mean orientations.  In this case, we must separate out the weights for each orientation, or they are assumed to be equal.  We get this information from the grain size

W=grains.grainSize/sum(grains.grainSize)

export_VPSC(grains.meanOrientation,'W56-T0-P7.txt','weights',W)

%to make things even better, we can eliminate all grains with grain size less than a minimum value, say 5 pixels. (now only 44 orientations for VPSC to address)

%to remove all small grains, determine which these are and make a list

%first create a logical to determine what data meets the criteria

temp=grains.grainSize>=5

%then load the conforming data into a new matrix

grainsLG=grains(temp)

%now load the weights for those grains into W

W=grainsLG.grainSize/sum(grainsLG.grainSize)

%and export the data

export_VPSC(grainsLG.meanOrientation,'filename.txt','weights',W)



To import texture data from the file 'TEX_PH1.txt' it needs to be split based on the number of steps provided (ie for example 7 distributed with the code, texture is output at two steps so the file needs to be split in half manually.  After this,

CS = crystalSymmetry('hexagonal');

texFile = 'TEX_PH1_0p15.txt';

ori_0p15 =loadOrientation_generic(texFile,CS,'ColumnNames',{ 'Euler1','Euler2','Euler3','Error'},'Bunge');

delimiterIn = ' ';
headerlinesIn = 4;
W = importdata(texFile,delimiterIn,headerlinesIn);
W_0p15=W.data(:,4);
 
 

texFile = 'TEX_PH1_0p3.txt';

ori_0p3 =loadOrientation_generic(texFile,CS,'ColumnNames',{ 'Euler1','Euler2','Euler3','Error'},'Bunge');

delimiterIn = ' ';
headerlinesIn = 4;
W = importdata(texFile,delimiterIn,headerlinesIn);
W_0p3=W.data(:,4);
plotx2east;
h=[Miller(0,0,1,CS),Miller(1,0,0,CS)];

odf_0p15 = calcODF(ori_0p15,'weights', W_0p15);
odf_0p3 = calcODF(ori_0p3,'weights', W_0p3);
figure; plotPDF(odf_0p15,h)
figure; plotPDF(odf_0p3,h)

Reply all
Reply to author
Forward
0 new messages