-
Notifications
You must be signed in to change notification settings - Fork 2
/
load_and_plot.m
37 lines (27 loc) · 982 Bytes
/
load_and_plot.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
%% Requirments
close all
clear all
clc
%% Specify Crystal, Grain Structure and Specimen Symmetries
% crystal symmetry
CS = {...
'notIndexed',...
crystalSymmetry('m-3m', [4 4 4], 'mineral', 'Aluminium', 'color', [0.53 0.81 0.98]),...
'notIndexed'};
% plotting convention
setMTEXpref('xAxisDirection','east');
setMTEXpref('zAxisDirection','outOfPlane');
fname = 'test_data\NDRD.ctf';
ebsd = EBSD.load(fname,CS,'interface','ctf',...
'convertSpatial2EulerReferenceFrame');
%ebsd = loadEBSD_crc(fname);
% Al phase selection
ebsd_Al = ebsd('Aluminium');
% Al grains
[grains,ebsd_Al.grainId,ebsd_Al.mis2mean] = calcGrains(ebsd_Al,'angle',10*degree);
ebsd_Al(grains(grains.grainSize<10)) = []; % clean up the grains smaller than 10 pixels
[grains,ebsd_Al.grainId,ebsd_Al.mis2mean] = calcGrains(ebsd_Al,'angle',10*degree);
% Plot
ipfKey = ipfColorKey(ebsd);
colors = ipfKey.orientation2color(ebsd.orientations);
plot(ebsd,colors)