Skip to content
Snippets Groups Projects
Commit 5c9b7165 authored by leprob001's avatar leprob001
Browse files

Added conversion functions for date calculation.

parent 71fbd682
No related branches found
No related tags found
No related merge requests found
function dmy = rd2dmy(rjul)
%function dmy = rd2dmy(rjul)
%
% converts RAFOS JULIAN day (rjul) to day, month, year (dmy(1:3))
% RAFOS JULIAN day = julian day (ref. to 24 nov 4713BC) - 2440000
%
% greg_0h is used
%
% T. Reynaud and G. Roudaut 13/09/05
rjul = rjul(:);
% redifined RAFOS day
%date = greg_0h(rjul+2440000);
date = greg_0h(rjul+2451545);
dmy = [date(:,3) date(:,2) date(:,1)];
function hms=rd2hms(rd)
%RD2HMS Convert the time (remainder) of the rafos time in h,m,s
rd=rd(:);
rt=rd-fix(rd);
dayins=24*60*60;
rt=round(rt*dayins);
hins=60*60;
mins=60;
x=rt./hins;
h=fix(x);
rt=rt-fix(x)*hins;
x=rt./mins;
m=fix(x);
rt=rt-fix(x)*mins;
s=fix(rt);
hms=[h,m,s];
% end rd2hms
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment