This is a static copy of a profile reportHome
massageData (1 call, 0.470 sec)
Generated 05-Aug-2011 13:00:44 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/flag/massageData.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
read_arc | function | 1 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
81 | d = fixTimingOrder(d); | 1 | 0.448 s | 95.3% |  |
94 | dt = deriv(d.antenna0.tracker.... | 1 | 0.011 s | 2.3% |  |
126 | return; | 1 | 0 s | 0% |  |
109 | end | 1 | 0 s | 0% |  |
108 | end | 1 | 0 s | 0% |  |
All other lines | | | 0.011 s | 2.3% |  |
Totals | | | 0.470 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
massageData>fixTimingOrder | subfunction | 1 | 0.448 s | 95.3% |  |
deriv | function | 1 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.022 s | 4.7% |  |
Totals | | | 0.470 s | 100% | |
Code Analyzer results
Line number | Message |
53 | Use && instead of & as the AND operator in (scalar) conditional statements. |
63 | Use && instead of & as the AND operator in (scalar) conditional statements. |
96 | To improve performance, replace ISEMPTY(FIND(X)) with ISEMPTY(FIND( X, 1 )). |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 126 |
Non-code lines (comments, blank lines) | 74 |
Code lines (lines that can run) | 52 |
Code lines that did run | 18 |
Code lines that did not run | 34 |
Coverage (did run/can run) | 34.62 % |
Function listing
time calls line
1 function d = massageData(d)
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 % function d = massageData(d)
4 %
5 % this function should be used to massage any eccentricities we find with
6 % previous data. one example is the weird azimuth offset in the encoder
7 % values in january 2010, or the timing error that was found. please
8 % document whatever it is you are fixing.
9 %
10 % sjcm
11 %
12 %%%%%%%%%%%
13 % Edit 1:
14 % Fixed it to not crash when only temperature sensor data is read in
15 % ogk
16 %%%%%%%%%%%
17 % Edit 2:
18 % Fixed it to not crash when only frame data is read in
19 % ogk
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
21 %%%%%%%%%%%
22 % Edit 3:
23 % Fixed it so that if Tracker Thread Timing Issue is really bad (i.e
24 % 21-Jul-2010:13:02:25 Time End: 21-Jul-2010:15:18:08) then the process
25 % errors out
26 % CJC 23/8/2010
27 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28
1 29 if(~isfield(d, 'array'))
30 return;
31 end
32
33 %%%%%%%%%%%%%%%%
34 % Added by ogk in edit 1
1 35 if(~isfield(d.array, 'frame'))
36 return;
37 end
38 %%%%%%%%%%%%%%%%
39
40
41 % timing fix for times before feb , 2010
1 42 if(d.array.frame.utc(1)<55230)
43 if(isfield(d, 'antenna0'));
44 if(isfield(d.antenna0, 'receiver'))
45 d.antenna0.receiver.utc = ...
46 d.antenna0.receiver.utc-0.3/24/60/60;
47 end
48 if(isfield(d.antenna0, 'servo'))
49 d.antenna0.servo.utc = ...
50 d.antenna0.servo.utc+0.5/24/60/60;
51 end
52 end
1 53 elseif(d.array.frame.utc(1)>55230 & d.array.frame.utc(1)<55244)
54 if(isfield(d, 'antenna0'));
55 if(isfield(d.antenna0, 'servo'))
56 d.antenna0.servo.utc = d.antenna0.servo.utc+0.5/24/60/60;
57 end
58 end
59 end
60
61
62 % fix for az position offset from Jan 22 to Jan 27, 2010
1 63 if(d.array.frame.utc(1)>55218 & d.array.frame.utc(1)<55223)
64 if(isfield(d, 'antenna0'))
65 if(isfield(d.antenna0, 'servo'))
66 if(isfield(d.antenna0.servo, 'fast_az_pos'))
67 d.antenna0.servo.fast_az_pos = ...
68 d.antenna0.servo.fast_az_pos-22.42;
69 d.antenna0.servo.slow_az_pos = ...
70 d.antenna0.servo.slow_az_pos-22.42;
71 end
72 end
73 end
74 end
75
76 % OGK edit 2: Added conditional nature of the call to fixTimingOrder
77 % let's fix the order of the timing.
1 78 if(isfield(d, 'antenna0'))
1 79 if(isfield(d.antenna0, 'servo') && isfield(d.antenna0, 'receiver') && ...
80 isfield(d.antenna0, 'thermal'))
0.45 1 81 d = fixTimingOrder(d);
1 82 end
1 83 end
84 % next we check that no times are doubled.
85
86 % this one's weird: the clock for the tracker thread sometimes doesn't
87 % update -- it not only causes the problems with the control system that
88 % matthew saw at the beginning of july, but it also makes the data have
89 % issues being processed. This fix only takes care of the data being
90 % processed.
91
1 92 if(isfield(d, 'antenna0'))
1 93 if(isfield(d.antenna0, 'tracker'))
0.01 1 94 dt = deriv(d.antenna0.tracker.utc)*24*60*60;
1 95 ind = dt>1.1 | dt<0.9;
1 96 if(~isempty(find(ind)))
97 l = length(find(ind));
98 display('Tracker Thread Timing Issue');
99 display(sprintf('Issue affected %d out of %d data samples', l, length(ind)));
100 display('Fixing data for postprocessing');
101 d.antenna0.tracker.utc(ind) = d.array.frame.utc(ind) + 1/24/60/60;
102 display('Fixed data for postprocessing');
103 %STUPID THING TO ADD
104 % if(l/length(ind)>0.01)%added by CJC for really bad data 23/8/2010
105 % error('massageData:Chk','Error massaging the data')%added by CJC for really bad data 23/8/2010
106 % end
107 end
1 108 end
1 109 end
110
111
112 %if(isfield(d, 'antenna0'))
113 % if(isfield(d.antenna0, 'receiver'))
114 % if(isfield(d.antenna0.receiver, 'gateVoltage'))
115 % d.antenna0.lna.drainCurrent = d.antenna0.receiver.drainCurrent;
116 % d.antenna0.lna.drainVoltage = d.antenna0.receiver.drainVoltage;
117 % d.antenna0.lna.gateVoltage = d.antenna0.receiver.gateVoltage;
118 % d.antenna0.receiver = rmfield(d.antenna0.receiver, 'drainCurrent');
119 % d.antenna0.receiver = rmfield(d.antenna0.receiver, 'drainVoltage');
120 % d.antenna0.receiver = rmfield(d.antenna0.receiver, 'gateVoltage');
121 % end
122 % end
123 %end
124
125
1 126 return;
Other subfunctions in this file are not included in this listing.