0001 function skydip_investigation(d)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 d_dip = framecut(d, bitsearch(d.array.frame.features, 5, 'any'));
0017 d_noise = framecut(d, bitsearch(d.array.frame.features, 10, 'any'));
0018
0019
0020 azvals = unique(floor(d_dip.antenna0.servo.az*10))/10;
0021 for m=1:length(azvals)
0022 ind = d_dip.antenna0.servo.az>azvals(m)-0.5 & ...
0023 d_dip.antenna0.servo.az<azvals(m)+0.5;
0024 dc = framecut(d_dip, ind);
0025
0026
0027
0028 thisY = dc.antenna0.receiver.data(:,[1 6]);
0029 f = find(dc.antenna0.servo.el==max(dc.antenna0.servo.el),1);
0030 y(:,1) = thisY(:,1)./thisY(f,1);
0031 y(:,2) = thisY(:,2)./thisY(f,2);
0032
0033
0034 if(mean(var(y))>1)
0035 display('sun/source present in dip');
0036 noGood = 1;
0037 else
0038 noGood = 0;
0039 end
0040
0041
0042 x = 1./(sind(dc.antenna0.servo.el));
0043
0044
0045
0046
0047 plot(x,y);
0048 xlabel('csc(el)');
0049 ylabel('Normalized Channel');
0050 txt = sprintf('title(''az: %3.1f degrees'');', azvals(m));
0051 eval(txt);
0052 r = input('Keep this Point? [Y/N]:', 's');
0053 if(strcmp(r, 'y') || strcmp(r, 'Y'))
0054 noGood = 0;
0055 elseif(strcmp(r, 'n') || strcmp(r, 'N'))
0056 noGood = 1;
0057 elseif(strcmp(r, 'k'))
0058 keyboard;
0059 else
0060 noGood = 1;
0061 end
0062
0063 if(~noGood)
0064 [tau(m,:) Tground(m,:)] = linfit(x,y);
0065 finY{m} = y;
0066 finX{m} = x;
0067 else
0068 display('Disregarding dip');
0069 tau(m,:) = nan;
0070 Tground(m,:) = nan;
0071 finY{m} = nan(size(y));
0072 finX{m} = nan(size(x));
0073 end
0074 Tamb(m) = mean(dc.array.weather.airTemperature);
0075
0076
0077
0078
0079 clear y;
0080 clear x;
0081
0082 end
0083 display('Done displaying plots');
0084
0085
0086 Tg = Tground.*repmat(Tamb', [1 2]);
0087
0088
0089
0090 figure(1)
0091 setwinsize(gcf, 800, 700);
0092 subplot(2,1,1)
0093 plot(azvals, tau);
0094 xlabel('Azimuth (degrees)');
0095 ylabel('Tau');
0096 legend('Channel 1', 'Channel 2');
0097
0098 subplot(2,1,2);
0099 plot(azvals, Tg);
0100 xlabel('Azimuth (degrees)');
0101 ylabel('T Ground [K]');
0102 legend('Channel 1', 'Channel 2');
0103
0104 gtitle('Sky Dip Investigation');
0105
0106 figure(2)
0107 setwinsize(gcf, 800, 700);
0108 subplot(2,1,1);
0109 for m=1:length(finX)
0110 plot(finX{m}, finY{m}(:,1));
0111 hold on
0112 end
0113 xlabel('csc(elevation)');
0114 ylabel('Normalized data');
0115 title('Channel 1');
0116 hold off
0117
0118 subplot(2,1,2);
0119 for m=1:length(finX)
0120 plot(finX{m}, finY{m}(:,2));
0121 hold on
0122 end
0123 xlabel('csc(elevation)');
0124 ylabel('Normalized data');
0125 title('Channel 2');
0126 gtitle('Sky dips at different Azimuths');
0127 hold off
0128
0129 return;
0130
0131
0132