This is a static copy of a profile reportHome
read_arc (1 call, 4.033 sec)
Generated 05-Aug-2011 13:00:28 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/read_arc.m
Copy to new window for comparing multiple runs
Parents (calling functions)
No parent Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
117 | d = cbassMatReadArcOpt(regs, m... | 1 | 2.033 s | 50.4% |  |
126 | d = interpRegisters(d); | 1 | 0.787 s | 19.5% |  |
120 | d = massageData(d); | 1 | 0.492 s | 12.2% |  |
129 | d = cutDesiredData(d, mjdstart... | 1 | 0.361 s | 8.9% |  |
123 | d = reshapeRegisters(d); | 1 | 0.262 s | 6.5% |  |
All other lines | | | 0.098 s | 2.4% |  |
Totals | | | 4.033 s | 100% | |
Children (called functions)
Code Analyzer results
Line number | Message |
14 | EXIST with two input arguments is generally faster and clearer than with one input argument. |
17 | EXIST with two input arguments is generally faster and clearer than with one input argument. |
20 | EXIST with two input arguments is generally faster and clearer than with one input argument. |
91 | IF might not be aligned with its matching END (line 93). |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 131 |
Non-code lines (comments, blank lines) | 98 |
Code lines (lines that can run) | 33 |
Code lines that did run | 31 |
Code lines that did not run | 2 |
Coverage (did run/can run) | 93.94 % |
Function listing
time calls line
1 function d = read_arc(start, finish, regs, arcdir, calfile)
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 % function d = read_arc(start, finish, regs, arcdir, calfile)
5 %
6 % start/finish=start finish times as strings with format e.g.:
7 % 01-Jan-2005:00:00:00
8 % optional regs=regs to extract if other than the standard set
9 % optional arcdir=directory containing archive files
10 % optional calfile=cal file
11 %
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13
1 14 if(~exist('regs'))
1 15 regs=[];
1 16 end
0.01 1 17 if(~exist('arcdir'))
1 18 arcdir=[];
1 19 end
1 20 if(~exist('calfile'))
1 21 calfile=[];
1 22 end
23
1 24 if(isempty(regs))
1 25 regs={'array.frame.received'...
26 'array.frame.utc double',...
27 'array.frame.features',...
28 'array.weather.utc double',...
29 'array.weather.pressure double',...
30 'array.weather.airTemperature double',...
31 'array.weather.windSpeed[0] double',...
32 'array.weather.windDirection[0] double',...
33 'array.weather.status double',...
34 'array.weather.relativeHumidity double',...
35 'antenna0.thermal.ccHeaterCurrent double',...
36 'antenna0.thermal.lsTemperatureSensors double',...
37 'antenna0.thermal.ccTemperatureLoad double',...
38 'antenna0.thermal.utc double',...
39 'antenna0.thermal.dlpTemperatureSensors double',...
40 'antenna0.tracker.lst double',...
41 'antenna0.tracker.lacking double',...
42 'antenna0.tracker.equat_geoc double',...
43 'antenna0.tracker.horiz_topo double',...
44 'antenna0.tracker.horiz_mount double',...
45 'antenna0.tracker.flexure double',...
46 'antenna0.tracker.horiz_off double',...
47 'antenna0.tracker.tilts double',...
48 'antenna0.tracker.fixedCollimation double',...
49 'antenna0.tracker.encoder_off double',...
50 'antenna0.tracker.sky_xy_off double',...
51 'antenna0.tracker.source string',...
52 'antenna0.tracker.scan_off double',...
53 'antenna0.tracker.refraction double',...
54 'antenna0.tracker.ut1utc double',...
55 'antenna0.tracker.eqneqx double',...
56 'antenna0.tracker.utc double',...
57 'antenna0.tracker.time_diff double',...
58 'antenna0.tracker.offSource double',...
59 'antenna0.tracker.siteActual double',...
60 'antenna0.tracker.siteFiducial double',...
61 'antenna0.servo.utc double',...
62 'antenna0.servo.slow_az_pos double',...
63 'antenna0.servo.slow_el_pos double',...
64 'antenna0.servo.fast_az_pos double',...
65 'antenna0.servo.fast_el_pos double',...
66 'antenna0.servo.fast_az_err double',...
67 'antenna0.servo.fast_el_err double',...
68 'antenna0.servo.command_current_az1[0] double',...
69 'antenna0.servo.command_current_az2[0] double',...
70 'antenna0.servo.command_current_el1[0] double',...
71 'antenna0.servo.actual_current_az1[0] double',...
72 'antenna0.servo.actual_current_az2[0] double',...
73 'antenna0.servo.actual_current_el1[0] double',...
74 'antenna0.servo.enable_status_az1',...
75 'antenna0.servo.enable_status_az2',...
76 'antenna0.servo.enable_status_el1',...
77 'antenna0.frame.utc double',...
78 'antenna0.frame.received double',...
79 'antenna0.receiver.flags double',...
80 'antenna0.receiver.utc double',...
81 'antenna0.receiver.data double',...
82 'antenna0.receiver.switchData double',...
83 'antenna0.receiver.diagnostics double',...
84 'antenna0.receiver.drainCurrent double',...
85 'antenna0.receiver.drainVoltage double',...
86 'antenna0.receiver.gateVoltage double',...
87 };
1 88 end
89
90 % Ensure regs unique
0.01 1 91 if(any(size(unique(regs))~=size(regs)))
92 error('regs should be unique');
93 end
94
95 % Here we want to have the function know which directory to look for the
96 % data depending on the machine name.
0.01 1 97 [defaultDataDir defaultCalFile defaultReaderPath] = whichHost();
98
1 99 if(isempty(arcdir))
100
1 101 arcdir = defaultDataDir;
1 102 end
1 103 if(isempty(calfile))
1 104 calfile = defaultCalFile;
1 105 end
106
0.03 1 107 eval(sprintf('addpath %s', defaultReaderPath));
108
109 % let's get the previous 5 seconds and post 5 seconds, and then cut it down
110 % to the right size.
0.03 1 111 mjdstartorig = tstr2mjd(start);
1 112 mjdstart = mjdstartorig - 5/60/60/24;
1 113 mjdstoporig = tstr2mjd(finish);
1 114 mjdstop = mjdstoporig + 5/60/60/24;
115
116 %display('cbassMatReadArcOpt')
2.03 1 117 d = cbassMatReadArcOpt(regs, mjd2string(mjdstart), mjd2string(mjdstop), arcdir, calfile);
118
119 %display('MassageData')
0.49 1 120 d = massageData(d);
121 %display('reshapeResgister');
122 % reshape the registers
0.26 1 123 d = reshapeRegisters(d);
124 %display('interpRegisters');
125 % interpolate as needed.
0.79 1 126 d = interpRegisters(d);
127 %display('cut Desired Date');
128 % cut to the desired data
0.36 1 129 d = cutDesiredData(d, mjdstartorig, mjdstoporig);
130
1 131 return;
Other subfunctions in this file are not included in this listing.