This is a static copy of a profile reportHome
tauCalWrapper (1 call, 2.383 sec)
Generated 05-Aug-2011 13:01:17 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/support/tauCalWrapper.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 |
96 | d.correction.tau.theory = calc... | 1 | 1.333 s | 56.0% |  |
33 | tauVals = calculateTau(d); | 1 | 0.623 s | 26.1% |  |
45 | [d tauflags] = packd(d, taufla... | 1 | 0.328 s | 13.8% |  |
88 | allTau = load([home,'/',insta... | 1 | 0.044 s | 1.8% |  |
42 | setPlotDisplay(plotparams.plot... | 1 | 0.033 s | 1.4% |  |
All other lines | | | 0.022 s | 0.9% |  |
Totals | | | 2.383 s | 100% | |
Children (called functions)
Code Analyzer results
Line number | Message |
1 | Extra semicolon is unnecessary. |
27 | The value assigned to variable 'flagParams' might be unused. |
30 | The value assigned to variable 'flagParams' might be unused. |
30 | Use of brackets [] is unnecessary. Use parentheses to group, if needed. |
35 | Using ISEMPTY is usually faster than comparing LENGTH to 0. |
64 | The value assigned to variable 'tauVals' might be unused. |
76 | Use && instead of & as the AND operator in (scalar) conditional statements. |
89 | The value assigned to variable 'allTau' might be unused. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 104 |
Non-code lines (comments, blank lines) | 51 |
Code lines (lines that can run) | 53 |
Code lines that did run | 33 |
Code lines that did not run | 20 |
Coverage (did run/can run) | 62.26 % |
Function listing
time calls line
1 function d = tauCalWrapper(d, plotparams, parm, field);
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 %
5 % function d = tauCalWrapper(d, plotparams, parm, field);
6 %
7 % reduceData function that calculates the opacity and removes the effect
8 % of the sky
9 %
10 % sjcm
11 %
12 % 3/30/2011 sjcm: saving plots without displaying
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14
1 15 [d,q] = logcal(d, 'tau');
1 16 if (q)
17 disp('Tau correction has been applied');
18 disp(' ')
19 d=checkstatus(d);
20 return
21 end
22
23 % check if we have the flagging parameters
1 24 parFlag = checkpar(parm, 'tau');
25
1 26 if(parFlag)
1 27 flagParams = [parm.tau.sigma];
28 else
29 display('Using Default tau parameters');
30 flagParams = [3];
31 end
32
0.62 1 33 tauVals = calculateTau(d);
34
1 35 if(length(tauVals)==0)
36 disp('No sky dips found, so no tau correction has been applied, continuing...');
37 return;
38 end
39
40 % next we flag on these values, before applying them to the data.
1 41 d.correction.tau.values = tauVals;
0.03 1 42 setPlotDisplay(plotparams.plot);
1 43 tauflags = zeros(size(tauVals,1), 2);
44
0.33 1 45 [d tauflags] = packd(d, tauflags, 'none', 'tau', plotparams, 'Opacity Plots', field);
46
1 47 d.correction.tau.flag = tauflags;
48
49 % check again that user flagging hasn't made all the data bad.
1 50 if(all(d.correction.tau.flag(:)))
51 display('ATTENTION --- ATTENTION --- ATTENTION');
52 display('No good tsys values in your data');
53 display('This data set will not be used for calibration');
54 d.correction.tau.allbad = 1;
1 55 else
1 56 d.correction.tau.allbad = 0;
1 57 end
58
59
60
61 if(0)
62 % first we calculate the opacities.
63 addpath /home/cbass/mel/Mytests
64 tauVals = calculateTauTest(d);
65
66 % do auto flagging
67 %d = flagTau(tauVals, flagParams);
68
69 end
70
1 71 [home,installeddir]=where_am_i();
72
73 % last we save the tau values we calculate
1 74 parFlag = checkpar(parm, 'autosave');
1 75 if(parFlag)
1 76 if(parm.autosave.flag & d.correction.tau.allbad==0)
1 77 thisTau = d.correction.tau.values;
1 78 f = find(d.correction.tau.flag(:,1));
1 79 if(~isempty(f))
80 thisTau(f,4) = nan;
81 end
1 82 f = find(d.correction.tau.flag(:,2));
1 83 if(~isempty(f))
84 thisTau(f,5) = nan;
85 end
86 % make sure file is up-to-date
87 %system('cvs update constants/tau_values.txt');
0.04 1 88 allTau = load([home,'/',installeddir,'/constants/tau_values.txt']);
0.01 1 89 allTau = [allTau; thisTau];
0.01 1 90 save([home,'/',installeddir,'/constants/tau_values.txt'],'allTau', '-ascii','-single');
91 %system('cvs commit -m "update" constants/tau_values.txt');
1 92 end
1 93 end
94
95 % fix for now
1.33 1 96 d.correction.tau.theory = calcOpacity(5, d.array.weather.airTemperature+273.15, ...
97 d.array.weather.relativeHumidity, length(d.array.weather.airTemperature), 1);
98
99
100 % log that it has been applied
1 101 d = logcal(d, 'tau');
102
103
1 104 return;
Other subfunctions in this file are not included in this listing.