%% Import Script for EBSD Data % % This script was automatically created by the import wizard. You should % run the whoole script or parts of it in order to import your data. There % is no problem in making any changes to this script. %% Specify Crystal and Specimen Symmetries % crystal symmetry CS = {... 'notIndexed',... crystalSymmetry('6/mmm', [3.2 3.2 5.2], 'X||a', 'Y||b*', 'Z||c*', 'mineral', 'Magnesium', 'color', [0.53 0.81 0.98])}; % plotting convention setMTEXpref('xAxisDirection','south'); setMTEXpref('zAxisDirection','outOfPlane'); %% Specify File Names % path to files pname = 'D:\Prisms_plasticity'; % which files to be imported fname = [pname '\Scan1.ang']; %% Import the Data % create an EBSD variable containing the data ebsd = EBSD.load(fname,CS,'interface','ang',... 'convertEuler2SpatialReferenceFrame'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%% cleanup %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %[grains,ebsd.grainId,ebsd_after.mis2mean] = calcGrains(ebsd,'angle',5*degree); grains = calcGrains(ebsd); %ebsd(grains(grains.grainSize<3))=[]; % %ebsd(ebsd.prop.ci<1)=[]; % [grains_after,ebsd_after.grainId]=calcGrains(ebsd_after,'angle',5*degree); % grains_after=smooth(grains_after,5); %F = halfQuadraticFilter; %F.alpha=10; % F = splineFilter; % ebsd_Sub_filled = smooth(ebsd,F,'fill',grains); %ebsd_after_Sub_filled = ebsd_after; %[grains,ebsdSub_filled('indexed').grainId]=calcGrains(ebsdSub_filled('indexed')); %[grains_Sub_filled,ebsd_Sub_filled('indexed').grainId]=calcGrains(ebsd_Sub_filled('indexed'),'threshold',[10*degree 1*degree]); %grains_Sub_filled = calcGrains(ebsd_Sub_filled('indexed')); %grains_Sub_filled=smooth(grains_Sub_filled,5); ebsd_Sub_filled = ebsd; grains_Sub_filled = grains; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% IPF map %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % plotting convention for mapping setMTEXpref('xAxisDirection','east'); setMTEXpref('zAxisDirection','intoPlane'); ipfKey=ipfHSVKey(ebsd_Sub_filled('Magnesium')); ipfKey.inversePoleFigureDirection.z=1; figure(5) plot(ipfKey); % plot the ebsd data figure(1) colorsZr_HCP_after=ipfKey.orientation2color(ebsd_Sub_filled('Magnesium').orientations); plot(ebsd_Sub_filled('Magnesium'),colorsZr_HCP_after) %plot(ebsdSub_filled('Zr_HCP'),ebsdSub_filled('Zr_HCP').orientations,'faceAlpha',0.5,'figSize','large') % init override mode hold on % plot grain boundares plot(grains_Sub_filled.boundary,'linewidth',1.5) hold off %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%% mesh %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% V=grains_Sub_filled.V; ori = min(V); grains_Sub_filled.V = V-repmat(ori,size(grains_Sub_filled.V,1),1); G = gmshGeo(grains_Sub_filled); G=simplify(G); max(grains_Sub_filled.V) %tic mesh(G,'mesh.msh','ElementType','HexOnly','GrainPrefix','','thickness',1); %mesh(G,'mesh.msh','ElementType','HexOnly','ElementSize',1.0,'GrainPrefix','','thickness',1); %toc exportGrainProps(G,'orientations_Ti2.txt','PRISMS')