This is a static copy of a profile report

Home

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 NameFunction TypeCalls
webpipefunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
63
eval(sprintf('dcut = cutObs(d,...
122.514 s56.5%
53
[junk ind] = cutObs(d, 'source...
10.492 s11.1%
88
thisSet = isSet - prevSet >...
170.459 s10.3%
83
thisIndex = uint32(zeros(size(...
170.415 s9.3%
86
isSet = bitand(thisIndex, d.fl...
170.295 s6.6%
All other lines  0.273 s6.1%
Totals  4.449 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
cutObsfunction132.984 s67.1%
skim>date2strsubfunction20.011 s0.2%
setNewFlagfunction170 s0%
getFlagNamesfunction10 s0%
lastfunction10 s0%
mjd2date_v2function20 s0%
Self time (built-ins, overhead, etc.)  1.454 s32.7%
Totals  4.449 s100% 
Code Analyzer results
Line numberMessage
26EXIST with two input arguments is generally faster and clearer than with one input argument.
34The value assigned to variable 'flag' might be unused.
37The value assigned to variable 'flag' might be unused.
53The value assigned here to 'junk' appears to be unused. Consider replacing it by ~.
65The value assigned to variable 'intTime' might be unused.
67The value assigned to variable 'perFlag' might be unused.
84The value assigned here to 'aa' appears to be unused. Consider replacing it by ~.
84The value assigned here to 'bb' appears to be unused. Consider replacing it by ~.
117DISP(SPRINTF(...)) can usually be replaced by FPRINTF(...).
119DISP(SPRINTF(...)) can usually be replaced by FPRINTF(...).
121DISP(SPRINTF(...)) can usually be replaced by FPRINTF(...).
122DISP(SPRINTF(...)) can usually be replaced by FPRINTF(...).
123DISP(SPRINTF(...)) can usually be replaced by FPRINTF(...).
137Use || instead of | as the OR operator in (scalar) conditional statements.
137Use || instead of | as the OR operator in (scalar) conditional statements.
137Use || instead of | as the OR operator in (scalar) conditional statements.
137Use || instead of | as the OR operator in (scalar) conditional statements.
137Use || instead of | as the OR operator in (scalar) conditional statements.
138The variable 'thisData' might be used before it is defined.
139Use || instead of | as the OR operator in (scalar) conditional statements.
139Use || instead of | as the OR operator in (scalar) conditional statements.
139Use || instead of | as the OR operator in (scalar) conditional statements.
141The variable 'thisData' might be used before it is defined.
146The variable 'thisData' might be used before it is defined.
159STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY).
164STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY).
169STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY).
174STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY).
182Use || instead of | as the OR operator in (scalar) conditional statements.
182Use || instead of | as the OR operator in (scalar) conditional statements.
182Use || instead of | as the OR operator in (scalar) conditional statements.
182Use || instead of | as the OR operator in (scalar) conditional statements.
182Use || instead of | as the OR operator in (scalar) conditional statements.
Coverage results
[ Show coverage for parent directory ]
Total lines in function194
Non-code lines (comments, blank lines)78
Code lines (lines that can run)116
Code lines that did run57
Code lines that did not run59
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.