This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
cocofunction1
Lines where the most time was spent
No measurable time spent in this function

Line NumberCodeCallsTotal Time% TimeTime Plot
44
RotM = [-0.0548755604 +0.49410...
10 s0%
43
case {'g'}
10 s0%
39
case {'E'}
10 s0%
35
case {'e'}
10 s0%
34
switch Type
10 s0%
All other lines  0 s0%
Totals  0 s0% 
Children (called functions)
No children
Code Analyzer results
Line numberMessage
1Extra semicolon is unnecessary.
72Assignment to 'RotM' might be unnecessary.
75The value assigned here to 'Nut' appears to be unused. Consider replacing it by ~.
76Use of brackets [] is unnecessary. Use parentheses to group, if needed.
76Use of brackets [] is unnecessary. Use parentheses to group, if needed.
79The value assigned here to 'Nut' appears to be unused. Consider replacing it by ~.
Coverage results
[ Show coverage for parent directory ]
Total lines in function88
Non-code lines (comments, blank lines)40
Code lines (lines that can run)48
Code lines that did run7
Code lines that did not run41
Coverage (did run/can run)14.58 %
Function listing
   time   calls  line
1 function RotM=rotm_coo(Type,EquinoxJD);
2 %--------------------------------------------------------
3 % rotm_coo function Generate rotation matrix for
4 % converting J2000.0 coordinates to
5 % galactic l & b coordinates.
6 % Input : - Type of rotation matrix
7 % 'e' - equatorial with mean equinox of J2000.0
8 % to ecliptic with mean ecliptic and equinox J2000.0
9 % 'E' - ecliptic with mean ecliptic and equinox J2000.0
10 % to equatorial with mean equinox of J2000.0
11 % 'g' - galactic to equatorial with mean equinox of J2000.0
12 % 'G' - equatorial with mean equinox of J2000.0 to galactic.
13 % 'p' - precession matrix from mean equinox
14 % of date to mean equinox of J2000.0.
15 % 'P' - precession matrix from mean equinox
16 % J2000.0 to mean equinox of date.
17 % 'pd' - precession matrix from true equinox
18 % of date to mean equinox of J2000.0.
19 % 'Pd' - precession matrix from mean equinox
20 % J2000.0 to true equinox of date.
21 % - Equinox of coordinates (in Julian Day),
22 % used only in the case of 'p' | 'P' | 'pd' | 'Pd' | 'ed' | 'Ed'
23 % In case of 'E' or 'q' if this parameter is
24 % not given it is taken as 2451545.0 (=J2000.0)
25 % Output : - rotation matrix
26 % Reference : Ex. Supp. to the Astronomical Almanac.
27 % Tested : Matlab 5.3
28 % By : Eran O. Ofek August 1999 / June 2000
29 % URL : http://wise-obs.tau.ac.il/~eran/matlab.html
30 %--------------------------------------------------------
1 31 RADIAN = 180./pi;
1 32 J2000 = 2451545.5;
33
1 34 switch Type
1 35 case {'e'}
36 Obl = obliquity(J2000);
37 RotM = [1 0 0; 0 cos(Obl) sin(Obl); 0 -sin(Obl) cos(Obl)];
38 %RotM = [-0.0548755604 +0.4941094279 -0.8676661490; -0.8734370902 -0.4448296300 -0.1980763734; -0.4838350155 +0.7469822445 +0.4559837762];
1 39 case {'E'}
40 Obl = obliquity(J2000);
41 RotM = [1 0 0; 0 cos(Obl) sin(Obl); 0 -sin(Obl) cos(Obl)].';
42 %RotM = [-0.0548755604 +0.4941094279 -0.8676661490; -0.8734370902 -0.4448296300 -0.1980763734; -0.4838350155 +0.7469822445 +0.4559837762]';
1 43 case {'g'}
1 44 RotM = [-0.0548755604 +0.4941094279 -0.8676661490; -0.8734370902 -0.4448296300 -0.1980763734; -0.4838350155 +0.7469822445 +0.4559837762]';
45 case {'G'}
46 RotM = [-0.0548755604 +0.4941094279 -0.8676661490; -0.8734370902 -0.4448296300 -0.1980763734; -0.4838350155 +0.7469822445 +0.4559837762];
47 case {'p','P','pd','Pd'}
48 T = (EquinoxJD - 2451545.0)./36525.0;
49
50 ZetaA = 0.6406161.*T + 0.0000839.*T.*T + 0.0000050.*T.*T.*T;
51 ZA = 0.6406161.*T + 0.0003041.*T.*T + 0.0000051.*T.*T.*T;
52 ThetaA = 0.5567530.*T - 0.0001185.*T.*T - 0.0000116.*T.*T.*T;
53 ZetaA = ZetaA./RADIAN;
54 ZA = ZA./RADIAN;
55 ThetaA = ThetaA./RADIAN;
56
57 RotM = zeros(3,3);
58 RotM(1,1) = cos(ZetaA).*cos(ThetaA).*cos(ZA) - sin(ZetaA).*sin(ZA);
59 RotM(2,1) = cos(ZetaA).*cos(ThetaA).*sin(ZA) + sin(ZetaA).*cos(ZA);
60 RotM(3,1) = cos(ZetaA).*sin(ThetaA);
61 RotM(1,2) =-sin(ZetaA).*cos(ThetaA).*cos(ZA) - cos(ZetaA).*sin(ZA);
62 RotM(2,2) =-sin(ZetaA).*cos(ThetaA).*sin(ZA) + cos(ZetaA).*cos(ZA);
63 RotM(3,2) =-sin(ZetaA).*sin(ThetaA);
64 RotM(1,3) =-sin(ThetaA).*cos(ZA);
65 RotM(2,3) =-sin(ThetaA).*sin(ZA);
66 RotM(3,3) = cos(ThetaA);
67
68 switch Type
69 case {'p'}
70 RotM = RotM';
71 case {'P'}
72 RotM = RotM;
73 case {'pd'}
74 % calculate nutation matrix
75 [Nut, NutMat]=nutation(EquinoxJD);
76 RotM = [NutMat']*[RotM'];
77 case {'Pd'}
78 % calculate nutation matrix
79 [Nut, NutMat]=nutation(EquinoxJD);
80 RotM = NutMat*RotM;
81 otherwise
82 error('Unknown rotation matrix type');
83 end
84
85
86 otherwise
87 error('Unknown rotation matrix type');
88 end