This is a static copy of a profile report

Home

writeFitsMap (1 call, 7.400 sec)
Generated 05-Aug-2011 13:03:56 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/writeFitsMap.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
reduceData>writeOutFitssubfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
54
cbass_write_data(fitsFilename,...
16.154 s83.2%
42
[galacticPosn,TotRot]=coco(equ...
10.853 s11.5%
43
dataBundle = [relativeTime equ...
10.208 s2.8%
41
sunPos = sunUpDown(d.antenna0....
10.131 s1.8%
35
horizontalPosn = d.antenna0.se...
10.011 s0.1%
All other lines  0.044 s0.6%
Totals  7.400 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
cbass_write_dataMEX-file16.143 s83.0%
cocofunction10.853 s11.5%
sunUpDownfunction10.120 s1.6%
Self time (built-ins, overhead, etc.)  0.284 s3.8%
Totals  7.400 s100% 
Code Analyzer results
Line numberMessage
42The value assigned to variable 'TotRot' might be unused.
44Best practice is for CATCH to be followed by an identifier that gets the error information.
55Best practice is for CATCH to be followed by an identifier that gets the error information.
Coverage results
[ Show coverage for parent directory ]
Total lines in function60
Non-code lines (comments, blank lines)26
Code lines (lines that can run)34
Code lines that did run25
Code lines that did not run9
Coverage (did run/can run)73.53 %
Function listing
   time   calls  line
1 function scan = writeFitsMap(fitsFilename,d,batchStartMJD,batchEndMJD,thisScanNumber,totalScans,varargin)
2
3 %function to write to fits file for the Descart Mapper
4 %fitsfilenam - Name of Fits file to write data to
5 %d -standard C-BASS data struct
6 %batchStartMJD- MJD start date of the batch that will be processed (i.e
7 %more than one fits file
8 %batchEndMJD- as above
9 %thisScanNumber - which scan is this of the total data set
10 %totalScans- how many scans are there in the entire batch
11
12 % 4-Feb-2011 ACT added extra bit to allow both 6 column and 8 column calibrated.data to be
13 % written out:
14
1 15 optargin = size(varargin,2);
1 16 if(optargin>0)
1 17 flagsIn=varargin{1};
18 else
19 flagsIn=zeros(length(d.index.skydip.fast),1);
20 end
21
22
1 23 disp('Starting writeFitsMap')
1 24 sunBuffer=60;
25
1 26 lat=37.233; %ovro Latitude in degrees
1 27 lon= 118.282; %ovro longitude West positive in degrees
1 28 startTimeMJD = d.antenna0.receiver.utc(1);
1 29 endTimeMJD = d.antenna0.receiver.utc(length(d.antenna0.receiver.utc));
30
1 31 disp('EndTimeMJD writeFitsMap')
32 %create the Fits Data bundle
1 33 relativeTime = d.antenna0.receiver.utc-startTimeMJD;
0.01 1 34 equatorialPosn = d.antenna0.servo.equa(:,1:2);
0.01 1 35 horizontalPosn = d.antenna0.servo.apparent(:,1:2);
1 36 correctedData = d.antenna0.receiver.data; %6 columns of data
1 37 flags = logical(flagsIn)|logical(d.index.skydip.fast)|logical(d.index.noise.fast);
38
1 39 disp('Flags writeFitsMap')
1 40 try
0.13 1 41 sunPos = sunUpDown(d.antenna0.receiver.utc,lat,lon,sunBuffer);
0.85 1 42 [galacticPosn,TotRot]=coco(equatorialPosn,'j2000.0','g','r','r');
0.21 1 43 dataBundle = [relativeTime equatorialPosn horizontalPosn galacticPosn correctedData flags sunPos];
44 catch
45 disp('Failed sunPos,galacticPosn,databundle in writeFitsMap')
46 end
47
1 48 try
49 % Add in a catch to heck whether .data is 6 or 8 columns
50 % 6-columns gives [I1 Q1 -U1 Q2 U2 I2]
51 % 8-columns gives [I Q1 U1 Q2 U2 Q3 U3 V]
1 52 datatype = size(d.antenna0.receiver.data,2);
53
6.15 1 54 cbass_write_data(fitsFilename,dataBundle,0,0,startTimeMJD,endTimeMJD,thisScanNumber,totalScans,batchStartMJD,batchEndMJD,sunBuffer,datatype);
55 catch
56 disp('Failed to write the FITS file with cbass_write_data')
57 end
1 58 scan = thisScanNumber;
59
1 60 disp('End writeFitsMap')