This is a static copy of a profile report

Home

determineIndices (1 call, 0.055 sec)
Generated 05-Aug-2011 13:00:34 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/determineIndices.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
reduceData>checkFlagssubfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
83
indFast = bitsearch(d.antenna0...
10.022 s40.0%
60
indFast = indFast';
110.022 s40.0%
59
indFast = repmat(indSlow, [1 1...
110.011 s20.0%
108
return;
10 s0%
101
if(d.array.frame.utc(1) < d...
10 s0%
All other lines  0 s0%
Totals  0.055 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
bitsearchfunction10.011 s20.0%
repmatfunction240.011 s20.0%
date2mjdfunction10 s0%
meanfunction20 s0%
Self time (built-ins, overhead, etc.)  0.033 s60.0%
Totals  0.055 s100% 
Code Analyzer results
Line numberMessage
57The value assigned to variable 'indMed' might be unused.
61The value assigned to variable 'indFast' might be unused.
87The value assigned to variable 'indSlow' might be unused.
91The value assigned to variable 'indMed' might be unused.
Coverage results
[ Show coverage for parent directory ]
Total lines in function108
Non-code lines (comments, blank lines)66
Code lines (lines that can run)42
Code lines that did run37
Code lines that did not run5
Coverage (did run/can run)88.10 %
Function listing
   time   calls  line
1 function d = determineIndices(d)
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 %
5 % function d = determineIndices(d)
6 %
7 % creates the index array with the different observation types from
8 % schedlib.sch, namely:
9 % noise
10 % skydip
11 % source
12 % calibrator
13 %
14 % this is a support function, just to make it easier to cut sources.
15 %
16 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17 % Edit 1: ogk
18 % features vector had 1 too few elements in it; was missing the f10 value
19 % Edit 2: ogk
20 % undid previous edit
21 % ACT 21/10/2010 --> added f1 which is used in source_scans.sch to mark
22 % elevation scans
23 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25
26 % from schedlib.
27 % feat f0 = analyze this data
28 % feat f1 = elevation scan
29 % feat f2 = calibration source
30 % feat f3 = absolute calibrator source
31 % feat f4 = blank sky
32 % feat f5 = sky dip
33 % feat f6 = radio pointing cross
34 % feat f7 = radio pointing scan (two scans)
35 % feat f8 = optical pointing
36 % feat f9 = beam map
37 % feat f10 = noise injection on
38 % feat f11 = noise injection off
39
40 %%%%%%%%%%%%%%%
41 % ogk edit 1:
42 % ogk: edit 2: undid previous change!
43 % sjcm (3/23/2011) -- backward compatability with pointing for data before
44 % Oct 2010
45
1 46 features = [0 1 2 3 4 5 6 7 8 9 10 ];
1 47 fieldNames = {'source','elscan' ,'calibrator', 'abscal', 'blank', 'skydip', ...
48 'radio_point_cross', 'radio_point_scan', ...
49 'opt_point', 'beammap', 'noise'};
50
51
1 52 for m=1:length(features)
11 53 indSlow = bitand(d.array.frame.features, 2^features(m)) > 0;
54
11 55 indMed = repmat(indSlow, [1 5]);
11 56 indMed = indMed';
11 57 indMed = indMed(:);
58
0.01 11 59 indFast = repmat(indSlow, [1 100]);
0.02 11 60 indFast = indFast';
11 61 indFast = indFast(:);
62
11 63 eval(sprintf('d.index.%s.slow = indSlow;', fieldNames{m}));
11 64 eval(sprintf('d.index.%s.medium = indMed;', fieldNames{m}));
11 65 eval(sprintf('d.index.%s.fast = indFast;', fieldNames{m}));
66
11 67 end
68
69 % for the noise source events, we look for where both features 10&11 are set
1 70 indSlow = bitand(d.array.frame.features, 2^10) > 0 | bitand(d.array.frame.features, 2^11) > 0;
1 71 indMed = repmat(indSlow, [1 5]);
1 72 indMed = indMed';
1 73 indMed = indMed(:);
1 74 indFast = repmat(indSlow, [1 100]);
1 75 indFast = indFast';
1 76 indFast = indFast(:);
1 77 d.index.noise_event.slow = indSlow;
1 78 d.index.noise_event.medium = indMed;
1 79 d.index.noise_event.fast = indFast;
80
81
82 % for the noise, we figure it out from the backend data.
0.02 1 83 indFast = bitsearch(d.antenna0.receiver.flags, 2, 'any');
84
1 85 indSlow = reshape(indFast, [100, length(indFast)/100]);
1 86 indSlow = mean(indSlow)>0.5;
1 87 indSlow = indSlow';
88
1 89 indMed = reshape(indFast, [20, length(indFast)/20]);
1 90 indMed = mean(indMed)>0.5;
1 91 indMed = indMed';
92
1 93 m = length(features);
1 94 eval(sprintf('d.index.%s.slow = indSlow;', fieldNames{m}));
1 95 eval(sprintf('d.index.%s.medium = indMed;', fieldNames{m}));
1 96 eval(sprintf('d.index.%s.fast = indFast;', fieldNames{m}));
97
98
99 % before October 2010, the radio_point_cross in the schedules had the same
100 % feature number as radio_point_scan.
1 101 if(d.array.frame.utc(1) < date2mjd(2010, 10, 1, 0,0,0))
102 dd = d;
103 dd.index.radio_point_cross = d.index.radio_point_scan;
104 dd.index.radio_point_scan = d.index.radio_point_cross;
105 d = dd;
106 end
107
1 108 return;

Other subfunctions in this file are not included in this listing.