This is a static copy of a profile reportHome
updateFlags (8 calls, 1.159 sec)
Generated 05-Aug-2011 13:00:39 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/updateFlags.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 |
87 | d.flags.bit.fast = bitor(d.f... | 8 | 0.273 s | 23.6% |  |
81 | bitFast = bitor(slowFast, medF... | 8 | 0.142 s | 12.3% |  |
92 | d.flags.fast = d.flags.fast ... | 8 | 0.120 s | 10.4% |  |
82 | bitFast = bitor(bitFast, fast... | 8 | 0.120 s | 10.4% |  |
62 | fastTrans = bitand(bitand(fast... | 8 | 0.077 s | 6.6% |  |
All other lines | | | 0.426 s | 36.8% |  |
Totals | | | 1.159 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
repmat | function | 40 | 0.197 s | 17.0% |  |
arrayBitand | function | 24 | 0.044 s | 3.8% |  |
arrayBitor | function | 8 | 0.033 s | 2.8% |  |
Self time (built-ins, overhead, etc.) | | | 0.885 s | 76.4% |  |
Totals | | | 1.159 s | 100% | |
Code Analyzer results
Line number | Message |
1 | Extra semicolon is unnecessary. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 104 |
Non-code lines (comments, blank lines) | 53 |
Code lines (lines that can run) | 51 |
Code lines that did run | 46 |
Code lines that did not run | 5 |
Coverage (did run/can run) | 90.20 % |
Function listing
time calls line
1 function d = updateFlags(d, flagPol);
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 %
5 % function d = updateFlags(d, flagPol);
6 %
7 % this function just makes sure all your flag fields agree
8 %
9 % if you have a flag in channel 1 or 6 and flagPol set, it will flag all the
10 % corresponding polarization channels as well.
11 %
12 % out is Nby3 where 3 = [I1, Pol, I2];
13 %
14 % sjcm
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
17 % damn you oliver!!!
8 18 fastDim2 = size(d.flags.fast,2);
19
20
21 % basically we should just update the d.flags.bit, and the othere will fall
22 % out of it.
23
8 24 if(nargin==1)
25 flagPol = 1;
26 end
27
8 28 if(~isfield(d.flags, 'bit'))
29 display('Nothing to update');
30 return;
31 end
32
8 33 display('Updating all flags to reflect new flags');
34
35
36
37 % slowest rate should flag all rates
8 38 slowSlow = d.flags.bit.slow;
0.01 8 39 slowMed = repmat(d.flags.bit.slow, [1 5]);
8 40 slowMed = slowMed';
8 41 slowMed = slowMed(:);
0.03 8 42 slowFast = repmat(d.flags.bit.slow, [1 100]);
0.02 8 43 slowFast = slowFast';
8 44 slowFast = slowFast(:);
0.05 8 45 slowFast = repmat(slowFast, [1 fastDim2]);
46
47 % faster rate should only flag slower rate if all faster rate is flagged for
48 % a given time sample (hence the bitand)
0.03 8 49 medFast = repmat(d.flags.bit.medium, [1 20]);
0.02 8 50 medFast = medFast';
8 51 medFast = medFast(:);
0.07 8 52 medFast = repmat(medFast, [1 fastDim2]);
8 53 medMed = d.flags.bit.medium;
8 54 medSlow1 = reshape(d.flags.bit.medium, [5 length(d.flags.bit.medium)/5]);
8 55 medSlow = arrayBitand(medSlow1);
8 56 medSlow = medSlow';
57
58
59 % now for fast rate (which will always be of dim 3 at this point)
60
8 61 fastFast = d.flags.bit.fast;
0.08 8 62 fastTrans = bitand(bitand(fastFast(:,1), fastFast(:,2)), fastFast(:,3));
63
8 64 fastMed = reshape(fastTrans, [20 length(fastTrans)/20]);
0.03 8 65 fastMed = arrayBitand(fastMed);
8 66 fastMed = fastMed';
67
8 68 fastSlow = reshape(fastMed, [5 length(fastMed)/5]);
0.01 8 69 fastSlow = arrayBitand(fastSlow);
8 70 fastSlow = fastSlow';
71
72 % NO LONGER HAVE SWITCH STATES
73
74 % now we put it all together
8 75 bitSlow = bitor(slowSlow, medSlow);
8 76 bitSlow = bitor(bitSlow, fastSlow);
77
0.01 8 78 bitMed = bitor(slowMed, medMed);
8 79 bitMed = bitor(bitMed, fastMed);
80
0.14 8 81 bitFast = bitor(slowFast, medFast);
0.12 8 82 bitFast = bitor(bitFast, fastFast);
83
84 % replace the flags
8 85 d.flags.bit.slow = bitor(d.flags.bit.slow,bitSlow);
8 86 d.flags.bit.medium = bitor(d.flags.bit.medium, bitMed);
0.27 8 87 d.flags.bit.fast = bitor(d.flags.bit.fast, bitFast);
88
89 % same for the other ones
8 90 d.flags.slow = d.flags.slow | d.flags.bit.slow>0;
8 91 d.flags.medium = d.flags.medium | d.flags.bit.medium>0;
0.12 8 92 d.flags.fast = d.flags.fast | d.flags.bit.fast>0;
93
94 % next we flag the polarization channels if any of the total intensity
95 % channels are flagged
8 96 if(flagPol)
8 97 ind = d.flags.fast(:,1) | d.flags.fast(:,3);
0.04 8 98 d.flags.fast(ind,2) = 1;
99
0.04 8 100 d.flags.bit.fast(:,2) = arrayBitor(d.flags.bit.fast);
8 101 end
102
103
8 104 return;
Other subfunctions in this file are not included in this listing.