This is a static copy of a profile reportHome
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)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
88 | [az, el] = pointing_model(mode... | 5 | 3.476 s | 44.9% |  |
23 | A = interp1(d.array.frame.utc,... | 5 | 0.776 s | 10.0% |  |
55 | lst = interp1(d.array.frame.ut... | 5 | 0.732 s | 9.5% |  |
29 | T = interp1(d.array.frame.utc,... | 5 | 0.732 s | 9.5% |  |
24 | B = interp1(d.array.frame.utc,... | 5 | 0.732 s | 9.5% |  |
All other lines | | | 1.290 s | 16.7% |  |
Totals | | | 7.738 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
interp1 | function | 25 | 3.683 s | 47.6% |  |
pointing_model | function | 5 | 3.465 s | 44.8% |  |
Self time (built-ins, overhead, etc.) | | | 0.590 s | 7.6% |  |
Totals | | | 7.738 s | 100% | |
Code Analyzer results
Line number | Message |
23 | The value assigned to variable 'A' might be unused. |
24 | The value assigned to variable 'B' might be unused. |
31 | The value assigned to variable 'long' might be unused. |
32 | The value assigned to variable 'lat' might be unused. |
33 | The value assigned to variable 'el' might be unused. |
55 | The value assigned to variable 'lst' might be unused. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 92 |
Non-code lines (comments, blank lines) | 67 |
Code lines (lines that can run) | 25 |
Code lines that did run | 25 |
Code lines that did not run | 0 |
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;