Using CalcGROD in MTEX #2261
Unanswered
JeanNoirot
asked this question in
Ask Anything
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am using a MTEX script that I did not write. I was running it on MTEX 4.5.2 and it worked perfectly.
One of the main result I need from this script is the average mis2mean. In this script it was obtained by adding "ebsd.mis2mean" in:
[grains, ebsd.grainId, ebsd.mis2mean] = calcGrains(ebsd,'angle',10*degree) ;
Later followed by:
valuesMis2Mean = ebsd('U O2').mis2mean.angle ;
valuesMis2Mean = (180 / 3.1415926 )*valuesMis2Mean ;
to have the angle values in degrees.
In the material I am studying, a polygonization takes place so that subgrains with low angle boundaries form inside the original grains. The average mis2mean is usefull to monitor how far the subgrains differ from the original orientation. One problem I have is that the orientation dispersion can exeed the limit I set between low angle boundaries and high angle boundaries, set at 10° in the line above. The consequence is that part of the subgrains, geometrically obviously coming from an original grain are considered as separate grains, thus limiting the mis2mean values.
I saw that in more recent versions of MTEX it was possible to merge inclusions. It seemed promising.
I therefore downloaded MTEX 6.0.0 to try to do that. I had to turn loadEBSD to EBSD.load and I did so. However, when trying the script I had this message:
Undefined function 'sparse' for input arguments of type 'int32'.
Error in spatialDecomposition (line 54)
I_FD = sparse(I_ED1(I_ED2<=numX),I_ED2(I_ED2<=numX),1,size(F,1),numX);
Error in EBSD/calcGrains (line 117)
[V,F,I_FD] = spatialDecomposition([pos.x(:), pos.y(:)],ebsd.unitCell,varargin{:});
Error in test (line 40)
[grains, ebsd.grainId] = calcGrains(ebsd,'angle',10*degree) ;
Do you know what can be the problem, using the same original data that worked under version 4.5.2?
Having no idea why it did not work, I decided to go back to older versions of MTEX but choosing one in which merging inclusions was possible. I selected MTEX 5.6.1. With this version the script did not have the problem mentioned above. I then added
% recherche des grains inclus
[grainsMerged,parentId] = merge(grains,'inclusions')
figure(2)
plot(ebsd('U O2'), ebsd('U O2').orientations)
hold on ;
plot(grainsMerged.boundary, 'lineWidth', 1)
hold off ;
and it worked as expected. The small new grains included are, indeed, merged to their parent grains in the plotting. Only those along the original grain boundaries remained ( if you have an idea for that that would be great but this is not what I am looking for with this post). My problem now is that, of course, I cannot get the mis2mean values directly with calcGrain since this is done before the merging. I therefore tried to have them by using:
mis2mean = calcGROD(ebsd('U O2'), grainsMerged)
but I get:
Index exceeds the number of array elements (43).
Error in quaternion/subsref (line 7)
q.a = subsref(q.a,s(1));
Error in dynProp/subsref (line 91)
varargout{1} = subsref(dp.prop,s);
Error in grain2d/subsref (line 40)
[varargout{1:nargout}] = subsref@dynProp(grains,s);
Error in EBSD/calcGROD (line 28)
meanOri = grains.meanRotation(ebsd.grainId(thisPhase));
Error in test (line 56)
mis2mean = calcGROD(ebsd('U O2'), grainsMerged)
Do you know why and how to fix that?
Also, when this will have been solved. How will I get the mis2mean angle list?
All the best
Jean
The whole script at this point is :
clear all;
%% Import Script for EBSD Data
%
% crystal symmetry
CS = {...
'notIndexed',...
crystalSymmetry('m-3m', [5.4682 5.4682 5.4682], 'mineral', 'U O2', 'color', 'light blue')};
% plotting convention
setMTEXpref('xAxisDirection','East');
setMTEXpref('zAxisDirection','IntoPlane');
%% Specify File Names
pname = 'C:\test'
% which files to be imported
fname = [pname '\test1.cpr'];
%% Import the Data
% create an EBSD variable containing the data
ebsd = EBSD.load(fname,CS,'interface','crc',...
'convertEuler2SpatialReferenceFrame');
%% Extraire et afficher les orientations
ebsd('U O2').orientations ;
figure(1)
mtexColorbar
plot(ebsd('U O2'), ebsd('U O2').orientations)
%% Comptage des grains à partir d'un critere 8°
% Comptage : génération variables "grains"
[grains, ebsd.grainId] = calcGrains(ebsd,'angle',7*degree) ;
figure(3)
plot(ebsd('U O2'), ebsd('U O2').orientations)
mtexColorbar
hold on ;
plot(grains.boundary, 'lineWidth', 1)
hold off ;
% recherche des grains inclus
[grainsMerged,parentId] = merge(grains,'inclusions')
figure(2)
plot(ebsd('U O2'), ebsd('U O2').orientations)
hold on ;
plot(grainsMerged.boundary, 'lineWidth', 1)
hold off ;
% calcul des mis2mean
mis2mean = calcGROD(ebsd('U O2'), grainsMerged)
Beta Was this translation helpful? Give feedback.
All reactions