This is a static copy of a profile reportHome
mjd2date (1 call, 0.000 sec)
Generated 05-Aug-2011 13:00:35 using cpu time.
function in file /home/LeechJ/cbass_analysis/matutils/dateconv/mjd2date.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
sunUpDown | function | 1 |
Lines where the most time was spent
No measurable time spent in this functionLine Number | Code | Calls | Total Time | % Time | Time Plot |
43 | end | 1 | 0 s | 0% |  |
42 | [hour, minute, second] = days2... | 1 | 0 s | 0% |  |
41 | fmjd = mjd - floor(mjd); | 1 | 0 s | 0% |  |
40 | if nargout > 3 | 1 | 0 s | 0% |  |
38 | [year, month, day] = jd2date(j... | 1 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0 s | 0% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
days2hms | function | 1 | 0 s | 0% |  |
jd2date | function | 1 | 0 s | 0% |  |
mjd2jd | function | 1 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0 s | 0% |  |
Totals | | | 0 s | 0% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 43 |
Non-code lines (comments, blank lines) | 35 |
Code lines (lines that can run) | 8 |
Code lines that did run | 8 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
1 function [year, month, day, hour, minute, second] = mjd2date(mjd)
2 %MJD2DATE Gregorian calendar date from Julian day number.
3 %
4 % [YEAR, MONTH, DAY, HOUR, MINUTE, SECOND] = MJD2DATE(MJD) returns the
5 % Gregorian calendar date (year, month, day, hour, minute, and second)
6 % corresponding to the Julian day number JDAY.
7 %
8 % Start of the JD (Julian day) count is from 0 at 12 noon 1 JAN -4712
9 % (4713 BC), Julian proleptic calendar. Note that this day count conforms
10 % with the astronomical convention starting the day at noon, in contrast
11 % with the civil practice where the day starts with midnight.
12 %
13 % Astronomers have used the Julian period to assign a unique number to
14 % every day since 1 January 4713 BC. This is the so-called Julian Day
15 % (JD). JD 0 designates the 24 hours from noon UTC on 1 January 4713 BC
16 % (Julian calendar) to noon UTC on 2 January 4713 BC.
17
18 % Sources: - http://tycho.usno.navy.mil/mjd.html
19 % - The Calendar FAQ (http://www.faqs.org)
20
21 % Author: Peter J. Acklam
22 % Time-stamp: 2002-03-03 12:50:30 +0100
23 % E-mail: pjacklam@online.no
24 % URL: http://home.online.no/~pjacklam
25
1 26 nargsin = nargin;
1 27 error(nargchk(1, 1, nargsin));
28
29 % We could have got everything by just using
30 %
31 % jd = mjd2jd(mjd);
32 % [year, month, day, hour, minute, second] = jd2date(jd);
33 %
34 % but we lose precision in the fraction part when MJD is converted to JD
35 % because of the large offset (2400000.5) between JD and MJD.
36
1 37 jd = mjd2jd(mjd);
1 38 [year, month, day] = jd2date(jd);
39
1 40 if nargout > 3
1 41 fmjd = mjd - floor(mjd);
1 42 [hour, minute, second] = days2hms(fmjd);
1 43 end