import celestial.coo.*
help sphere_dist
% convert sexagesimal coordinates to degrees
celestial.coo.convertdms('15:10:56.1','SH','d')
% convert sexagesimal vector to radians
celestial.coo.convertdms([ -1 0 10 56.1],'D','r')
AM=celestial.coo.hardie([1;1.1])
[N,NM]=celestial.coo.nutation(2451545+(1:2)');
% conversion of [RA Dec] in radians from J2000.0 to ecliptic
C=celestial.coo.coco(rand(4,2),'j2000.0','e')
% Galactic to super galactic, input and output in degrees
C=celestial.coo.coco([100 10],'g','S','d','d')
% Super Galactic to Equatorial J2000.0.
R=celestial.coo.rotm_coo('SGg')
tic;
[D,P]=celestial.coo.sphere_dist(rand(1e5,1),rand(1e5,1),[10 0 0],[1 40 0 0]);
toc
VecJD = celestial.time.julday([1 1 2000])+(1:6:366)';
Lat   = 33.*pi./180;
AM    = 1.8;
TimeVis = 0;
for I=1:1:numel(VecJD)
    [SkyArea(I),LON(I)]=celestial.coo.sky_area_above_am(VecJD(I),Lat,AM,TimeVis);
end
plot(VecJD-VecJD(1),SkyArea)
RAD = 180./pi;
% atmospheric refraction as a function of altitude
Alt = (20:1:90)./RAD;
R   = celestial.coo.refraction(Alt);
plot(Alt.*RAD,R.*RAD.*3600)
xlabel('Alt [deg]');
ylabel('Refraction [arcsec]');
% differntial refraction
plot(Alt(1:end-1).*RAD,diff(R).*RAD.*3600)
xlabel('Alt [deg]');
ylabel('Diff. Refraction [arcsec/deg]');
% color refraction as a function of altitude
[R5,N]=celestial.coo.refraction_wave(Alt,5000);
[R6,N]=celestial.coo.refraction_wave(Alt,6000);
plot(Alt.*RAD,(R5-R6).*RAD.*3600)
xlabel('Alt [deg]');
ylabel('Color ref. [arcsec] (500 to 600 nm)');
import celestial.time.*
% Calculate the JD now:
julday
% calculate the JD for some dates in [D M Y Frac_of_day] format
julday([1 1 2015 0.5; 1 2 2015 0.7])
% calculate the JD for a date in [D M Y H M S] format
julday([1 1 2015 18 30 45])
% calculate the JD from an ISO string
julday('2015-01-01T18:30:45.0')
% or from several ISO strings
JD = julday({'2015-01-01T18:30:45.0','2016-02-01T12:30:15'})

% convert JD to date in [D M Y Frac] format
jd2date(JD)
% convert JD to date in [D M Y H M S] format
jd2date(JD,'H')

% convert jd to MJD
MJD=jd2mjd(JD)
% convert MJD to JD
JD=mjd2jd(MJD)
import celestial.time.*
% input is JD in UT1 time scale
JD = julday([1 1 2016])+(0:1:10)';
% calculate the GMST - output is in fraction of day
LST = lst(JD,0)
% calculate the Greenwich Apparent Sidereal Time
LST = lst(JD,0,'a')
% Mean sidereall time at longitude 35 def
LST = lst(JD,35.*pi./180)
% Store a local copy of The EOP file:
EOP=celestial.time.wget_eop('get');
% Store a local copy of TAI/UTC file:
TAI_UTC=celestial.time.wget_tai_utc('get');
% DeltaT = TT-UT1 (after 1984)
DeltaT=celestial.time.delta_t([2451545;celestial.time.julday])
% TDB-TT
Diff=celestial.time.tdb_tdt(2451545)
% TAI-UTC and TT-UTC:
[TAImUTC,TTmUTC]=celestial.time.tai_utc([0;2451545])
% UT1-UTC and Earth Oreientation Parameters
[UT1mUTC,EOP]=celestial.time.ut1_utc(2451545)
% number of days in Month in Feb 2000:
celestial.time.days_in_month(2000,2)
% Date of Easter in 2000:
celestial.time.easter_date(2000)
[V,W,EGM]=celestial.Earth.earth_gravity_field(6731e5,1,1);
% solve the Kepler equation for elliptic orbit simultanously for 1e6 objects:
t = rand(1e6,1);  % t-T (day)
q = rand(1e6,1);  % q (au)
e = rand(1e6,1);   % e
tic;
[Nu,R,E]=celestial.Kepler.kepler_elliptic(t,q,e);
toc
JD = celestial.time.julday([1 1 2015])+(0:1:365)';
% Calculate apparent coordinate of the Sun in 2015
[RA,Dec,R,sl,ET]=celestial.SolarSys.suncoo(JD,'a');
% plot the analema
ET(ET>900) = ET(ET>900)-1440;
plot(ET,Dec.*180./pi,'.')
xlabel('Time [min]');
ylabel('Declination [deg]');
% Convert coordinates of fixed position to radians
RA  = celestial.coo.convertdms('15:45:12.1','SH','r');
Dec = celestial.coo.convertdms(15.1,'d','R')
% Moon coordinatesv from Israel
JD = celestial.time.julday([1 1 2015])+(0:1:365)';
[MoonRA,MoonDec,HP]=celestial.SolarSys.mooncool(JD,[35 32].*pi./180);
D = celestial.coo.sphere_dist(MoonRA,MoonDec,RA,Dec);
plot(JD-2450000,D.*180./pi)
% January 2015:
celestial.SolarSys.jup_satcurve(1,2015)
celestial.SolarSys.jupiter_map(celestial.time.julday([1 1 2015 23 0 0]))
% Calculate the Moon phases in January 2015:
celestial.SolarSys.moon_phases([1 1 2015],[1 2 2015])
% Approximate time for equinox and solstice between 2010 to 2020
Eq=celestial.SolarSys.equinox_solstice([2010;2020])
Undefined variable "celestial" or class "celestial.mlx".