This is a static copy of a profile report

Home

plot_sources (1 call, 1.650 sec)
Generated 05-Aug-2011 13:00:28 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/plotting/plot_sources.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
packdfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
31
testData = framecut(d,test);
20.765 s46.4%
61
noise = framecut(d,d.index.noi...
10.175 s10.6%
93
linkaxes(ax,'x');
10.164 s9.9%
49
skydip = framecut(d,d.index.sk...
10.164 s9.9%
75
legend(h,sources(1:length(sour...
10.087 s5.3%
All other lines  0.295 s17.9%
Totals  1.650 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
framecutfunction41.104 s66.9%
linkaxesfunction10.153 s9.3%
legendfunction10.087 s5.3%
ylabelfunction30.055 s3.3%
subplotfunction30.055 s3.3%
titlefunction10.044 s2.6%
newplotfunction60.022 s1.3%
holdfunction20.011 s0.7%
xlabelfunction10 s0%
num2strfunction10 s0%
cellstrfunction20 s0%
lineseriesfunction60 s0%
cell.uniquefunction10 s0%
Self time (built-ins, overhead, etc.)  0.120 s7.3%
Totals  1.650 s100% 
Code Analyzer results
Line numberMessage
21Terminate statement with semicolon to suppress output (in functions).
33The variable 'h' appears to change size on every loop iteration. Consider preallocating for speed.
46Using ISEMPTY is usually faster than comparing LENGTH to 0.
58Using ISEMPTY is usually faster than comparing LENGTH to 0.
70The value assigned to variable 'j' might be unused.
Coverage results
[ Show coverage for parent directory ]
Total lines in function93
Non-code lines (comments, blank lines)53
Code lines (lines that can run)40
Code lines that did run38
Code lines that did not run2
Coverage (did run/can run)95.00 %
Function listing
   time   calls  line
1 function [sources] = plot_sources(d,channel)
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 % function [sources] = plot_sources(d,channel)
5 %
6 % Function to plot data and identify which sources have been observed
7 % Particularly useful for seeing what calibrator sources were looked at
8 %
9 % act - 16/7/2010
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12
13
14 % To plot the source data and name it - names of sources are stored in
15 % d.antenna0.tracker.source
16 % The associated times of these frames is in:
17 % d.antenna0.tracker.utc
18
19 %First find sources observed
20
1 21 sources = unique(d.antenna0.tracker.source)
22
0.02 1 23 ax(1) = subplot(4,1,1:2);
24
1 25 for i = 1:length(sources);
26
2 27 test = strcmp(sources(i),d.antenna0.tracker.source);
28
29 % Grab the data for this source and plot it
30
0.77 2 31 testData = framecut(d,test);
32
0.03 2 33 h(i)=plot(ax(1),testData.antenna0.receiver.utc,testData.antenna0.receiver.data(:,channel),'p');
34
0.01 2 35 hold all
2 36 clear test
0.01 2 37 clear testData;
38
2 39 end
40
41 % Now add places where there is skydips and noise cal
42 % First we see if there's any skydip data
43
1 44 j=i+1;
45
0.01 1 46 if(length(find(d.index.skydip.fast))==0)
47 display('no sky dips in your data');
1 48 else
0.16 1 49 skydip = framecut(d,d.index.skydip.fast);
1 50 h(j) = plot(ax(1),skydip.antenna0.receiver.utc,skydip.antenna0.receiver.data(:,channel),'kp');
1 51 clear skydip;
1 52 sources(j) = cellstr('skydip')';
1 53 j = j+1;
1 54 end
55
56 %Next look for noise source data
57
1 58 if(length(find(d.index.noise.fast))==0)
59 display('no noise source events in your data');
1 60 else
0.17 1 61 noise = framecut(d,d.index.noise.fast);
0.01 1 62 h(j) = plot(ax(1),noise.antenna0.receiver.utc,noise.antenna0.receiver.data(:,channel), ...
63 'mo', ...
64 'LineWidth',2,...
65 'MarkerEdgeColor','m',...
66 'MarkerFaceColor',[.49 1 .63],...
67 'MarkerSize',8);
1 68 clear noise;
1 69 sources(j) = cellstr('noise');
1 70 j = j+1;
1 71 end
72
73
74 % Update legend names
0.09 1 75 legend(h,sources(1:length(sources)) );
76 %xlabel('UTC');
0.05 1 77 ylabel('Nominal units');
0.04 1 78 title(['Channel ', num2str(channel) ,' raw data']);
79
80 % Also plot the azimuth and elevation tied to the same x -axis
81
0.02 1 82 ax(2) = subplot(4,1,3);
83
0.04 1 84 plot(ax(2),d.antenna0.receiver.utc, d.antenna0.servo.el);
1 85 ylabel('Elevation, deg');
86
0.01 1 87 ax(3) = subplot(4,1,4);
88
0.02 1 89 plot(ax(3),d.antenna0.receiver.utc, d.antenna0.servo.az);
1 90 ylabel('Azimuth, deg');
1 91 xlabel('UTC')
92
0.16 1 93 linkaxes(ax,'x');