-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetICSSGkeys.m
executable file
·103 lines (94 loc) · 2.78 KB
/
getICSSGkeys.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
% getICSSGkeys
fid=fopen('Char.txt');
n=1;
s=fgetl(fid)
while ischar(s)
if sum(isspace(s))~=length(s) % if not just a bunch of spaces
Ix=find(isspace(s)); % get the spaces
nT=str2double(s(1:(Ix(1)-1)));
if nT>0
D(n,1)=nT
S{n,1}=[s(Ix(1)+1:Ix(2)-1) s(Ix(2)+1:Ix(3)-1)];
S{n,2}=[s(Ix(3)+1:Ix(4)-1)];
S{n,3}=s(Ix(4)+1:end);
n=n+1
end
end
s=fgetl(fid);
end
fclose(fid)
save ICSSGkeys S D
%%
figure(1);clf;subplot(4,4,[1 5 9 13])
plotGrainTypeChart('PP',[0 1 0],S)
subplot(4,4,2);
plotGrainTypeChart('MM',[255 215 0]/255,S)
subplot(4,4,3)
plotGrainTypeChart('DF',[34 139 34]/255,S)
subplot(4,4,4)
plotGrainTypeChart('RG',[255 182 193]/255,S)
subplot(4,4,6)
plotGrainTypeChart('FC',[173 216 230]/255,S)
subplot(4,4,7)
plotGrainTypeChart('SH',[0 0 255]/255,S)
subplot(4,4,[11 15])
plotGrainTypeChart('DH',[255 0 255]/255,S)
subplot(4,4,[10 14])
plotGrainTypeChart('IF',[0 255 255]/255,S)
subplot(4,4,8)
plotGrainTypeChart('MF',[255 0 0]/255,S)
subplot(4,4,[12 16])
hold on
for n=1:10
plot([0+n/10 0+n/10],[0 1],'LineWidth',3,'Color',[0.7 0.7 0.7]); hold on
end
S3={'Ob','Oc','Od','Oe','Of','Og','Oh'};
S4={'DF','RG','FC','SH','DH','MF'}
for n=2:length(S3)
y=0.9-0.9/(length(S3))*(n-1);
text(0.1,y,S4{n-1},'FontSize',18,'FontWeight','bold')
text(0.6,y,S3{n},'FontSize',24,'FontWeight','bold','FontName','SnowSymbolsIACS')
end
text(0.1,0.9,'MFcr + XX','FontSize',18,'FontWeight','bold')
%% lets make a list
% gtype='PP';
% Ix=strfind(S,gtype); % lets get the new snow ones
% I2=[];
% for n=1:length(Ix)
% if ~isempty(Ix{n,2})
% I2=[I2;n];
% end
% end
% figure(1);clf;
% subplot(1,3,1)
% patch([0 1 1 0 0],[0 0 1 1 0],[0 1 0]); hold on
% title('Precipitation Particles')
% text(0.25,0.9,gtype,'FontSize',18,'FontWeight','bold')
% text(0.5,0.9,S{I2(1),1}(1),'FontSize',30,'FontWeight','bold','FontName','SnowSymbolsIACS')
% for n=2:length(I2)
% y=0.9-0.9/(length(I2)+2)*n;
% text(0.25,y,S{I2(n),2},'FontSize',14,'FontWeight','bold')
% text(0.75,y,S{I2(n),1}(1),'FontSize',24,'FontWeight','bold','FontName','SnowSymbolsIACS')
% end
% axis off
% %
% subplot(1,3,2)
% title('')
% gtype='MM';
% Ix=strfind(S,gtype); % lets get the new snow ones
% I2=[];
% for n=1:length(Ix)
% if ~isempty(Ix{n,2})
% I2=[I2;n];
% end
% end
% patch([0 1 1 0 0],[0 0 0.3 0.3 0],[255 215 0]/255); hold on
% text(0.25,0.25,gtype,'FontSize',18,'FontWeight','bold')
% text(0.5,0.25,S{I2(1),1}(1),'FontSize',30,'FontWeight','bold','FontName','SnowSymbolsIACS')
% for n=2:length(I2)
% y=0.25-0.25/(length(I2)+2)*n;
% text(0.25,y,S{I2(n),2},'FontSize',14,'FontWeight','bold')
% text(0.75,y,S{I2(n),1}(1),'FontSize',24,'FontWeight','bold','FontName','SnowSymbolsIACS')
% end
% axis([0 1 0 1])
% axis off