%% timut2ju.m converts from UT, day, month and year to
%% J2000 (Julian) secs. 

function j2000=timut2ju(timmat,dno,year)

% timmat = UT time (hours)
% day = day  
% month = month
% year = year
% j2000 = J2000 time (secs)

j2000=zeros(size(timmat));         %results matrix
dc=j2000;

%Calculate the number of days between daynumber of interest and 1 Jan 2000
for i=1:prod(size(j2000))          
 dc(i)=daynum4(dno(i),year(i),1,2000);
end

%Calculate the required Julian time (secs)
j2000=-86400*(dc+(12-timmat)/24);

