This is a static copy of a profile reportHome
cutObs (18 calls, 4.645 sec)
Generated 05-Aug-2011 13:01:01 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/cutObs.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
83 | d = framecutSub(d, indRx, indS... | 18 | 3.126 s | 67.3% |  |
86 | d = mergestruct(d, buf); | 18 | 0.863 s | 18.6% |  |
77 | [indReg, indServ, indRx] = det... | 18 | 0.612 s | 13.2% |  |
80 | [d buf] = separate_fields(d); | 18 | 0.033 s | 0.7% |  |
88 | return; | 18 | 0 s | 0% |  |
All other lines | | | 0.011 s | 0.2% |  |
Totals | | | 4.645 s | 100% | |
Children (called functions)
Code Analyzer results
Line number | Message |
36 | This statement (and possibly following ones) cannot be reached. |
53 | STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY). |
62 | STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY). |
67 | STRMATCH will be removed in a future release. Replace STRMATCH(STR, STRARRAY, 'exact') with STRCMP(STR, STRARRAY). |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 88 |
Non-code lines (comments, blank lines) | 53 |
Code lines (lines that can run) | 35 |
Code lines that did run | 25 |
Code lines that did not run | 10 |
Coverage (did run/can run) | 71.43 % |
Function listing
time calls line
1 function [d indRx] = cutObs(d, type, logical)
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 %
5 % function [d indRx] = cutObs(d, type, logical)
6 %
7 % cuts the corresponding to a given observation type, given by the
8 % logical.
9 %
10 % valid types: 'source','elscan', 'calibrator', 'abscal', 'blank', 'skydip',
11 % 'radio_point_cross', 'radio_point_scan',
12 % 'opt_point', 'beammap', 'noise_event', 'noise'
13 %
14 % valid logical: 'only', 'and', 'or', 'not'
15 %
16 % for example:
17 % for data that is labelled 'skydip', regardless of what other features
18 % are set:
19 % d = cutObs(d, 'skydip', 'or');
20 % if you want data that is only labelled as 'skydip', call
21 % as: (keep in mind that some data is taken with many different labels.
22 % d = cutObs(d, 'skydip', 'only');
23
24 % for data on 'calibrator' or 'noise', cutObs(d, {'calibrator', 'noise'},
25 % 'or');
26 % for noise observations on a source only (not on calibrator):
27 % cutObs(d, {'noise', 'source'}, 'and');
28 %
29 % for all observations that are not the noise source:
30 % cutObs(d, 'noise', 'not');
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32
33 %check the inputs
18 34 if(nargin<2)
35 error('Wrong number of inputs');
36 help cutObs
18 37 elseif(nargin==2)
38 logical = 'or';
39 end
40
41 % change type to a cell array if only one input
18 42 if(ischar(type))
18 43 newType{1} = type;
18 44 type = newType;
18 45 end
46
47 % check that all types are valid.
18 48 validTypes = {'source', 'elscan','calibrator', 'abscal', 'blank', 'skydip', ...
49 'radio_point_cross', 'radio_point_scan', ...
50 'opt_point', 'beammap', 'noise_event', 'noise'};
18 51 typeValid = zeros(1,length(type));
18 52 for m=1:length(type)
18 53 if(~isempty(strmatch(type(m), validTypes, 'exact')))
18 54 typeValid(m) = 1;
18 55 end
18 56 end
18 57 if(~all(typeValid))
58 error('Invalid type');
59 end
60
61 % 'only' option only works for a single type input
18 62 if(strmatch(logical, 'only', 'exact'))
17 63 if(length(type)>1)
64 error('Current function supports the ''only'' option for single type');
65 end
17 66 end
18 67 if(strmatch(logical, 'not', 'exact'))
1 68 if(length(type)>1)
69 error('Current function supports the ''only'' option for single type');
70 end
1 71 end
72
73
74
75 % first determine the arrays on which to cut.
76 % determine the corresponding inds for each data size
0.61 18 77 [indReg, indServ, indRx] = determineInd(d, type, logical);
78
79 % remove fields that we can't cut
0.03 18 80 [d buf] = separate_fields(d);
81
82 % cut them
3.13 18 83 d = framecutSub(d, indRx, indServ, indReg);
84
85 % add ones we couldn't cut back in
0.86 18 86 d = mergestruct(d, buf);
87
18 88 return;
Other subfunctions in this file are not included in this listing.