This is a static copy of a profile reportHome
lst (1 call, 0.120 sec)
Generated 05-Aug-2011 13:01:32 using cpu time.
function in file /home/LeechJ/cbass_analysis/matutils/lst.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
horiz_coo | function | 1 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
36 | LST = GMST0UT + 1.0027379093.*... | 1 | 0.022 s | 18.2% |  |
35 | GMST0UT = GMST0UT - floor(GMST... | 1 | 0.022 s | 18.2% |  |
30 | GMST0UT = 24110.54841 + 864018... | 1 | 0.022 s | 18.2% |  |
25 | TJD = floor(JD - 0.5) + 0.5; | 1 | 0.022 s | 18.2% |  |
37 | LST = LST - floor(LST); | 1 | 0.011 s | 9.1% |  |
All other lines | | | 0.022 s | 18.2% |  |
Totals | | | 0.120 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
Line number | Message |
1 | Extra semicolon is unnecessary. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 51 |
Non-code lines (comments, blank lines) | 26 |
Code lines (lines that can run) | 25 |
Code lines that did run | 13 |
Code lines that did not run | 12 |
Coverage (did run/can run) | 52.00 % |
Function listing
time calls line
1 function LST=lst(JD,EastLong,STType);
2 %--------------------------------------------------------------------
3 % lst function Local Sidereal Time, (mean or apparent),
4 % for vector of JD's and a given East Longitude.
5 % input : - Vector of JD, in UT1 time scale.
6 % - East Longitude in radians.
7 % - Sidereal Time Type,
8 % 'm' - Mean (default).
9 % 'a' - apparent.
10 % output : - vector of LST in fraction of day.
11 % By Eran O. Ofek August 1999
12 %--------------------------------------------------------------------
1 13 RAD = 57.29577951308232;
14
1 15 if (nargin==2),
16 STType = 'm';
1 17 elseif (nargin==3),
18 % do nothing
19 else
20 error('Illigal number of input arguments');
21 end
22
23
24 % convert JD to integer day + fraction of day
0.02 1 25 TJD = floor(JD - 0.5) + 0.5;
1 26 DayFrac = JD - TJD;
27
0.01 1 28 T = (TJD - 2451545.0)./36525.0;
29
0.02 1 30 GMST0UT = 24110.54841 + 8640184.812866.*T + 0.093104.*T.*T - 6.2e-6.*T.*T.*T;
31
32 % convert to fraction of day in range [0 1)
1 33 GMST0UT = GMST0UT./86400.0;
34
0.02 1 35 GMST0UT = GMST0UT - floor(GMST0UT);
0.02 1 36 LST = GMST0UT + 1.0027379093.*DayFrac + EastLong./(2.*pi);
0.01 1 37 LST = LST - floor(LST);
38
39
1 40 switch STType
1 41 case {'m'}
42 % do nothing
43 case {'a'}
44 % calculate nutation
45 NutMat = nutation(JD);
46 Obl = obliquity(JD);
47 EquationOfEquinox = (RAD.*3600).*NutMat(:,1).*cos(Obl)./15;
48 LST = LST + EquationOfEquinox./86400;
49 otherwise
50 error('Unknown sidereal time type');
51 end