This is a static copy of a profile reportHome
loadWrapper (1 call, 12.209 sec)
Generated 05-Aug-2011 13:01:16 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/support/loadWrapper.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 |
79 | d = packd(d, [], 'none', 'load... | 1 | 8.383 s | 68.7% |  |
39 | [K, shift] = calc_loadcorrect_... | 1 | 2.219 s | 18.2% |  |
68 | d = apply_loadcorrect_final(do... | 1 | 1.476 s | 12.1% |  |
48 | allLoad = load([home,'/',inst... | 1 | 0.055 s | 0.4% |  |
75 | setPlotDisplay(plotparams.plot... | 1 | 0.033 s | 0.3% |  |
All other lines | | | 0.044 s | 0.4% |  |
Totals | | | 12.209 s | 100% | |
Children (called functions)
Code Analyzer results
Line number | Message |
1 | Extra semicolon is unnecessary. |
25 | The value assigned to variable 'flagParams' might be unused. |
28 | The value assigned to variable 'flagParams' might be unused. |
28 | Use of brackets [] is unnecessary. Use parentheses to group, if needed. |
37 | To improve performance, replace ISEMPTY(FIND(X)) with ISEMPTY(FIND( X, 1 )). |
49 | The value assigned to variable 'allLoad' might be unused. |
58 | The value assigned to variable 'allLoad' might be unused. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 86 |
Non-code lines (comments, blank lines) | 41 |
Code lines (lines that can run) | 45 |
Code lines that did run | 28 |
Code lines that did not run | 17 |
Coverage (did run/can run) | 62.22 % |
Function listing
time calls line
1 function d = loadWrapper(d, plotparams, parm, field);
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 %
5 % function d = loadWrapper(d, plotparams, parm, field);
6 %
7 % reduceData function that removes the variation of the cold load
8 %
9 % sjcm
10 %
11 % 3/30/2011 sjcm: saving plots without displaying
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13
1 14 [d,q] = logcal(d, 'load');
1 15 if (q)
16 disp('Load correction has been applied');
17 disp(' ')
18 % d=checkstatus(d);
19 return
20 end
21
1 22 parFlag = checkpar(parm, 'load');
23
1 24 if(parFlag)
1 25 flagParams = [parm.load.residual];
26 else
27 display('Using Default load cal parameters');
28 flagParams = [10];
29 end
30
31 % first we calculate and apply the load correction
1 32 dorig = d;
33
1 34 [home,installeddir]=where_am_i();
35
1 36 numDims = size(dorig.antenna0.receiver.data,2);
0.01 1 37 if(~isempty(find(d.index.blank.slow)))
38 % calculate the correction
2.22 1 39 [K, shift] = calc_loadcorrect_final(dorig);
40 % save it if desired
1 41 parFlag = checkpar(parm, 'autosave');
1 42 if(parFlag)
1 43 if(parm.autosave.flag)
1 44 switch numDims
1 45 case 10
1 46 thisLoad = [dorig.array.frame.utc(1) K shift];
47 %system('cvs update constants/load_correction_values_10.txt');
0.05 1 48 allLoad = load([home,'/',installeddir,'/constants/load_correction_values_10.txt']);
1 49 allLoad = [allLoad; thisLoad];
0.01 1 50 save([home,'/',installeddir,'/constants/load_correction_values_10.txt'], 'allLoad', '-ascii', '-single')
51
52 %system('cvs commit -m "update" constants/load_correction_values_10.txt');
53
54 case 8
55 thisLoad = [dorig.array.frame.utc(1) K shift];
56 %system('cvs update constants/load_correction_values_8.txt');
57 allLoad = load([home,'/',installeddir,'/constants/load_correction_values_8.txt']);
58 allLoad = [allLoad; thisLoad];
59 save([home,'/',installeddir,'/constants/load_correction_values_8.txt'], 'allLoad', '-ascii', '-single')
60 %system('cvs commit -m "update" constants/load_correction_values_8.txt');
61 end
1 62 end
1 63 end
64 else
65 [K shift] = getLoadCorrection(d);
66 end
67
1.48 1 68 d = apply_loadcorrect_final(dorig, K, shift);
69
70 % flag to make sure it's good
71 % dcorr = flagLoad(dcorr, d, flagParams);
72
73 % next we plot to see if there was any effect at all
74
0.03 1 75 setPlotDisplay(plotparams.plot);
1 76 display('Plotting Power Spectrum');
1 77 display('No flagging will be allowed');
78
8.38 1 79 d = packd(d, [], 'none', 'load_cal', plotparams, 'Load Plots', field,dorig);
80
81
82 % log that it has been applied
1 83 d = logcal(d, 'load');
84
85
1 86 return;
Other subfunctions in this file are not included in this listing.