This is a static copy of a profile report

Home

applyAlpha_database_DD (1 call, 4.197 sec)
Generated 05-Aug-2011 13:03:51 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/applyAlpha_database_DD.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
alphaWrapperfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
25
[Am,Gm] = interpolateAlpha_DD(...
13.815 s90.9%
31
d.antenna0.receiver.data(:,1) ...
10.066 s1.6%
42
d.antenna0.receiver.data(:,5) ...
10.044 s1.0%
38
d.antenna0.receiver.data(:,3) ...
10.044 s1.0%
47
d.antenna0.receiver.data(:,8) ...
10.033 s0.8%
All other lines  0.197 s4.7%
Totals  4.197 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
interpolateAlpha_DDfunction13.815 s90.9%
Self time (built-ins, overhead, etc.)  0.383 s9.1%
Totals  4.197 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function55
Non-code lines (comments, blank lines)34
Code lines (lines that can run)21
Code lines that did run19
Code lines that did not run2
Coverage (did run/can run)90.48 %
Function listing
   time   calls  line
1 function d = applyAlpha_database_DD(d)
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 % d = applyAlpha_database_DD(d)
4 % This function applies the alpha leakage terms and G gain terms to the
5 % data in d. It uses the database of alpha values in the cvs repository to
6 % interpolate the alpha corrections at each time sample in d.
7 % After this step the columns in data have been properly separated
8 % (i.e. into load and sky for total intensity) and their units have been
9 % converted to a common scale. The scale is:
10 % (Antenna Temperature)/(Noise Diode Temperature)
11 % The polarization sets have been rotated to correct for the instrument
12 % rotation.
13 %
14 % OGK, 21 November 2010
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
1 17 if size(d.antenna0.receiver.data,2) ~= 10
18 error('Run assembleAlphaStreams_DD first!');
19 end
20
1 21 t = d.antenna0.receiver.utc;
1 22 swd = d.antenna0.receiver.data;
23
24 % Get the interpolated alpha values from the database:
3.81 1 25 [Am,Gm] = interpolateAlpha_DD(t);
26
27 % And now form the corrected switchData products for total intensity:
28 % Total intensity channel 1
1 29 A = swd(:,1)+swd(:,2);
0.01 1 30 B = swd(:,1)-swd(:,2);
0.07 1 31 d.antenna0.receiver.data(:,1) = Gm(:,1).*(1/2*(A+B./Am(:,1))); % propto (2Tsky + Tnoise)
0.02 1 32 d.antenna0.receiver.data(:,2) = Gm(:,1).*(1/2*(A-B./Am(:,1))); % propto (2Tload + Tnoise)
33
34 % Polarization: apply the rotation matrix, with rotation angle -theta, to
35 % the vector [Qmeasured;Umeasured]
36
37 % Polarization set 1
0.04 1 38 d.antenna0.receiver.data(:,3) = Gm(:,2).*( cos(Am(:,2)).*swd(:,3) + sin(Am(:,2)).*swd(:,4)); % Q
0.03 1 39 d.antenna0.receiver.data(:,4) = Gm(:,2).*(-sin(Am(:,2)).*swd(:,3) + cos(Am(:,2)).*swd(:,4)); % U
40
41 % Polarization set 2
0.04 1 42 d.antenna0.receiver.data(:,5) = Gm(:,3).*( cos(Am(:,3)).*swd(:,5) + sin(Am(:,3)).*swd(:,6)); % Q
0.03 1 43 d.antenna0.receiver.data(:,6) = Gm(:,3).*(-sin(Am(:,3)).*swd(:,5) + cos(Am(:,3)).*swd(:,6)); % U
44
45 % Polarization set 3
0.03 1 46 d.antenna0.receiver.data(:,7) = Gm(:,4).*( cos(Am(:,4)).*swd(:,7) + sin(Am(:,4)).*swd(:,8)); % Q
0.03 1 47 d.antenna0.receiver.data(:,8) = Gm(:,4).*(-sin(Am(:,4)).*swd(:,7) + cos(Am(:,4)).*swd(:,8)); % U
48
49 % Total intensity channel 2
1 50 A = swd(:,9)+swd(:,10);
0.01 1 51 B = swd(:,9)-swd(:,10);
0.02 1 52 d.antenna0.receiver.data(:,9) = Gm(:,5).*(1/2*(A+B./Am(:,5))); % I - V
0.01 1 53 d.antenna0.receiver.data(:,10) = Gm(:,5).*(1/2*(A-B./Am(:,5))); % Tr2
54
1 55 end