This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
reduceDatafunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
62
[horzFlag satFlag sunFlag moon...
124.778 s56.8%
100
flag = flagRFI_std(d,preFlag,f...
15.902 s13.5%
70
[d, outFlags] = packd(d, flags...
15.727 s13.1%
106
[d, outFlags] = packd(d, flags...
15.673 s13.0%
91
d = updateFlags(d, 1);
10.153 s0.4%
All other lines  1.377 s3.2%
Totals  43.611 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
flagRFI_posfunction124.778 s56.8%
packdfunction211.389 s26.1%
flagRFI_stdfunction15.891 s13.5%
updateFlagsfunction60.853 s2.0%
setNewFlagfunction60.448 s1.0%
setPlotDisplayfunction20.066 s0.2%
repmatfunction60.044 s0.1%
logcalfunction20 s0%
checkparfunction20 s0%
Self time (built-ins, overhead, etc.)  0.142 s0.3%
Totals  43.611 s100% 
Code Analyzer results
Line numberMessage
1Extra semicolon is unnecessary.
Coverage results
[ Show coverage for parent directory ]
Total lines in function112
Non-code lines (comments, blank lines)62
Code lines (lines that can run)50
Code lines that did run37
Code lines that did not run13
Coverage (did run/can run)74.00 %
Function listing
   time   calls  line
1 function d = rfiWrapper(d, plotparams, parm, field);
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 %
5 % function d = rfiWrapper(d, plotparams, parm, field)
6 %
7 % reduceData function that calls the rfi algorithm with
8 % parameters parm.
9 %
10 %
11 % sjcm
12 %
13 % Modified Oct 8, 2010 (MAS): Switched in new RFI flagging for noise
14 % diode events.
15 %
16 % Modified Dec 20, 2010 (MAS): Switched in generalized RFI flagging for
17 % all data. Removed distinction and need for two rfi flagging sessions.
18 %
19 % Modified Jan 7, 2011 (MAS): Got rid of the stageNum parameter.
20 %
21 % 3/29/2011 (SJCM): no plotting but saving plots
22 %
23 % Modified Apr 15, 2011 (MAS): Updated to latest algorithm.
24 % Added support for user parameters. Added spatial flagging.
25 %
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27
28 % first we find the deglitching flags, then we plot things up
29 % check if we have the flagging parameters
0.01 1 30 parFlag = checkpar(parm, 'rfi');
31
1 32 if(parFlag)
1 33 flagParamsRfi = [parm.rfi.short parm.rfi.long parm.rfi.smooth parm.rfi.rejection];
34 else
35 display('Using Default RFI flagging parameters');
36 flagParamsRfi = [5 1.0 2.0 20 0.25 0.20 4.0 0.40 6.0 30 1];
37 end
38
1 39 parFlag2 = checkpar(parm, 'coord');
1 40 if(parFlag2)
1 41 flagParamsPositional = parm.coord.hemisphere;
42 else
43 display('Using Default Positional RFI flagging parameters');
44 flagParamsPositional = 1;
45 end
46
47
1 48 [d,q] = logcal(d, 'rfi');
1 49 if (q)
50 disp('RFI flagging has already been applied')
51 disp(' ')
52 d=checkstatus(d);
53 return
54 end
55
56 % Deglitch Flagging (not yet migrated to here...):
57 % XXX
58
59 %---------------------------------------------
60 % Positional Flagging:
61 %---------------------------------------------
24.78 1 62 [horzFlag satFlag sunFlag moonFlag] = flagRFI_pos(d,flagParamsPositional);
0.01 1 63 preFlag = horzFlag | satFlag | sunFlag | moonFlag;
64
1 65 flags.old.bit = d.flags.bit;
0.01 1 66 flags.new.bit.fast = repmat(preFlag, [1 3]);
67
0.03 1 68 setPlotDisplay(plotparams.plot);
69 % plot the positional flagging
5.73 1 70 [d, outFlags] = packd(d, flags, 'none', 'positional', plotparams, ...
71 'Positional Flagging Plots', field, []);
72
73 % user positional flags
0.05 1 74 userPosFlags = (outFlags.new.out>0) - (flags.new.bit.fast>0) ~= 0;
0.03 1 75 userPosVec = sum(userPosFlags,2)>0;
76
77 % set all of these bits accordingly
0.08 1 78 d = setNewFlag(d, repmat(horzFlag, [1 3]), 'horizon');
0.14 1 79 d = updateFlags(d, 1);
80
0.08 1 81 d = setNewFlag(d, repmat(satFlag, [1 3]), 'satellite');
0.15 1 82 d = updateFlags(d, 1);
83
0.07 1 84 d = setNewFlag(d, repmat(sunFlag, [1 3]), 'sun');
0.14 1 85 d = updateFlags(d, 1);
86
0.08 1 87 d = setNewFlag(d, repmat(moonFlag, [1 3]), 'moon');
0.13 1 88 d = updateFlags(d, 1);
89
0.05 1 90 d = setNewFlag(d, userPosFlags, 'pos_user');
0.15 1 91 d = updateFlags(d, 1);
92
93 % add user flags to preFlag
1 94 preFlag = preFlag | userPosVec;
95
96 %---------------------------------------------
97 % Statistical Flagging:
98 %---------------------------------------------
1 99 display('Statistical RFI Flagging');
5.90 1 100 flag = flagRFI_std(d,preFlag,flagParamsRfi);
1 101 flags.old.bit = d.flags.bit;
1 102 flags.new.bit.fast = repmat(flag, [1 3]);
103
104 % plot the data
0.03 1 105 setPlotDisplay(plotparams.plot);
5.67 1 106 [d, outFlags] = packd(d, flags, 'none', 'rfi', plotparams, 'RFI Plots', field, []);
0.13 1 107 d = setNewFlag(d, outFlags.new.out, 'rfi');
0.13 1 108 d = updateFlags(d, 1);
109
1 110 d = logcal(d, 'rfi');
111
1 112 return;

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