This is a static copy of a profile reportHome
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 Name | Function Type | Calls |
packd | function | 2 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
147 | eval(sprintf('print -dpng -r20... | 2 | 3.519 s | 36.0% |  |
100 | [boo, coo, h(pageNum, plotNum,... | 30 | 2.022 s | 20.7% |  |
105 | [boo1, coo1, h(pageNum, plotNu... | 30 | 1.924 s | 19.7% |  |
123 | axis([1.15 1.25 0.9*(minY) 1.1... | 6 | 0.437 s | 4.5% |  |
118 | thisY = 2*abs(coo(1:NFFT/2+1,... | 6 | 0.317 s | 3.2% |  |
All other lines | | | 1.563 s | 16.0% |  |
Totals | | | 9.782 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
plot_powerspec | function | 60 | 3.891 s | 39.8% |  |
print | function | 2 | 3.519 s | 36.0% |  |
axis | function | 6 | 0.426 s | 4.4% |  |
title | function | 30 | 0.273 s | 2.8% |  |
xlabel | function | 30 | 0.240 s | 2.5% |  |
ylabel | function | 30 | 0.219 s | 2.2% |  |
subplot | function | 30 | 0.208 s | 2.1% |  |
gtitle | function | 2 | 0 s | 0% |  |
hold | function | 30 | 0 s | 0% |  |
setwinsize | function | 2 | 0 s | 0% |  |
gcf | function | 4 | 0 s | 0% |  |
getMainDir | function | 2 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 1.006 s | 10.3% |  |
Totals | | | 9.782 s | 100% | |
Code Analyzer results
Line number | Message |
1 | Input argument 'xc' might be unused, although a later one is used. Consider replacing it by ~. |
1 | Input argument 'ax' might be unused, although a later one is used. Consider replacing it by ~. |
1 | Input argument 'prop' might be unused, although a later one is used. Consider replacing it by ~. |
1 | Extra semicolon is unnecessary. |
32 | EXIST with two input arguments is generally faster and clearer than with one input argument. |
33 | The value assigned to variable 'ax' might be unused. |
56 | The value assigned to variable 'num' might be unused. |
88 | The value assigned to variable 'timeVal' might be unused. |
91 | The value assigned to variable 'fmode' might be unused. |
91 | Use TRUE or FALSE instead of LOGICAL(1) or LOGICAL(0). |
100 | The variable 'h' appears to change size on every loop iteration. Consider preallocating for speed. |
100 | The value assigned to variable 'NFFT' might be unused. |
105 | The value assigned here to 'boo1' appears to be unused. Consider replacing it by ~. |
105 | The variable 'h' appears to change size on every loop iteration. Consider preallocating for speed. |
111 | The value assigned to variable 'ff' might be unused. |
114 | The variable 'leg' appears to change size on every loop iteration. Consider preallocating for speed. |
115 | The variable 'leg' appears to change size on every loop iteration. Consider preallocating for speed. |
127 | The variable 'leg' appears to change size on every loop iteration. Consider preallocating for speed. |
128 | The variable 'leg' appears to change size on every loop iteration. Consider preallocating for speed. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 154 |
Non-code lines (comments, blank lines) | 69 |
Code lines (lines that can run) | 85 |
Code lines that did run | 73 |
Code lines that did not run | 12 |
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.