This is a static copy of a profile reportHome
webpipe (1 call, 4.656 sec)
Generated 05-Aug-2011 13:00:33 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/support/webpipe.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 |
45 | info=skim(d,0); | 1 | 4.449 s | 95.5% |  |
165 | subpages(subdir,maindir,m); | 20 | 0.142 s | 3.1% |  |
176 | haggisdir=strcat('~cbassuser/w... | 1 | 0.011 s | 0.2% |  |
171 | printpar(fid,d); | 1 | 0.011 s | 0.2% |  |
125 | if(isfield(d.correction, 'gain... | 1 | 0.011 s | 0.2% |  |
All other lines | | | 0.033 s | 0.7% |  |
Totals | | | 4.656 s | 100% | |
Children (called functions)
Code Analyzer results
Line number | Message |
1 | Input argument 'rn' might be unused, although a later one is used. Consider replacing it by ~. |
24 | The value assigned to variable 'mon' might be unused. |
27 | The value assigned to variable 'mon' might be unused. |
30 | The value assigned to variable 'day' might be unused. |
33 | The value assigned to variable 'day' might be unused. |
36 | The value assigned here to 'r' appears to be unused. Consider replacing it by ~. |
37 | The value assigned to variable 'usr' might be unused. |
105 | The format string might not agree with the argument count. |
110 | STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY). |
117 | STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY). |
124 | STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY). |
131 | STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY). |
131 | Use && instead of & as the AND operator in (scalar) conditional statements. |
142 | Use || instead of | as the OR operator in (scalar) conditional statements. |
142 | Use || instead of | as the OR operator in (scalar) conditional statements. |
142 | Use || instead of | as the OR operator in (scalar) conditional statements. |
142 | Use || instead of | as the OR operator in (scalar) conditional statements. |
142 | Use || instead of | as the OR operator in (scalar) conditional statements. |
176 | The value assigned to variable 'haggisdir' might be unused. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 184 |
Non-code lines (comments, blank lines) | 76 |
Code lines (lines that can run) | 108 |
Code lines that did run | 105 |
Code lines that did not run | 3 |
Coverage (did run/can run) | 97.22 % |
Function listing
time calls line
1 function webpipe(d, field, rn,sched_name)
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 %
5 % function webpipe(d, field, rn)
6 %
7 % d is the reduced data set
8 % field is the fieldname you used in reducing the data
9 % rn is the reduction number (ignored)
10 % sched_name is an optional name for the scedule, which will get printed in the index.html
11 %
12 % sjcm
13 % jl
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1 15 rn=1;
16
1 17 subdir={'intro', 'flags', 'intent', 'pointing', 'deglitch', 'positional', 'rfi', 'mains', 'alpha', 'rfactor', 'load', ...
18 'tau', 'tsys', 'gain', 'noise', 'astro', 'power', 'overf', 'rms', ...
19 'map','fits'};
20
1 21 month = getmonth;
1 22 start = mjd2date_v2(d.array.frame.utc(1));
23
1 24 mon=num2str(start.month);
1 25 if (start.month<10)
26 mon=num2str(start.month);
27 mon=strcat('0',mon);
28 end
29
1 30 day=num2str(start.day);
1 31 if (start.day<10)
1 32 day=num2str(start.day);
0.01 1 33 day=strcat('0',day);
1 34 end
35
0.01 1 36 [r,home]=unix('printenv HOME');
1 37 usr=home(7:end-1);
38
1 39 maindir = getMainDir(d, field);
1 40 fn=strcat(maindir,'/','index.html');
41
1 42 fid=fopen(fn,'w');
1 43 header(fid);
44
4.45 1 45 info=skim(d,0);
1 46 start=info.track.start;
1 47 stop=info.track.stop;
48
1 49 fprintf(fid,'<a href="../">Home</a>\n\n');
50
1 51 fprintf(fid,sprintf('<p>reduceData Version %s<p>\n\n',d.rev));
1 52 fprintf(fid,'<pre>\n');
1 53 fprintf(fid,' Track Summary\n');
1 54 fprintf(fid,'================================================================\n');
1 55 fprintf(fid,'Observation schedule\n');
1 56 fprintf(fid,' Schedule Name: %s \n',sched_name);
1 57 fprintf(fid,sprintf(' Start: %2u-%s-%4u:%2u:%2u:%2u\n',start.day,month{start.month},...
58 start.year, start.hour, start.minute, round(start.second)));
1 59 fprintf(fid,sprintf(' Stop: %2u-%s-%4u:%2u:%2u:%2u\n',stop.day,month{stop.month},...
60 stop.year, stop.hour, stop.minute, round(stop.second)));
1 61 fprintf(fid,' Number of Scans: %d\n', info.track.numScans);
1 62 fprintf(fid,' Total time of Track: %2.2f\n', info.track.intTime);
1 63 fprintf(fid,' Percent of total Data Flagged: %2.2f\n', info.track.perFlag);
64
65
1 66 fprintf(fid, '\n');
1 67 fprintf(fid, '\n');
68
1 69 fprintf(fid,'</pre>\n');
70
1 71 fprintf(fid,'<table border="1">\n');
72
1 73 fprintf(fid,'<tr>\n');
1 74 fprintf(fid,'<td> <b> Routine </b> </td> <td> <b> Integration [min] </b> </td> <td> <b> Percent Flagged </b> </td>\n');
75
1 76 fprintf(fid,'</tr>\n');
77
1 78 names = fieldnames(info);
1 79 for m=1:length(names)
14 80 thisName = names{m};
14 81 eval(sprintf('thisData = info.%s;', thisName));
82
14 83 if (m~=14)
13 84 fprintf(fid,'<tr>\n');
85
13 86 fprintf(fid,'<td> %s </td>',thisName);
13 87 fprintf(fid,'<td> %8.2f </td>',thisData.intTime);
13 88 fprintf(fid,'<td> %8.2f </td>\n',thisData.perFlag);
13 89 fprintf(fid,'</tr>\n');
13 90 end
91
14 92 end
93
1 94 fprintf(fid,'</table>\n');
95
96
97
98
1 99 fprintf(fid, '\n');
1 100 fprintf(fid, '\n');
1 101 fprintf(fid,'<table border="1">\n');
102
1 103 fprintf(fid,'<tr>\n');
104
0.01 1 105 fprintf(fid,'<td> <b> Routine </b> </td> <td> <b> Flag \% I1 </b> </td> <td> <b> Flag \% Pol </b> </td> <td> <b> Flag \% I2 </b> </td> \n');
1 106 fprintf(fid,'</tr>\n');
107
1 108 names = fieldnames(info.flag);
1 109 for m=1:length(names)
18 110 if(strmatch(names{m}, 'tsys', 'exact'))
1 111 if(isfield(d.correction, 'tsys'))
1 112 txt = sprintf('<tr> <td> tsys </td> <td> %d of %d measurements </td> <td> </td> <td> </td> </tr>\n', ...
113 length(find(d.correction.tsys.flag)), ...
114 length(find(d.correction.tsys.val)));
1 115 fprintf(fid, txt);
1 116 end
17 117 elseif(strmatch(names{m}, 'noise', 'exact'))
1 118 if(isfield(d.correction, 'tsys'));
1 119 txt = sprintf('<tr> <td> Noise diode </td> <td> %d of %d measurements </td> <td> </td> <td> </td> </tr>\n', ...
120 length(find(d.correction.tsys.flag)), ...
121 length(find(d.correction.tsys.val)));
1 122 fprintf(fid, txt);
1 123 end
16 124 elseif(strmatch(names{m}, 'gain', 'exact'))
0.01 1 125 if(isfield(d.correction, 'gain'))
1 126 txt = sprintf('<tr> <td> Gain </td> <td> %d of %d measurements </td> <td> </td> <td> </td> </tr>\n', ...
127 length(find(d.correction.gain.flag)), ...
128 length(find(d.correction.gain.val)));
1 129 fprintf(fid, txt);
1 130 end
15 131 elseif(strmatch(names{m}, 'tau', 'exact') & isfield(d.correction,'tau'))
132 % JL -possible for tau reduction stage to have been applied,
133 % but no tau field added if e.g. there are no sky dips in the data
1 134 txt = sprintf('<tr> <td> Tau </td> <td> %d of %d measurements </td> <td> </td> <td> </td> </tr> \n', ...
135 length(find(d.correction.tau.flag)), ...
136 length(find(d.correction.tau.values(:,5:6))));
1 137 fprintf(fid, txt);
14 138 else
14 139 eval(sprintf('thisData = info.flag.%s; ', names{m}));
140
141
14 142 if(m==1 | m==4 | m==6 | m==7 | m==10 | m==17)
143
6 144 txt = sprintf('<tr> <td> %s </td> <td> %4.2f </td> <td> %4.2f </td> <td> %4.2f </td> </tr> \n', names{m}, thisData(1), thisData(2), thisData(3));
8 145 else
146
8 147 txt = sprintf('<tr> <td> %s </td> <td> %4.2f </td> <td> %4.2f </td> <td> %4.2f </td> </tr>\n', names{m}, thisData(1), thisData(2), thisData(3) );
8 148 end
14 149 fprintf(fid,txt);
14 150 end
18 151 end
152
1 153 fprintf(fid,'<pre>\n');
154
1 155 fprintf(fid,'</pre>\n');
156
157 % create links to plots
158
1 159 fprintf(fid,'<p>\n');
1 160 for m=1:length(subdir)
21 161 if(m==2)
1 162 fprintf(fid,sprintf('<a href="flags.txt">%s</a><br>\n',subdir{m}));
20 163 else
20 164 fprintf(fid,sprintf('<a href="%s/fig1.html#fig1">%s</a><br>\n',subdir{m},subdir{m}));
0.14 20 165 subpages(subdir,maindir,m);
20 166 end
21 167 end
1 168 fprintf(fid,'</p>\n');
169
170
0.01 1 171 printpar(fid,d);
172
1 173 tail(fid);
174
175 % scp over to parker
0.01 1 176 haggisdir=strcat('~cbassuser/web/observations/reduced_',field,'/',sprintf('r%u/',rn));
177 %unix(sprintf('scp -r %s %s@haggis.caltech.edu:%s',maindir,usr,haggisdir));
178
179 % now delete directory
180 %unix(sprintf('rm -rf %s', maindir));
181
182
1 183 fclose(fid);
1 184 return;
Other subfunctions in this file are not included in this listing.