--- DarthVader/OrbitalInfo/src/OrientationInfo.cpp 2014/03/28 20:47:15 1.4 +++ DarthVader/OrbitalInfo/src/OrientationInfo.cpp 2014/09/10 06:34:12 1.5 @@ -36,18 +36,27 @@ TMatrixD OrientationInfo::ECItoGreenwich(TMatrixD Aij, UInt_t t){ TMatrixD Gij(3,3); + UInt_t t1=t-t%86400; + UInt_t t2=t1+86400; Double_t omg = (7.292115e-5)*a; // Earth rotation velosity (Around polar axis); - Double_t d = (t-10957*86400-43200); //Number of day, passing from 01/01/2000 12:00:00 to t; + Double_t d = (t1-10957*86400-43200); //Number of day, passing from 01/01/2000 12:00:00 to t; d = d/86400; Double_t T = d/36525; //Number of Julian centuries; - - Double_t Se = 6*3600+41*60+236.555367908*d+0.093104*pow(T,2)-(6.2e-6)*pow(T,3); - - Int_t tr = (t-10957*86400)%86400; + Double_t Se = 6*3600+41*60+236.555367908*d+0.093104*T*T-(6.2e-6)*T*T*T; //18 <-> 6 + Double_t tr = (t1-10957*86400)%86400; + Double_t Somg1 = (Se+49.077+omg*86400*tr/360.)*360/86400.; - Double_t Somg = (Se+49.077+omg*86400*tr/360)*360/86400; - - //Somg = 25; //for test transition + d = (t2-10957*86400-43200); //Number of day, passing from 01/01/2000 12:00:00 to t; + d = d/86400; + T = d/36525; //Number of Julian centuries; + Se = 6*3600+41*60+236.555367908*d+0.093104*T*T-(6.2e-6)*T*T*T; //18 <-> 6 + tr = (t2-10957*86400)%86400; + Double_t Somg2 = (Se+49.077+omg*86400*tr/360.)*360/86400.; + Somg2+=360.0; + + Double_t kk=(Somg2-Somg1)/(t2-t1); + Double_t bb= Somg1-kk*t1; + Double_t Somg=kk*t+bb; Gij(0,0) = cos(Somg/a); Gij(0,1) = -sin(Somg/a); @@ -132,22 +141,14 @@ Double_t u21 = (-by+uj*sqrt(Ds))/(2*ab); Double_t u21s = -TMath::Sign(1.,Bank)*TMath::Abs(u21); Double_t u01 = TMath::Sign(1.,Yaw)*TMath::Abs((u10*u11+u20*u21)/u00); -// cerr<<"by = " << by<<"\tuj"<0 && TMath::Sign(1.,Yaw)>0) fj=-1; -// cout<<"bla-bla-bla"< 6 + Double_t tr = (t1-10957*86400)%86400; + Double_t Somg1 = (Se+49.077+omg*86400*tr/360.)*360/86400.; - Double_t Somg = (Se+49.077+omg*86400*tr/360)*360/86400; + d = (t2-10957*86400-43200); //Number of day, passing from 01/01/2000 12:00:00 to t; + d = d/86400; + T = d/36525; //Number of Julian centuries; + Se = 6*3600+41*60+236.555367908*d+0.093104*T*T-(6.2e-6)*T*T*T; //18 <-> 6 + tr = (t2-10957*86400)%86400; + Double_t Somg2 = (Se+49.077+omg*86400*tr/360.)*360/86400.; + Somg2+=360.0; + + Double_t kk=(Somg2-Somg1)/(t2-t1); + Double_t bb= Somg1-kk*t1; + Double_t Somg=kk*t+bb; lon=(-lon)/a; lat=(-lat)/a; @@ -195,16 +207,27 @@ TMatrixD OrientationInfo::GEOtoECI(TMatrixD Aij, UInt_t t, Double_t lat, Double_t lon){ TMatrixD Gij(3,3); - Double_t omg = (7.292115e-5)*a; // Earth rotation velosity (Around polar axis); - Double_t d = (t-10957*86400-43200); //Number of day, passing from 01/01/2000 12:00:00 to t; - d = d/86400; - Double_t T = d/36525; //Number of Julian centuries; - - Double_t Se = 6*3600+41*60+236.555367908*d+0.093104*pow(T,2)-(6.2e-6)*pow(T,3); - - Int_t tr = (t-10957*86400)%86400; + UInt_t t1=t-t%86400; + UInt_t t2=t1+86400; + Double_t omg = (7.292115e-5)*a; // Earth rotation velosity (Around polar axis); + Double_t d = (t1-10957*86400-43200); //Number of day, passing from 01/01/2000 12:00:00 to t; + d = d/86400; + Double_t T = d/36525; //Number of Julian centuries; + Double_t Se = 6*3600+41*60+236.555367908*d+0.093104*T*T-(6.2e-6)*T*T*T; //18 <-> 6 + Double_t tr = (t1-10957*86400)%86400; + Double_t Somg1 = (Se+49.077+omg*86400*tr/360.)*360/86400.; - Double_t Somg = (Se+49.077+omg*86400*tr/360)*360/86400; + d = (t2-10957*86400-43200); //Number of day, passing from 01/01/2000 12:00:00 to t; + d = d/86400; + T = d/36525; //Number of Julian centuries; + Se = 6*3600+41*60+236.555367908*d+0.093104*T*T-(6.2e-6)*T*T*T; //18 <-> 6 + tr = (t2-10957*86400)%86400; + Double_t Somg2 = (Se+49.077+omg*86400*tr/360.)*360/86400.; + Somg2+=360.0; + + Double_t kk=(Somg2-Somg1)/(t2-t1); + Double_t bb= Somg1-kk*t1; + Double_t Somg=kk*t+bb; lon=(-lon)/a; lat=(-lat)/a;