Code covered by the BSD License  

Highlights from
Rise and Set of the Sun, Moon and Planets

Rise and Set of the Sun, Moon and Planets

by

 

05 Dec 2012 (Updated )

Topocentric rise and set of the Sun, Moon and planets. Source ephemeris is DE421 with NOVAS routines

readleap
function readleap

% read leap seconds data file

% output via global

%  jdateleap = array of utc julian dates
%  leapsec   = array of leap seconds

% Orbital Mechanics with Matlab

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

global jdateleap leapsec

leapdata = csvread('tai-utc.dat');

% find length of data arrays

ndata = length(leapdata);

% put julian dates and leap seconds into data arrays

for i = 1:1:ndata
    
    jdateleap(i) = leapdata(i, 1);

    leapsec(i) = leapdata(i, 2);
    
end

Contact us