-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChoseSitesInner.m
47 lines (35 loc) · 2.12 KB
/
ChoseSitesInner.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
%% ChoseSites
%> @brief function to pick the central sites in the scattering region
%> @param coords An instance of class #Coordinates containing the geometry data
%> @return Returns with an array of logical values to label the indexes to be kept.
function center_sites = ChoseSitesInner( coords )
%ribbon_length = (max(coords.y) - min(coords.y));
center_sites = abs(coords.y - mean(coords.y)) < norm(coords.a)/2;
figure1 = figure('rend','painters','pos',[10 10 1200 800]);
plot(coords.x,coords.y,'x')
hold on
right_min = min(coords.x(coords.x > mean(coords.x) & center_sites));
right_max = max(coords.x(coords.x > mean(coords.x) & center_sites));
center_right = (right_min + right_max)/2;
left_min = min(coords.x(coords.x < mean(coords.x) & center_sites));
left_max = max(coords.x(coords.x < mean(coords.x) & center_sites));
center_left = (left_min + left_max)/2;
branch_width = left_max-left_min;
%original
%center_sites = abs(coords.y - mean(coords.y)) < 0.01*ribbon_length;
%choosing sites in at the outer edge
%center_sites1 = center_sites & ( abs(coords.x - right_max) < branch_width/3 | abs(coords.x - left_min) < branch_width/3 );
% plot(coords.x(center_sites1),coords.y(center_sites1),'x')
% choosing sites in the center
%center_sites2 = center_sites & ( abs(coords.x - center_right) < branch_width/6 | abs(coords.x - center_left) < branch_width/6 );
% plot(coords.x(center_sites2),coords.y(center_sites2),'x')
%choosing sites in the inner edges
center_sites = center_sites & ( abs(coords.x - right_min) < branch_width/3 | abs(coords.x - left_max) < branch_width/3 );
%{a
plot(coords.x(center_sites),coords.y(center_sites),'x')
height = ( max(coords.y) - min(coords.y) )/sqrt(3)+0.5;
%legend('scattering r','outer','center','inner');
print('-dpng', ['ChoseSites_H',num2str(height),'_nu',num2str(sum(center_sites)),'_inner.png'])
close(figure1);
%}
end