This is a static copy of a profile reportHome
skim (1 call, 4.449 sec)
Generated 05-Aug-2011 13:00:35 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/support/skim.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
webpipe | function | 1 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
63 | eval(sprintf('dcut = cutObs(d,... | 12 | 2.514 s | 56.5% |  |
53 | [junk ind] = cutObs(d, 'source... | 1 | 0.492 s | 11.1% |  |
88 | thisSet = isSet - prevSet >... | 17 | 0.459 s | 10.3% |  |
83 | thisIndex = uint32(zeros(size(... | 17 | 0.415 s | 9.3% |  |
86 | isSet = bitand(thisIndex, d.fl... | 17 | 0.295 s | 6.6% |  |
All other lines | | | 0.273 s | 6.1% |  |
Totals | | | 4.449 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
cutObs | function | 13 | 2.984 s | 67.1% |  |
skim>date2str | subfunction | 2 | 0.011 s | 0.2% |  |
setNewFlag | function | 17 | 0 s | 0% |  |
getFlagNames | function | 1 | 0 s | 0% |  |
last | function | 1 | 0 s | 0% |  |
mjd2date_v2 | function | 2 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 1.454 s | 32.7% |  |
Totals | | | 4.449 s | 100% | |
Code Analyzer results
Line number | Message |
26 | EXIST with two input arguments is generally faster and clearer than with one input argument. |
34 | The value assigned to variable 'flag' might be unused. |
37 | The value assigned to variable 'flag' might be unused. |
53 | The value assigned here to 'junk' appears to be unused. Consider replacing it by ~. |
65 | The value assigned to variable 'intTime' might be unused. |
67 | The value assigned to variable 'perFlag' might be unused. |
84 | The value assigned here to 'aa' appears to be unused. Consider replacing it by ~. |
84 | The value assigned here to 'bb' appears to be unused. Consider replacing it by ~. |
117 | DISP(SPRINTF(...)) can usually be replaced by FPRINTF(...). |
119 | DISP(SPRINTF(...)) can usually be replaced by FPRINTF(...). |
121 | DISP(SPRINTF(...)) can usually be replaced by FPRINTF(...). |
122 | DISP(SPRINTF(...)) can usually be replaced by FPRINTF(...). |
123 | DISP(SPRINTF(...)) can usually be replaced by FPRINTF(...). |
137 | Use || instead of | as the OR operator in (scalar) conditional statements. |
137 | Use || instead of | as the OR operator in (scalar) conditional statements. |
137 | Use || instead of | as the OR operator in (scalar) conditional statements. |
137 | Use || instead of | as the OR operator in (scalar) conditional statements. |
137 | Use || instead of | as the OR operator in (scalar) conditional statements. |
138 | The variable 'thisData' might be used before it is defined. |
139 | Use || instead of | as the OR operator in (scalar) conditional statements. |
139 | Use || instead of | as the OR operator in (scalar) conditional statements. |
139 | Use || instead of | as the OR operator in (scalar) conditional statements. |
141 | The variable 'thisData' might be used before it is defined. |
146 | The variable 'thisData' might be used before it is defined. |
159 | STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY). |
164 | STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY). |
169 | STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY). |
174 | STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY). |
182 | Use || instead of | as the OR operator in (scalar) conditional statements. |
182 | Use || instead of | as the OR operator in (scalar) conditional statements. |
182 | Use || instead of | as the OR operator in (scalar) conditional statements. |
182 | Use || instead of | as the OR operator in (scalar) conditional statements. |
182 | Use || instead of | as the OR operator in (scalar) conditional statements. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 194 |
Non-code lines (comments, blank lines) | 78 |
Code lines (lines that can run) | 116 |
Code lines that did run | 57 |
Code lines that did not run | 59 |
Coverage (did run/can run) | 49.14 % |
Function listing
time calls line
1 function info=skim(d,p)
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 %
5 % info=skim(d,p)
6 %
7 % summary of data
8 %
9 % p = 1 prints output
10 % if p does not exist, defaults to true
11 %
12 % if no output (info) specified, there will be no output
13 %
14 % info.track.start (time)
15 % info.track.stop (time)
16 % info.track.intTime (minutes)
17 % info.track.perFlag (percentFlagged)
18 % info.track.numScans (number of scans)
19 % info.FIELDNAME.intTime (minutes)
20 % info.FIELDNAME.perFlag (percent Flagged)
21 %
22 % where FIELDNAME is all fields in index field, as well as one for the overall track
23 % sjcm
24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25
1 26 if (~exist('p'))
27 p=1;
28 end
29
30 % setup month cell array
1 31 month={'jan','feb','mar','apr','may','jun', ...
32 'jul','aug','sep','oct','nov','dec'};
33
1 34 flag=0;
1 35 if (isfield(d,'flags'))
1 36 if (isfield(d.flags,'fast'))
1 37 flag=1;
1 38 end
1 39 end
40
1 41 start=mjd2date_v2(d.array.frame.utc(1));
1 42 stop=mjd2date_v2(last(d.array.frame.utc));
1 43 info.track.start = start;
1 44 info.track.stop = stop;
0.01 1 45 start=date2str(start);
0.01 1 46 stop=date2str(stop);
47
1 48 info.track.intTime = size(d.antenna0.receiver.data,1)/100/60;
0.01 1 49 perFlag = length(find(d.flags.fast))./length(d.flags.fast(:))*100;
1 50 info.track.perFlag = perFlag;
51
52 % find the number of scans
0.49 1 53 [junk ind] = cutObs(d, 'source', 'only');
0.01 1 54 f = find(ind);
0.01 1 55 ff = find(diff(f)>2);
1 56 numScans = length(ff);
1 57 info.track.numScans = numScans;
58
59 % all we want is a measure of how much data is flagged for each of the separate fields.
60
1 61 fieldList = fieldnames(d.index);
1 62 for m=1:length(fieldList)
2.51 12 63 eval(sprintf('dcut = cutObs(d, ''%s'', ''only'');', fieldList{m}));
0.02 12 64 perFlag = length(find(dcut.flags.fast))./length(dcut.flags.fast(:))*100;
12 65 intTime = size(dcut.antenna0.receiver.data,1)/100/60;
12 66 if(isnan(perFlag))
7 67 perFlag = 0;
7 68 end
69
12 70 eval(sprintf('info.%s.perFlag = perFlag;', fieldList{m}));
12 71 eval(sprintf('info.%s.intTime = intTime;', fieldList{m}));
12 72 end
73
74
75 % next we want to get how much was flagged at each stage.
76
77 % get our flag indices in a parseable form
1 78 fa = getFlagNames();
1 79 prevSet = zeros(size(d.flags.fast));
1 80 numPoints = size(d.flags.fast,1);
1 81 for mm=1:length(fa)
17 82 perFlag = [0 0 0];
0.42 17 83 thisIndex = uint32(zeros(size(d.flags.fast)));
17 84 [aa bb bitNum] = setNewFlag([],[],fa{mm});
0.10 17 85 thisIndex = bitset(thisIndex, bitNum);
0.30 17 86 isSet = bitand(thisIndex, d.flags.bit.fast) >0;
87
0.46 17 88 thisSet = isSet - prevSet > 0;
17 89 for mmm=1:3
0.05 51 90 l = length(find(thisSet(:,mmm)));
51 91 perFlag(1,mmm) = l./numPoints*100;
51 92 end
93
0.01 17 94 eval(sprintf('info.flag.%s = perFlag;', fa{mm}));
17 95 end
96
97 % total flags
1 98 perFlag = [0 0 0];
1 99 for mmm=1:3
3 100 l = length(find(d.flags.fast(:,mmm)));
3 101 perFlag(1,mmm) = l./numPoints*100;
3 102 end
103
1 104 info.flag.TOTAL = perFlag;
105
106
107
108
1 109 if(p)
110
111 % print all the crap out
112 disp(' ')
113 disp(' Track Summary')
114 disp('================================================================')
115 disp(' ')
116 disp('Observation schedule')
117 disp(sprintf(' Start: %2s-%s-%4u:%2s:%2s:%5s',start.day,month{start.month},...
118 start.year, start.hour, start.minute, start.second));
119 disp(sprintf(' Stop: %2s-%s-%4u:%2s:%2s:%5s',stop.day,month{stop.month},...
120 stop.year, stop.hour, stop.minute, stop.second));
121 disp(sprintf(' Number of Scans: %d', info.track.numScans));
122 disp(sprintf(' Total time of Track: %2.2f', info.track.intTime));
123 disp(sprintf(' Percent of total Data Flagged: %2.2f', info.track.perFlag));
124
125
126 disp(' ');
127 disp(' ');
128
129 disp(' Intent Integration [min] Percent Flagged')
130 disp('------------- ----------------- ---------------')
131
132 names = fieldnames(info);
133 for m=1:length(names)
134 thisName = names{m};
135 eval(sprintf('thisData = info.%s;', thisName));
136
137 if(m==1 | m==2 | m==4 | m==5 | m==6 | m==12)
138 txt = sprintf('%s \t \t \t %8.2f \t %8.2f', thisName, thisData.intTime, thisData.perFlag);
139 elseif(m==3 | m==9 | m==10 |m==11)
140 txt = sprintf('%s \t \t %8.2f \t %8.2f', thisName, ...
141 thisData.intTime, thisData.perFlag);
142 elseif(m==14)
143 % do nothing -- flags structure
144 else
145 txt = sprintf('%s \t %8.2f \t %8.2f', thisName, ...
146 thisData.intTime, thisData.perFlag);
147 end
148 disp(txt)
149 end
150
151
152 disp(' ');
153 disp(' ');
154
155 disp(' Routine Flag Percent: [ I1, Pol, I2 ] ');
156 disp('------------- ------------------------------');
157 names = fieldnames(info.flag);
158 for m=1:length(names)
159 if(strmatch(names{m}, 'tsys', 'exact'))
160 txt = sprintf('tsys \t \t %d of %d measurements', ...
161 length(find(d.correction.tsys.flag)), ...
162 length(find(d.correction.tsys.val)));
163 disp(txt)
164 elseif(strmatch(names{m}, 'noise', 'exact'))
165 txt = sprintf('diode temp \t %d of %d measurements', ...
166 length(find(d.correction.tsys.flag)), ...
167 length(find(d.correction.tsys.val)));
168 disp(txt)
169 elseif(strmatch(names{m}, 'gain', 'exact'))
170 txt = sprintf('gain \t \t %d of %d measurements', ...
171 length(find(d.correction.gain.flag)), ...
172 length(find(d.correction.gain.val)));
173 disp(txt);
174 elseif(strmatch(names{m}, 'tau', 'exact'))
175 txt = sprintf('tau \t \t %d of %d measurements', ...
176 length(find(d.correction.tau.flag)), ...
177 length(find(d.correction.tau.values(:,5:6))));
178 disp(txt);
179 else
180
181 eval(sprintf('thisData = info.flag.%s;', names{m}));
182 if(m==1 | m==4 | m==6 | m==7 | m==10 | m==17)
183 txt = sprintf('%s \t [ %4.2f, %4.2f, %4.2f ]', names{m}, thisData(:));
184 else
185 txt = sprintf('%s \t \t [ %4.2f, %4.2f, %4.2f ]', names{m}, ...
186 thisData(:));
187 end
188 disp(txt)
189 end
190 end
191 end
192
193
1 194 return;
Other subfunctions in this file are not included in this listing.