% -----------------------------------------------------------------
%
% ex3_1415.m
%
% this file tests the reduction functions.
%
% companion code for
% fundamentals of astrodynamics and applications
% 2007
% by david vallado
%
% (h) email dvallado@msn.com
% (w) 719-573-2600, email dvallado@agi.com
%
% *****************************************************************
%
% current :
% 30 mar 07 david vallado
% original
% changes :
% 13 feb 07 david vallado
% original baseline
%
% *****************************************************************
% GEO test
% recef = [24796.91929150; -34115.87092340; 10.22606210];
% vecef = [-0.0009791780; -0.0014765380; -0.0009287760];
% aecef = [0.001;0.002;0.003];
% LEO test
recef = [-1033.4793830; 7901.2952754; 6380.3565958;];
vecef = [-3.225636520; -2.872451450; 5.531924446;];
aecef = [0.001;0.002;0.003];
conv = pi / (180*3600);
year=2004;
mon = 4;
day = 6;
hr = 7;
min= 51;
sec= 28.386009;
dut1 = -0.4399619;
dat = 32;
xp = -0.140682 * conv; % " to rad
yp = 0.333309 * conv;
lod = 0.0015563;
ddpsi = -0.052195 * conv; % " to rad
ddeps = -0.003875 * conv;
ddx = -0.000205 * conv; % " to rad
ddy = -0.000136 * conv;
timezone=0;
order = 106;
eqeterms = 2; % use the extra eqeq terms in j2000
opt = 'a'; % specify the iau00 approach
fprintf(1,'test program for reduction functions \n\n');
fprintf(1,'input data \n\n');
fprintf(1,' year %5i ',year);
fprintf(1,' mon %4i ',mon);
fprintf(1,' day %3i ',day);
fprintf(1,' %3i:%2i:%8.6f\n ',hr,min,sec );
fprintf(1,' dut1 %8.6f s',dut1);
fprintf(1,' dat %3i s',dat);
fprintf(1,' xp %8.6f "',xp / conv);
fprintf(1,' yp %8.6f "',yp / conv);
fprintf(1,' lod %8.6f s\n',lod);
fprintf(1,' ddpsi %8.6f " ddeps %8.6f\n',ddpsi/conv, ddeps/conv);
fprintf(1,' ddx %8.6f " ddy %8.6f\n',ddx/conv, ddy/conv);
fprintf(1,' order %3i eqeterms %31 opt %3s \n',order,eqeterms,opt );
fprintf(1,'units are km and km/s and km/s2\n' );
timezone=0;
% -------- convtime - convert time from utc to all the others
fprintf(1,'convtime results\n');
[ut1, tut1, jdut1, utc, tai, tt, ttt, jdtt, tdb, ttdb, jdtdb ] ...
= convtime ( year, mon, day, hr, min, sec, timezone, dut1, dat );
fprintf(1,'ut1 %8.6f tut1 %16.12f jdut1 %18.11f ',ut1,tut1,jdut1 );
[h,m,s] = sec2hms( ut1 );
fprintf(1,'hms %3i %3i %8.6f \n',h,m,s);
fprintf(1,'utc %8.6f ',utc );
[h,m,s] = sec2hms( utc );
fprintf(1,'hms %3i %3i %8.6f \n',h,m,s);
fprintf(1,'tai %8.6f',tai );
[h,m,s] = sec2hms( tai );
fprintf(1,'hms %3i %3i %8.6f \n',h,m,s);
fprintf(1,'tt %8.6f ttt %16.12f jdtt %18.11f ',tt,ttt,jdtt );
[h,m,s] = sec2hms( tt );
fprintf(1,'hms %3i %3i %8.6f \n',h,m,s);
fprintf(1,'tdb %8.6f ttdb %16.12f jdtdb %18.11f\n',tdb,ttdb,jdtdb );
% -------- precess - transformation matrix for precession
fprintf(1,'precession matrix \n');
[prec,psia,wa,ea,xa] = precess ( ttt, '80' );
fprintf(1,'%16.11f %16.11f %16.11f\n',prec );
% -------- nutation - transformation matrix for nutation
fprintf(1,'nutation matrix \n');
[deltapsi,trueeps,meaneps,omega,nut] = nutation(ttt,0,0);
fprintf(1,'%16.11f %16.11f %16.11f\n',nut );
% -------- sidereal - transformation matrix for sidereal time
fprintf(1,'sidereal time matrix \n');
[st,stdot] = sidereal(jdut1,deltapsi,meaneps,omega,lod,2);
fprintf(1,'%16.11f %16.11f %16.11f\n',st );
% -------- polarm - transformation matrix for polar motion
fprintf(1,'polar motion matrix \n');
[pm] = polarm(xp,yp,ttt,'80');
fprintf(1,'%16.11f %16.11f %16.11f\n',pm );
% -------- truemean - transformation matrix for teme
fprintf(1,'truemean matrix \n');
[nutteme] = truemean ( ttt,order,eqeterms,opt );
fprintf(1,'%16.11f %16.11f %16.11f\n',nutteme );
%-------------------
% sample runs for book
[recigg,vecigg,aecig] = iau00f2iS ( recef,vecef,aecef,ttt,jdut1,lod,xp,yp,'c', ddx, ddy );
fprintf(1,'GCRF IAU-2006 CIO %14.7f %14.7f %14.7f',recigg );
fprintf(1,' v %14.9f %14.9f %14.9f',vecigg );
fprintf(1,' a %14.9f %14.9f %14.9f\n',aecig );
[recig,vecig,aecig] = ecef2eci(recef,vecef,aecef,ttt,jdut1,lod,xp,yp,2,ddpsi,ddeps);
fprintf(1,'GCRF 2 w corr IAU-76/FK5 %14.7f %14.7f %14.7f',recig );
fprintf(1,' v %14.9f %14.9f %14.9f',vecig );
fprintf(1,' a %14.9f %14.9f %14.9f\n',aecig );
%-------------------
fprintf(1,'\n\n ============== convert various coordinate systems from ecef =================== \n');
fprintf(1,'ITRF IAU-76/FK5 %14.7f %14.7f %14.7f',recef );
fprintf(1,' v %14.9f %14.9f %14.9f',vecef );
fprintf(1,' a %14.9f %14.9f %14.9f\n',aecef );
% -------- pef transformations
[rpef,vpef,apef] = ecef2pef ( recef,vecef,aecef, xp, yp, ttt );
fprintf(1,'PEF IAU-76/FK5 %14.7f %14.7f %14.7f',rpef );
fprintf(1,' v %14.9f %14.9f %14.9f',vpef );
fprintf(1,' a %14.9f %14.9f %14.9f\n',apef );
% -------- tod transformations
[rtod,vtod,atod] = ecef2tod ( recef,vecef,aecef,ttt,jdut1,lod,xp,yp,2,ddpsi,ddeps );
fprintf(1,'TOD 2 w corr IAU-76/FK5 %14.7f %14.7f %14.7f',rtod );
fprintf(1,' v %14.9f %14.9f %14.9f',vtod );
fprintf(1,' a %14.9f %14.9f %14.9f\n',atod );
[rtod20,vtod20,atod20] = ecef2tod ( recef,vecef,aecef,ttt,jdut1,lod,xp,yp,2,0,0 );
fprintf(1,'TOD 2 wo corr IAU-76/FK5 %14.7f %14.7f %14.7f',rtod20 );
fprintf(1,' v %14.9f %14.9f %14.9f',vtod20 );
fprintf(1,' a %14.9f %14.9f %14.9f\n',atod20 );
[rtod00,vtod00,atod00] = ecef2tod ( recef,vecef,aecef,ttt,jdut1,lod,xp,yp,0,0,0 );
fprintf(1,'TOD 0 wo corr IAU-76/FK5 %14.7f %14.7f %14.7f',rtod00 );
fprintf(1,' v %14.9f %14.9f %14.9f',vtod00 );
fprintf(1,' a %14.9f %14.9f %14.9f\n',atod00 );
% -------- mod transformations
[rmod,vmod,amod] = ecef2mod ( recef,vecef,aecef,ttt,jdut1,lod,xp,yp,2,ddpsi,ddeps );
fprintf(1,'MOD 2 w corr IAU-76/FK5 %14.7f %14.7f %14.7f',rmod );
fprintf(1,' v %14.9f %14.9f %14.9f',vmod );
fprintf(1,' a %14.9f %14.9f %14.9f\n',amod );
[rmod20,vmod20,amod20] = ecef2mod ( recef,vecef,aecef,ttt,jdut1,lod,xp,yp,2,0,0 );
fprintf(1,'MOD 2 wo corr IAU-76/FK5 %14.7f %14.7f %14.7f',rmod20 );
fprintf(1,' v %14.9f %14.9f %14.9f',vmod20 );
fprintf(1,' a %14.9f %14.9f %14.9f\n',amod20 );
[rmod00,vmod00,amod00] = ecef2mod ( recef,vecef,aecef,ttt,jdut1,lod,xp,yp,0,0,0 );
fprintf(1,'MOD 0 wo corr IAU-76/FK5 %14.7f %14.7f %14.7f',rmod00 );
fprintf(1,' v %14.9f %14.9f %14.9f',vmod00 );
fprintf(1,' a %14.9f %14.9f %14.9f\n',amod00 );
% -------- eci transformations
[recig,vecig,aecig] = ecef2eci(recef,vecef,aecef,ttt,jdut1,lod,xp,yp,2,ddpsi,ddeps);
fprintf(1,'GCRF 2 w corr IAU-76/FK5 %14.7f %14.7f %14.7f',recig );
fprintf(1
评论4