Home > cbassSouthFunctions > ACTFunctions > plot_load_sky_comparison.m

plot_load_sky_comparison

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 clear;close all
0002 %d = read_arcSouth('27-Apr-2013:01:17:30 ','     27-Apr-2013:01:45:52')
0003 %d = read_arcSouth('29-Apr-2013:11:39:52 ','     29-Apr-2013:11:56:14')
0004 %d = read_arcSouth('30-Apr-2013:19:59:27 ','     30-Apr-2013:23:42:19')
0005 %d = read_arcSouth('08-May-2013:05:38:19 ','     08-May-2013:05:58:11')
0006 d = read_arcSouth('30-Apr-2013:03:16:52  ','     30-Apr-2013:03:36:44')
0007 %%
0008 % Plot LL and load2 averaged over frequency
0009 
0010 figure(10)
0011 utc = (d.antenna0.roach1.utc);
0012 plot(utc,d.antenna0.roach1.LLfreq,utc,d.antenna0.roach1.load2freq)
0013 title('LL_freq and load2_freq')
0014 %%
0015 % Plot LL and load2 for channel 20
0016 
0017 figure(20)
0018 utc = (d.antenna0.roach1.utc);
0019 plot(utc,d.antenna0.roach1.LL(:,20),'r',utc,d.antenna0.roach1.load2(:,20))
0020 title('Roach 1: LL and load2, channel 20')
0021 %%
0022 %To plot for many channels
0023 for i=1:4
0024  figure(i)
0025   for j=1:16
0026    subplot(4,4,j)
0027     chan=(i-1)*16+j
0028     plot(utc,d.antenna0.roach1.LL(:,chan),'r',utc,d.antenna0.roach1.load2(:,chan))
0029     %legend('LL','load2')
0030     %ylim([0 5e5])
0031     xlabel(['Chan ',num2str(chan)])
0032    end
0033 gtitle('Roach1 LL')
0034 end    
0035 %%
0036 %To plot for many channels
0037 for i=5:8
0038  figure(i)
0039   for j=1:16
0040    subplot(4,4,j)
0041     chan=(i-5)*16+j
0042     plot(utc,d.antenna0.roach2.LL(:,chan),'r',utc,d.antenna0.roach2.load2(:,chan))
0043     %legend('LL','load2')
0044     %ylim([0 5e5])
0045     xlabel(['Chan ',num2str(chan)])
0046    end
0047 gtitle('Roach2 LL')
0048 end    
0049 
0050 % Plot channel means
0051 % Find temperature of load where LL/RR and load roughly cross
0052 
0053 % LL
0054 for roach = 1:2
0055     for i = 1:64
0056         if(roach==1)
0057             freq_chan= i;
0058             LL = d.antenna0.roach1.LL;
0059             load = d.antenna0.roach1.load2;
0060         else
0061             LL = d.antenna0.roach2.LL;
0062             load = d.antenna0.roach2.load2;
0063             freq_chan = 64+i;
0064         end
0065         
0066     best = (abs(LL(:,i)-load(:,i))==3000); % just find data when difference between them is 3000 (ie. small - units are of order 1e4)
0067     balance_LL(2,freq_chan) = mean(d.antenna0.thermal.ccTemperatureLoadFast(best));
0068     balance_LL(1,freq_chan)= freq_chan;
0069     end
0070 end
0071 
0072 % Now weight the data by the 1/Tsys^2
0073 weighted_LL= zeros(
0074 weights = 1./(balance_LL(2,:)).^2;
0075 nans = isnan(weights);
0076 weights(nans)=0; % remove data where Tsys estimated as nan
0077 sum_of_weights = sum(weights);
0078 LL = [d.antenna0.roach1.LL,d.antenna0.roach2.LL];
0079 weighted_LL= zeros(size(LL));
0080 for freq_chan= 1:128
0081 weighted_LL(:,freq_chan) =  (weights(freq_chan).*LL(:,freq_chan))./sum_of_weights;
0082 end
0083

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005