-
Notifications
You must be signed in to change notification settings - Fork 0
/
cedarplottest.m
67 lines (58 loc) · 2.07 KB
/
cedarplottest.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
close all
load 'testBoth.mat'
titleFont = 20;
axisFont = 16;
tickFont = 15;
%imagesc(fliplr(10*log10(sum_data_streak_ixon'./median(median(sum_data_streak_ixon)))))
xu = flipud(sum_data_streak_ultra);
imagesc(10*log10(xu./median(median(sum_data_streak_ultra))))
set(gca,'ydir','normal');
set(gca,'FontSize',tickFont)
title('No Filter','fontsize',titleFont)
cbar_handle = colorbar;
set(get(cbar_handle,'ylabel'),'string','SNR (dB)','fontsize',axisFont)
set(cbar_handle,'FontSize',tickFont)
caxis([0,3])
%headCoordinates = ginput(2);
headCoordinates = [[171, 392];[243,370]]
slope = (headCoordinates(2,2)-headCoordinates(1,2))/(headCoordinates(2,1)-headCoordinates(1,1));
xStart = round(headCoordinates(1,1));
xEnd = round(headCoordinates(2,1));
powerUltra = zeros(xEnd-xStart+1,1);
for i = xStart:xEnd
yIndex = round(headCoordinates(1,2)+(i-xStart)*slope);
powerUltra(i-xStart+1) = max(xu(yIndex-2:yIndex+2,i));
end
xi = flipud(fliplr(sum_data_streak_ixon'));
figure;
imagesc(10*log10(xi./median(median(sum_data_streak_ixon))))
set(gca,'ydir','normal');
set(gca,'FontSize',tickFont)
title('> 475nm Filter','fontsize',titleFont)
cbar_handle = colorbar;
set(get(cbar_handle,'ylabel'),'string','SNR (dB)','fontsize',axisFont)
set(cbar_handle,'FontSize',tickFont)
caxis([0,0.03])
%headCoordinates = ginput(2);
%headCoordinates = [[205,395],[240,381]]
headCoordinates = [[186,402];[258,374]];
slope = (headCoordinates(2,2)-headCoordinates(1,2))/(headCoordinates(2,1)-headCoordinates(1,1));
xStart = round(headCoordinates(1,1));
xEnd = round(headCoordinates(2,1));
powerIxon = zeros(xEnd-xStart+1,1);
for i = xStart:xEnd
yIndex = round(headCoordinates(1,2)+(i-xStart)*slope);
powerIxon(i-xStart+1) = max(xi(i,yIndex-2:yIndex+2));
end
%find the maximum index of each power
[dummy, maxIxonIndex] = max(powerIxon);
[dummy, maxUltraIndex] = max(powerUltra);
figure
titleFont = 20;
axisFont = 16;
tickFont = 15;
plot(powerUltra./powerIxon)
set(gca,'FontSize',tickFont)
xlabel('Pixel','fontsize',axisFont);
ylabel('No Filter/Filter Intensity','fontsize',axisFont);
title('No Filter/Filter Camera Ratio')