forked from subangstrom/superAngle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPositionXY_display2.m
148 lines (135 loc) · 4.58 KB
/
PositionXY_display2.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
function [ ] = PositionXY_display2( chk_print, A_map, B_map, ratio_map, tot_Det_num, angle_search, sample_para, search_Range_2D, d_Range_2D )
%Display 2D map for correction coefficient due to X-ray absorption and/or holder shadowing
%Along Specimen shift in X and Y direction.
%Weizong Xu, [email protected], March 2015
%check matlab version, if equal or newer than 2014a, use parula as colormap
%older version use jet as colormap
v_a = version('-release');
v_b = str2double(v_a(regexp(v_a,'\d')));
if (v_b>=2014)
maptype='parula';
else
maptype='jet';
end
if (sum(A_map(:))==0 && sum(B_map(:)) ==0)
return;
end
sym_A = get_element_name(sample_para(13),sample_para(14));
sym_B = get_element_name(sample_para(15),sample_para(16));
image_range=-search_Range_2D:d_Range_2D:search_Range_2D;
A_map_all=sum(A_map,3);
B_map_all=sum(B_map,3);
for i=1:tot_Det_num
figure;
set(gca,'FontSize',15)
num_xray_Det=1;
imagesc (image_range, -image_range, A_map(:,:,i)/num_xray_Det), axis image;
title_name = ['Effective solid angle of ', sym_A, ' X-ray arriving at Detector ',num2str(i)];
title (title_name);
xlabel('Specimen Position X (mm)','FontSize',15)
ylabel('Specimen Position Y (mm)','FontSize',15)
axis xy;
h=colorbar;
set(h,'fontsize',15);
colormap (maptype);
hold on;
[C,h]=contour (image_range, -image_range, A_map(:,:,i)/num_xray_Det,'k');
clabel(C,h,'FontSize',15,'LabelSpacing',600);
hold off;
if (chk_print==1)
print(['map_2D_shift_',title_name],'-dpng','-r300');
end
figure;
set(gca,'FontSize',15)
imagesc (image_range, -image_range, B_map(:,:,i)/num_xray_Det), axis image;
title_name = ['Effective solid angle of ', sym_B, ' X-ray arriving at Detector ',num2str(i)];
title (title_name);
xlabel('Specimen Position X (mm)','FontSize',15)
ylabel('Specimen Position Y (mm)','FontSize',15)
axis xy;
h=colorbar;
set(h,'fontsize',15);
colormap (maptype);
hold on;
[C,h]=contour (image_range, -image_range, B_map(:,:,i)/num_xray_Det,'k');
clabel(C,h,'FontSize',15,'LabelSpacing',600);
hold off;
if (chk_print==1)
print(['map_2D_shift_',title_name],'-dpng','-r300');
end
end
figure;
set(gca,'FontSize',15)
imagesc (image_range, -image_range, A_map_all), axis image;
title_name = ['Effective solid angle of ', sym_A, ' X-ray arriving at all detectors'];
title (title_name);
xlabel('Tilt X (degree)','FontSize',15)
ylabel('Tilt Y (degree)','FontSize',15)
axis xy;
h=colorbar;
set(h,'fontsize',15);
colormap (maptype);
hold on;
[C,h]=contour (image_range, -image_range, A_map_all,'k');
clabel(C,h,'FontSize',15,'LabelSpacing',600);
hold off;
if (chk_print==1)
print(['map_2D_shift_',title_name],'-dpng','-r300');
end
figure;
set(gca,'FontSize',15)
imagesc (image_range, -image_range, B_map_all), axis image;
title_name = ['Effective solid angle of ', sym_B, ' X-ray arriving at all detectors'];
title (title_name);
xlabel('Tilt X (degree)','FontSize',15)
ylabel('Tilt Y (degree)','FontSize',15)
axis xy;
h=colorbar;
set(h,'fontsize',15);
colormap (maptype);
hold on;
[C,h]=contour (image_range, -image_range, B_map_all,'k');
clabel(C,h,'FontSize',15,'LabelSpacing',600);
hold off;
if (chk_print==1)
print(['map_2D_shift_',title_name],'-dpng','-r300');
end
for i=1:tot_Det_num
figure;
set(gca,'FontSize',15)
imagesc (image_range, -image_range, A_map(:,:,i)./B_map(:,:,i)), axis image;
title_name = ['Calculated ', sym_A, ' vs ', sym_B, ' counts ratio at Detector ',num2str(i)];
title (title_name);
xlabel('Specimen Position X (mm)','FontSize',15)
ylabel('Specimen Position Y (mm)','FontSize',15)
axis xy;
h=colorbar;
set(h,'fontsize',15);
colormap (maptype);
hold on;
[C,h]=contour (image_range, -image_range, A_map(:,:,i)./B_map(:,:,i),'k');
clabel(C,h,'FontSize',15);
hold off;
if (chk_print==1)
print(['map_2D_shift_',title_name],'-dpng','-r300');
end
end
figure
set(gca,'FontSize',15)
imagesc (image_range, -image_range, ratio_map), axis image;
title_name =['Calculated ', sym_A, ' vs ', sym_B, ' counts ratio of all detectors'];
title (title_name);
xlabel('Specimen Position X (mm)','FontSize',15)
ylabel('Specimen Position Y (mm)','FontSize',15)
axis xy;
h=colorbar;
set(h,'fontsize',15);
colormap (maptype);
hold on;
[C,h]=contour (image_range, -image_range, ratio_map,'k');
clabel(C,h,'FontSize',15,'LabelSpacing',300);
hold off;
if (chk_print==1)
print(['map_2D_shift_',title_name],'-dpng','-r300');
end
end