| 36 |
|
|
| 37 |
TMatrixD OrientationInfo::ECItoGreenwich(TMatrixD Aij, UInt_t t){ |
TMatrixD OrientationInfo::ECItoGreenwich(TMatrixD Aij, UInt_t t){ |
| 38 |
TMatrixD Gij(3,3); |
TMatrixD Gij(3,3); |
| 39 |
|
UInt_t t1=t-t%86400; |
| 40 |
|
UInt_t t2=t1+86400; |
| 41 |
Double_t omg = (7.292115e-5)*a; // Earth rotation velosity (Around polar axis); |
Double_t omg = (7.292115e-5)*a; // Earth rotation velosity (Around polar axis); |
| 42 |
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; |
| 43 |
d = d/86400; |
d = d/86400; |
| 44 |
Double_t T = d/36525; //Number of Julian centuries; |
Double_t T = d/36525; //Number of Julian centuries; |
| 45 |
|
Double_t Se = 6*3600+41*60+236.555367908*d+0.093104*T*T-(6.2e-6)*T*T*T; //18 <-> 6 |
| 46 |
Double_t Se = 6*3600+41*60+236.555367908*d+0.093104*pow(T,2)-(6.2e-6)*pow(T,3); |
Double_t tr = (t1-10957*86400)%86400; |
| 47 |
|
Double_t Somg1 = (Se+49.077+omg*86400*tr/360.)*360/86400.; |
|
Int_t tr = (t-10957*86400)%86400; |
|
| 48 |
|
|
| 49 |
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; |
| 50 |
|
d = d/86400; |
| 51 |
//Somg = 25; //for test transition |
T = d/36525; //Number of Julian centuries; |
| 52 |
|
Se = 6*3600+41*60+236.555367908*d+0.093104*T*T-(6.2e-6)*T*T*T; //18 <-> 6 |
| 53 |
|
tr = (t2-10957*86400)%86400; |
| 54 |
|
Double_t Somg2 = (Se+49.077+omg*86400*tr/360.)*360/86400.; |
| 55 |
|
Somg2+=360.0; |
| 56 |
|
|
| 57 |
|
Double_t kk=(Somg2-Somg1)/(t2-t1); |
| 58 |
|
Double_t bb= Somg1-kk*t1; |
| 59 |
|
Double_t Somg=kk*t+bb; |
| 60 |
|
|
| 61 |
Gij(0,0) = cos(Somg/a); |
Gij(0,0) = cos(Somg/a); |
| 62 |
Gij(0,1) = -sin(Somg/a); |
Gij(0,1) = -sin(Somg/a); |
| 141 |
Double_t u21 = (-by+uj*sqrt(Ds))/(2*ab); |
Double_t u21 = (-by+uj*sqrt(Ds))/(2*ab); |
| 142 |
Double_t u21s = -TMath::Sign(1.,Bank)*TMath::Abs(u21); |
Double_t u21s = -TMath::Sign(1.,Bank)*TMath::Abs(u21); |
| 143 |
Double_t u01 = TMath::Sign(1.,Yaw)*TMath::Abs((u10*u11+u20*u21)/u00); |
Double_t u01 = TMath::Sign(1.,Yaw)*TMath::Abs((u10*u11+u20*u21)/u00); |
| 144 |
// cerr<<"by = " << by<<"\tuj"<<uj<<"\tab: "<<ab<<"\t"<<by*by-4*ab*cy<<endl; |
|
|
// cerr<<"u21: "<<u21<<"\tu01: "<<u01<<"\t"<<TMath::Abs((u10*u11+u20*u21)/u00)<<"\t"<<TMath::Sign(1.,Yaw)<<"\t"<<(u10*u11+u20*u21)<<endl; |
|
| 145 |
Int_t fj=1; |
Int_t fj=1; |
| 146 |
if(TMath::Sign(1.,SPitch)>0 && TMath::Sign(1.,Yaw)>0) fj=-1; |
if(TMath::Sign(1.,SPitch)>0 && TMath::Sign(1.,Yaw)>0) fj=-1; |
|
// cout<<"bla-bla-bla"<<endl; |
|
| 147 |
|
|
| 148 |
Double_t u22 = (-bz+fj*sqrt(bz*bz-4*ab*cz))/(2*ab); |
Double_t u22 = (-bz+fj*sqrt(bz*bz-4*ab*cz))/(2*ab); |
| 149 |
Double_t u22s = -TMath::Sign(1.,SPitch)*TMath::Abs(u22); |
Double_t u22s = -TMath::Sign(1.,SPitch)*TMath::Abs(u22); |
| 150 |
Double_t u02 = -TMath::Abs((u10*u12+u20*u22)/u00); |
Double_t u02 = -TMath::Abs((u10*u12+u20*u22)/u00); |
| 151 |
|
|
|
// cout<<fj<<"\t"<<ab<<"\t"<<by<<"\t"<<cy<<"\t"<<bz<<"\t"<<cz<<endl; |
|
|
// cout<<"INSIDE EULERTOECI"<<endl; |
|
|
// cout<<u00<<"\t"<<u01<<"\t"<<u02<<endl; |
|
|
// cout<<u10<<"\t"<<u11<<"\t"<<u12<<endl; |
|
|
// cout<<u20<<"\t"<<u21s<<"\t"<<u22s<<endl; |
|
|
|
|
| 152 |
TMatrixD Dij(3,3); |
TMatrixD Dij(3,3); |
| 153 |
Dij(0,0) = u00; Dij(0,1) = u01; Dij(0,2) = u02; |
Dij(0,0) = u00; Dij(0,1) = u01; Dij(0,2) = u02; |
| 154 |
Dij(1,0) = u10; Dij(1,1) = u11; Dij(1,2) = u12; |
Dij(1,0) = u10; Dij(1,1) = u11; Dij(1,2) = u12; |
| 166 |
|
|
| 167 |
TMatrixD OrientationInfo::ECItoGEO(TMatrixD Aij, UInt_t t, Double_t lat, Double_t lon){ |
TMatrixD OrientationInfo::ECItoGEO(TMatrixD Aij, UInt_t t, Double_t lat, Double_t lon){ |
| 168 |
TMatrixD Gij(3,3); |
TMatrixD Gij(3,3); |
| 169 |
|
UInt_t t1=t-t%86400; |
| 170 |
|
UInt_t t2=t1+86400; |
| 171 |
Double_t omg = (7.292115e-5)*a; // Earth rotation velosity (Around polar axis); |
Double_t omg = (7.292115e-5)*a; // Earth rotation velosity (Around polar axis); |
| 172 |
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; |
| 173 |
d = d/86400; |
d = d/86400; |
| 174 |
Double_t T = d/36525; //Number of Julian centuries; |
Double_t T = d/36525; //Number of Julian centuries; |
| 175 |
|
Double_t Se = 6*3600+41*60+236.555367908*d+0.093104*T*T-(6.2e-6)*T*T*T; //18 <-> 6 |
| 176 |
Double_t Se = 6*3600+41*60+236.555367908*d+0.093104*pow(T,2)-(6.2e-6)*pow(T,3); |
Double_t tr = (t1-10957*86400)%86400; |
| 177 |
|
Double_t Somg1 = (Se+49.077+omg*86400*tr/360.)*360/86400.; |
|
Int_t tr = (t-10957*86400)%86400; |
|
| 178 |
|
|
| 179 |
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; |
| 180 |
|
d = d/86400; |
| 181 |
|
T = d/36525; //Number of Julian centuries; |
| 182 |
|
Se = 6*3600+41*60+236.555367908*d+0.093104*T*T-(6.2e-6)*T*T*T; //18 <-> 6 |
| 183 |
|
tr = (t2-10957*86400)%86400; |
| 184 |
|
Double_t Somg2 = (Se+49.077+omg*86400*tr/360.)*360/86400.; |
| 185 |
|
Somg2+=360.0; |
| 186 |
|
|
| 187 |
|
Double_t kk=(Somg2-Somg1)/(t2-t1); |
| 188 |
|
Double_t bb= Somg1-kk*t1; |
| 189 |
|
Double_t Somg=kk*t+bb; |
| 190 |
|
|
| 191 |
lon=(-lon)/a; lat=(-lat)/a; |
lon=(-lon)/a; lat=(-lat)/a; |
| 192 |
|
|
| 207 |
|
|
| 208 |
TMatrixD OrientationInfo::GEOtoECI(TMatrixD Aij, UInt_t t, Double_t lat, Double_t lon){ |
TMatrixD OrientationInfo::GEOtoECI(TMatrixD Aij, UInt_t t, Double_t lat, Double_t lon){ |
| 209 |
TMatrixD Gij(3,3); |
TMatrixD Gij(3,3); |
| 210 |
Double_t omg = (7.292115e-5)*a; // Earth rotation velosity (Around polar axis); |
UInt_t t1=t-t%86400; |
| 211 |
Double_t d = (t-10957*86400-43200); //Number of day, passing from 01/01/2000 12:00:00 to t; |
UInt_t t2=t1+86400; |
| 212 |
d = d/86400; |
Double_t omg = (7.292115e-5)*a; // Earth rotation velosity (Around polar axis); |
| 213 |
Double_t T = d/36525; //Number of Julian centuries; |
Double_t d = (t1-10957*86400-43200); //Number of day, passing from 01/01/2000 12:00:00 to t; |
| 214 |
|
d = d/86400; |
| 215 |
Double_t Se = 6*3600+41*60+236.555367908*d+0.093104*pow(T,2)-(6.2e-6)*pow(T,3); |
Double_t T = d/36525; //Number of Julian centuries; |
| 216 |
|
Double_t Se = 6*3600+41*60+236.555367908*d+0.093104*T*T-(6.2e-6)*T*T*T; //18 <-> 6 |
| 217 |
Int_t tr = (t-10957*86400)%86400; |
Double_t tr = (t1-10957*86400)%86400; |
| 218 |
|
Double_t Somg1 = (Se+49.077+omg*86400*tr/360.)*360/86400.; |
| 219 |
|
|
| 220 |
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; |
| 221 |
|
d = d/86400; |
| 222 |
|
T = d/36525; //Number of Julian centuries; |
| 223 |
|
Se = 6*3600+41*60+236.555367908*d+0.093104*T*T-(6.2e-6)*T*T*T; //18 <-> 6 |
| 224 |
|
tr = (t2-10957*86400)%86400; |
| 225 |
|
Double_t Somg2 = (Se+49.077+omg*86400*tr/360.)*360/86400.; |
| 226 |
|
Somg2+=360.0; |
| 227 |
|
|
| 228 |
|
Double_t kk=(Somg2-Somg1)/(t2-t1); |
| 229 |
|
Double_t bb= Somg1-kk*t1; |
| 230 |
|
Double_t Somg=kk*t+bb; |
| 231 |
|
|
| 232 |
lon=(-lon)/a; lat=(-lat)/a; |
lon=(-lon)/a; lat=(-lat)/a; |
| 233 |
|
|