This is a static copy of a profile reportHome
cutObs>determineInd (18 calls, 0.612 sec)
Generated 05-Aug-2011 13:01:15 using cpu time.
subfunction in file /home/LeechJ/cbass_analysis/reduc/cutObs.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
cutObs | function | 18 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
228 | eval(sprintf('ind_%s = ind_%s ... | 561 | 0.470 s | 76.8% |  |
226 | eval(sprintf('thisInd_%s = d.i... | 561 | 0.066 s | 10.7% |  |
235 | ind_fast = thisInd_good_fast &... | 17 | 0.044 s | 7.1% |  |
234 | ind_medium = thisInd_good_medi... | 17 | 0.011 s | 1.8% |  |
211 | case 'only' | 17 | 0.011 s | 1.8% |  |
All other lines | | | 0.011 s | 1.8% |  |
Totals | | | 0.612 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
strmatch | function | 204 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.612 s | 100.0% |  |
Totals | | | 0.612 s | 100% | |
Code Analyzer results
Line number | Message |
218 | STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY). |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 87 |
Non-code lines (comments, blank lines) | 30 |
Code lines (lines that can run) | 57 |
Code lines that did run | 39 |
Code lines that did not run | 18 |
Coverage (did run/can run) | 68.42 % |
Function listing
time calls line
152 function [ind_slow, ind_medium, ind_fast] = determineInd(d, type, logical)
153
18 154 timeTypes = {'slow', 'medium', 'fast'};
18 155 validTypes = {'source', 'elscan' 'calibrator', 'abscal', 'blank', 'skydip', ...
156 'radio_point_cross', 'radio_point_scan', ...
157 'opt_point', 'beammap', 'noise_event', 'noise'};
158
159 % first we determine the
18 160 switch(logical)
18 161 case 'or'
162 % easiest case, we just combine everything
163 ind_slow = zeros(size(d.index.source.slow));
164 ind_medium = zeros(size(d.index.source.medium));
165 ind_fast = zeros(size(d.index.source.fast));
166
167 for m=1:length(type)
168 for k=1:length(timeTypes)
169 eval(sprintf('thisInd_%s = d.index.%s.%s;', timeTypes{k}, type{m}, ...
170 timeTypes{k}));
171 eval(sprintf('ind_%s = ind_%s | thisInd_%s;', timeTypes{k}, ...
172 timeTypes{k}, timeTypes{k}));
173 end
174 end
175
18 176 case 'and'
177 % second easiest case, just do the same as above, but with ands instead
178 % of ors
179 ind_slow = ones(size(d.index.source.slow));
180 ind_medium = ones(size(d.index.source.medium));
181 ind_fast = ones(size(d.index.source.fast));
182 for m=1:length(type)
183 for k=1:length(timeTypes)
184 eval(sprintf('thisInd_%s = d.index.%s.%s;', timeTypes{k}, type{m}, ...
185 timeTypes{k}));
186 eval(sprintf('ind_%s = ind_%s & thisInd_%s;', timeTypes{k}, ...
187 timeTypes{k}, timeTypes{k}));
188 end
189 end
190
18 191 case 'not'
192 % easiest case, we just combine everything
1 193 ind_slow = zeros(size(d.index.source.slow));
1 194 ind_medium = zeros(size(d.index.source.medium));
1 195 ind_fast = zeros(size(d.index.source.fast));
196
1 197 for m=1:length(type)
1 198 for k=1:length(timeTypes)
3 199 eval(sprintf('thisInd_%s = d.index.%s.%s;', timeTypes{k}, type{m}, ...
200 timeTypes{k}));
0.01 3 201 eval(sprintf('ind_%s = ind_%s | thisInd_%s;', timeTypes{k}, ...
202 timeTypes{k}, timeTypes{k}));
3 203 end
1 204 end
205
1 206 ind_slow = ~ind_slow;
1 207 ind_medium = ~ind_medium;
1 208 ind_fast = ~ind_fast;
209
210
0.01 17 211 case 'only'
212 % in this case, you want the one where you have only the source you want
213 % and nothing else
17 214 ind_slow = zeros(size(d.index.source.slow));
17 215 ind_medium = zeros(size(d.index.source.medium));
17 216 ind_fast = zeros(size(d.index.source.fast));
17 217 for m=1:length(validTypes)
204 218 if(strmatch(validTypes{m}, type{1}, 'exact'))
219 % this is the one we want to keep
17 220 for k=1:length(timeTypes)
51 221 eval(sprintf('thisInd_good_%s = d.index.%s.%s;', timeTypes{k}, validTypes{m}, ...
222 timeTypes{k}));
51 223 end
187 224 else
187 225 for k=1:length(timeTypes)
0.07 561 226 eval(sprintf('thisInd_%s = d.index.%s.%s;', timeTypes{k}, validTypes{m}, ...
227 timeTypes{k}));
0.47 561 228 eval(sprintf('ind_%s = ind_%s | thisInd_%s;', timeTypes{k}, ...
229 timeTypes{k}, timeTypes{k}));
561 230 end
187 231 end
204 232 end
17 233 ind_slow = thisInd_good_slow & ~ind_slow;
0.01 17 234 ind_medium = thisInd_good_medium & ~ind_medium;
0.04 17 235 ind_fast = thisInd_good_fast & ~ind_fast;
17 236 end
237
18 238 return;
Other subfunctions in this file are not included in this listing.