This is a static copy of a profile report

Home

calcAzEl2 (5 calls, 7.738 sec)
Generated 05-Aug-2011 13:00:54 using cpu time.
function in file /home/LeechJ/cbass_analysis/matutils/calcAzEl2.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
apparentAzElfunction5
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
88
[az, el] = pointing_model(mode...
53.476 s44.9%
23
A = interp1(d.array.frame.utc,...
50.776 s10.0%
55
lst = interp1(d.array.frame.ut...
50.732 s9.5%
29
T = interp1(d.array.frame.utc,...
50.732 s9.5%
24
B = interp1(d.array.frame.utc,...
50.732 s9.5%
All other lines  1.290 s16.7%
Totals  7.738 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
interp1function253.683 s47.6%
pointing_modelfunction53.465 s44.8%
Self time (built-ins, overhead, etc.)  0.590 s7.6%
Totals  7.738 s100% 
Code Analyzer results
Line numberMessage
23The value assigned to variable 'A' might be unused.
24The value assigned to variable 'B' might be unused.
31The value assigned to variable 'long' might be unused.
32The value assigned to variable 'lat' might be unused.
33The value assigned to variable 'el' might be unused.
55The value assigned to variable 'lst' might be unused.
Coverage results
[ Show coverage for parent directory ]
Total lines in function92
Non-code lines (comments, blank lines)67
Code lines (lines that can run)25
Code lines that did run25
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
   time   calls  line
1 function [az, el] = calcAzEl2(az,el,d)
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 %
5 % function [az, el] = calcAzEl2(az,el,d)
6 %
7 % applies the corrections to the a set of az/el values (az,el inputs)in order to
8 % iteratively remove the poining corrections. Uses pointing/refraction
9 % data stored in the d data structure-
10 %
11 %
12 % charles copley-borrowed from SJCM
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14
15 % %
5 16 utc = d.antenna0.receiver.utc;
5 17 azVal = az;
5 18 elVal = el;
19
20 % need to re-interpolate the utc for the refraction corrections.
5 21 Avals = d.antenna0.tracker.refraction(:,1);
5 22 Bvals = d.antenna0.tracker.refraction(:,2);
0.78 5 23 A = interp1(d.array.frame.utc, Avals, utc);
0.73 5 24 B = interp1(d.array.frame.utc, Bvals, utc);
25 % apply refraction corrections
5 26 Pvals = d.array.weather.pressure;
5 27 Tvals = d.array.weather.airTemperature;
0.72 5 28 P = interp1(d.array.frame.utc, Pvals, utc);
0.73 5 29 T = interp1(d.array.frame.utc, Tvals, utc);
30
5 31 long=-118.2822;
5 32 lat=37.2339;
5 33 el=1222.00;
34
35 % now we calculate the lst
36 %jd = utc + 2400000.5;
37 %jd0 = floor(utc) + 2400000.5;
38 %H = 24*(jd - jd0);
39 %D = jd - 2451545.0;
40 %D0 = jd0 - 2451545.0;
41
42 % now we get the LST:
43 %GMT = 6.697374558 + 0.06570982441908*D0 + 1.00273790935*H;
44 %GMT = rem(GMT, 24);
45 %eps = 23.4393 - 0.0000004*D;
46 %L = 280.47 + 0.98565*D;
47 %omega = 125.04 - 0.052954*D;
48 %deltaPsi = -0.000319*sin(omega) - 0.000024*sin(2*L);
49 %eqeq = deltaPsi.*cos(eps);
50 %GAST = GMT + eqeq;
51 %lst2 = GAST + long/15;
52 %lst2(lst2<0) = lst2(lst2<0)+24;
53 %lst = lst2*15;
54
0.73 5 55 lst = interp1(d.array.frame.utc, d.antenna0.tracker.lst, utc)*15; % in degrees
56
57 % now for hour angle:
58 %ra = interp1(d.array.frame.utc, d.antenna0.tracker.equat_geoc(:,1), utc);
59 %ra = ra*15; % in degrees
60 %dec = interp1(d.array.frame.utc, d.antenna0.tracker.equat_geoc(:,2), utc); % in degrees
61 %ha = lst - ra; % also in degrees
62 %
63 %% convert all to radians:
64 %HA = ha*pi/180;
65 %de = dec*pi/180;
66 %La = lat*pi/180;
67 %
68 %[az, el] = hdl2ae(HA,de,La);
69 %az=deg2rad(azVal);
70 %el=deg2rad(elVal);
71
0.08 5 72 az = azVal*pi/180;
0.09 5 73 el = elVal*pi/180;
74
75 % apply refraction correction.
0.22 5 76 R = 0.00452.*P./( (273.15+T ).*tan(el))*pi/180;
5 77 el = el+R;
78
0.03 5 79 az = az*180/pi;
0.04 5 80 el = el*180/pi;
0.08 5 81 az(az<0) = az(az<0)+360;
82 % we need to add the online pointing model applied
5 83 model = [d.antenna0.tracker.flexure(1,:), d.antenna0.tracker.tilts(1,:), ...
84 d.antenna0.tracker.fixedCollimation(1,:), ...
85 d.antenna0.tracker.encoder_off(1,:)];
86
87 % apply the pointing model
3.48 5 88 [az, el] = pointing_model(model, az, el);
89
90 %daz = azVal-az;
91 %del= elVal-el;
5 92 return;