This is a static copy of a profile report

Home

genfigLoad (2 calls, 9.782 sec)
Generated 05-Aug-2011 13:01:30 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/plotting/genfigLoad.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
packdfunction2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
147
eval(sprintf('print -dpng -r20...
23.519 s36.0%
100
[boo, coo, h(pageNum, plotNum,...
302.022 s20.7%
105
[boo1, coo1, h(pageNum, plotNu...
301.924 s19.7%
123
axis([1.15 1.25 0.9*(minY) 1.1...
60.437 s4.5%
118
thisY  = 2*abs(coo(1:NFFT/2+1,...
60.317 s3.2%
All other lines  1.563 s16.0%
Totals  9.782 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
plot_powerspecfunction603.891 s39.8%
printfunction23.519 s36.0%
axisfunction60.426 s4.4%
titlefunction300.273 s2.8%
xlabelfunction300.240 s2.5%
ylabelfunction300.219 s2.2%
subplotfunction300.208 s2.1%
gtitlefunction20 s0%
holdfunction300 s0%
setwinsizefunction20 s0%
gcffunction40 s0%
getMainDirfunction20 s0%
Self time (built-ins, overhead, etc.)  1.006 s10.3%
Totals  9.782 s100% 
Code Analyzer results
Line numberMessage
1Input argument 'xc' might be unused, although a later one is used. Consider replacing it by ~.
1Input argument 'ax' might be unused, although a later one is used. Consider replacing it by ~.
1Input argument 'prop' might be unused, although a later one is used. Consider replacing it by ~.
1Extra semicolon is unnecessary.
32EXIST with two input arguments is generally faster and clearer than with one input argument.
33The value assigned to variable 'ax' might be unused.
56The value assigned to variable 'num' might be unused.
88The value assigned to variable 'timeVal' might be unused.
91The value assigned to variable 'fmode' might be unused.
91Use TRUE or FALSE instead of LOGICAL(1) or LOGICAL(0).
100The variable 'h' appears to change size on every loop iteration. Consider preallocating for speed.
100The value assigned to variable 'NFFT' might be unused.
105The value assigned here to 'boo1' appears to be unused. Consider replacing it by ~.
105The variable 'h' appears to change size on every loop iteration. Consider preallocating for speed.
111The value assigned to variable 'ff' might be unused.
114The variable 'leg' appears to change size on every loop iteration. Consider preallocating for speed.
115The variable 'leg' appears to change size on every loop iteration. Consider preallocating for speed.
127The variable 'leg' appears to change size on every loop iteration. Consider preallocating for speed.
128The variable 'leg' appears to change size on every loop iteration. Consider preallocating for speed.
Coverage results
[ Show coverage for parent directory ]
Total lines in function154
Non-code lines (comments, blank lines)69
Code lines (lines that can run)85
Code lines that did run73
Code lines that did not run12
Coverage (did run/can run)85.88 %
Function listing
   time   calls  line
1 function genfigLoad(d, xc, txt, ax, prop, d0, type, field, isMains, saveplot);
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 % function function genfigLoad(d, xc, txt, ax, prop, d0, type, field,
5 % isMains, saveplot);
6 %
7 % d - data structure
8 % xc - cell element of x and y data
9 % x{odd} - x axis data
10 % x{even} - y axis data Nx1 or Nx6 or Nx24
11 % txt - axis text
12 % txt{1} - title
13 % txt{2} - x axis
14 % txt{3} - y axis
15 % txt[4} - overall title
16 % txt{5} - legend
17 % ax - manual axis settings. [xmin xmax ymin ymax]
18 % prop - initialize properties of plotting
19 % p.style = {'flag','feature'}
20 % p.swap = swap to display plots in time.
21 % p.featmask= [bitmask for style='feature']
22 % d0 - data without correction
23 % isMains - 1 for mains plotting, 0 for load
24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25
2 26 if(nargin<10)
27 saveplot = 1;
28 end
29
30
31 % check for axis setting
2 32 if (~exist('ax'))
33 ax=[];
34 end
35
2 36 if(saveplot)
37 % get the directory to write to
2 38 maindir=getmaindir(d, field);
2 39 end
40
41
42 % make it robust to switching data around for the cold load
2 43 switch(size(d0.antenna0.receiver.data,2))
2 44 case 6
1 45 vectorsToPlot = 1:6;
46
1 47 case 8
48 vectorsToPlot = [1 2 5 6 7 8];
49
1 50 case 10
1 51 vectorsToPlot = [1 2 7 8 9 10];
1 52 end
53
54 % num is the number of pages to be displayed.
55 % matrix is the size of each of the pages to be displayed.
2 56 num = 1;
2 57 if(isMains)
1 58 setwinsize(gcf, 1200, 900);
1 59 plotsPerPage = 24;
1 60 matrix = [6 4];
1 61 if(isfield(d0.antenna0.receiver, 'switchDataT'))
62 data0 = d0.antenna0.receiver.switchDataT;
63 data1 = d.antenna0.receiver.switchDataT;
1 64 else
1 65 data0 = d0.antenna0.receiver.switchData;
1 66 data1 = d.antenna0.receiver.switchData;
1 67 end
1 68 else
1 69 setwinsize(gcf, 1000, 750);
1 70 plotsPerPage = 6;
1 71 matrix = [3 2];
1 72 if(isfield(d0.antenna0.receiver, 'dataT'))
73 data0 = d0.antenna0.receiver.dataT;
74 data1 = d.antenna0.receiver.dataT;
1 75 else
0.03 1 76 data0 = d0.antenna0.receiver.data(:,vectorsToPlot);
0.04 1 77 data1 = d.antenna0.receiver.data(:,vectorsToPlot);
1 78 end
1 79 plotlabel = {'Tsky1', 'Tload1', 'Q', 'U', 'Tsky2', 'Tload2'};
1 80 end
81
2 82 plotoptions = {'b', 'g', 'r', 'c', 'm', 'y', 'k', ...
83 'b.', 'g.', 'r.', 'c.', 'm.', 'y.', 'k.', ...
84 'bo', 'go', 'ro', 'co', 'mo', 'yo', 'ko', ...
85 'bx', 'gx', 'rx', 'cx', 'mx', 'yx', 'kx'};
86
2 87 timeVal = d.antenna0.receiver.utc*24*60*60;
2 88 timeVal = timeVal - timeVal(1);
89
2 90 pageNum=1;
2 91 fmode=logical(0);
92
0.02 2 93 clear leg;
94
2 95 for plotNum=1:plotsPerPage
0.21 30 96 subplot(matrix(1),matrix(2),plotNum)
97 % plot data
30 98 optionIndex = 1;
99 % before data
2.02 30 100 [boo, coo, h(pageNum, plotNum,optionIndex) NFFT] = plot_powerspec(d, ...
101 data0(:,plotNum), 1, [], [], plotoptions{1});
102
0.01 30 103 hold on
104 % after data
1.92 30 105 [boo1, coo1, h(pageNum, plotNum,optionIndex) NFFT] = plot_powerspec(d, ...
106 data1(:,plotNum), 1, [],[], plotoptions{2});
107
108
30 109 if(~isMains)
110 % calculate the change in value
0.20 6 111 ff = find( (abs(boo-1.2)==min(abs(boo-1.2))) );
6 112 lowerBy = (abs(coo1(12584))./abs(coo(12584)))^2;
113
6 114 leg{1} = 'Before';
0.01 6 115 leg{2} = sprintf(' ''After (ratio of %2.2f)'' ', lowerBy);
116
0.27 6 117 thisY1 = 2*abs(coo1(1:NFFT/2+1,:));
0.32 6 118 thisY = 2*abs(coo(1:NFFT/2+1,:));
0.02 6 119 ff = find(boo>1.15 & boo<1.25);
6 120 minY = min([thisY(ff); thisY1(ff)]);
6 121 maxY = max([thisY(ff); thisY1(ff)]);
122
0.44 6 123 axis([1.15 1.25 0.9*(minY) 1.1*maxY]);
124
6 125 thisTitle = plotlabel{plotNum};
24 126 else
24 127 leg{1} = 'Before';
24 128 leg{2} = 'After';
24 129 thisTitle = sprintf('%s %u', txt{1}{1}, plotNum);
24 130 end
131
132
133 %set(gca,'fontsize',2)
134 %legend(leg,'Location','BestOutside');
135 %set(gca,'fontsize',5)
136
0.24 30 137 xlabel(txt{2});
0.22 30 138 ylabel(txt{3});
0.27 30 139 title(thisTitle);
30 140 end
141
2 142 gtitle(txt{4});
143
2 144 if(saveplot)
2 145 dbclear if error
2 146 set(gcf,'paperposition',[0 0 6.0 6.0])
3.52 2 147 eval(sprintf('print -dpng -r200 %s/%s/fig%u.png;', ...
148 maindir,type,pageNum));
2 149 dbstop if error
150 else
151 pause(1);
152 end
153
2 154 return;

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