This is a static copy of a profile reportHome
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 Name | Function Type | Calls |
reduceData | function | 1 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
62 | [horzFlag satFlag sunFlag moon... | 1 | 24.778 s | 56.8% |  |
100 | flag = flagRFI_std(d,preFlag,f... | 1 | 5.902 s | 13.5% |  |
70 | [d, outFlags] = packd(d, flags... | 1 | 5.727 s | 13.1% |  |
106 | [d, outFlags] = packd(d, flags... | 1 | 5.673 s | 13.0% |  |
91 | d = updateFlags(d, 1); | 1 | 0.153 s | 0.4% |  |
All other lines | | | 1.377 s | 3.2% |  |
Totals | | | 43.611 s | 100% | |
Children (called functions)
Code Analyzer results
Line number | Message |
1 | Extra semicolon is unnecessary. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 112 |
Non-code lines (comments, blank lines) | 62 |
Code lines (lines that can run) | 50 |
Code lines that did run | 37 |
Code lines that did not run | 13 |
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.