AstUtil Namespace Reference

Functions

double GetDetLongitude (Detector::Detector_t detector)
double GetDetLatitude (Detector::Detector_t detector)
const double * GetDetRotMatrixLocalToIdeal (Detector::Detector_t detector)
const double * GetDetRotMatrixIdealToLocal (Detector::Detector_t detector)
void LocalToIdeal (double dcosx, double dcosy, double dcosz, Detector::Detector_t dettype, double &dcosx_ideal, double &dcosy_ideal, double &dcosz_ideal)
void IdealToLocal (double dcosx_ideal, double dcosy_ideal, double dcosz_ideal, Detector::Detector_t dettype, double &dcosx, double &dcosy, double &dcosz)
void HorizonToLocal (double altitude, double azimuth, Detector::Detector_t dettype, double &dcosx, double &dcosy, double &dcosz)
void LocalToHorizon (double dcosx, double dcosy, double dcosz, Detector::Detector_t dettype, double &altitude, double &azimuth)
void HorizonToIdeal (double altitude, double azimuth, double &dcosx_ideal, double &dcosy_ideal, double &dcosz_ideal)
void IdealToHorizon (double dcosx_ideal, double dcosy_ideal, double dcosz_ideal, double &altitude, double &azimuth)
void HorizonToEquatorial (double altitude, double azimuth, double latitude, double &hourangle, double &declination)
void EquatorialToHorizon (double hourangle, double declination, double latitude, double &altitude, double &azimuth)
void CelestialToEquatorial (double ra, double gmst, double longitude, double &hourangle)
void EquatorialToCelestial (double hourangle, double gmst, double longitude, double &ra)
void CelestialToEcliptic (double declination, double ra, double &beta, double &lamda)
void EclipticToCelestial (double beta, double lamda, double &declination, double &ra)
void CalendarToJulian (int year, int month, int day, double hour, double &juliandate)
void JulianToGMST (double juliandate, double &gmst)
void JulianToGAST (double juliandate, double &gast)
void GSTToLST (double gst, double longitude, double &lst)
void LSTToGST (double lst, double longitude, double &gst)

Variables

const double kFarDetLongitude = -92.24141202
const double kFarDetLatitude = 47.82026653
const double kFarDetRotMatrixLocalToIdeal [9]
const double kFarDetRotMatrixIdealToLocal [9]
const double kNearDetLongitude = -88.27062086
const double kNearDetLatitude = 41.84056333
const double kNearDetRotMatrixLocalToIdeal [9]
const double kNearDetRotMatrixIdealToLocal [9]

Function Documentation

void AstUtil::CalendarToJulian ( int  year,
int  month,
int  day,
double  hour,
double &  juliandate 
)

Definition at line 20 of file AstTime.cxx.

References julian_date().

Referenced by ANtpInfoObjectFiller::FillHeaderInformation(), and NtpSRModule::FillNtpTrackCosmicRay().

00021                                                                   {
00022   // Static method to convert from calendar date to julian date (hours)
00023 
00024   juliandate = julian_date(year,month,day,hour); // nova routine
00025 
00026 }

void AstUtil::CelestialToEcliptic ( double  declination,
double  ra,
double &  beta,
double &  lamda 
)

Definition at line 329 of file AstCoordinate.cxx.

References Mphysical::pi.

00331 { // Static method to convert from celestial to ecliptic coordinates
00332 
00333     const double epsilon  = 23.43;
00334     
00335     double sindelta = sin(declination);
00336     double sinalpha = sin(ra);
00337     double cosdelta = cos(declination);
00338     double cosalpha = cos(ra);
00339     double cosbeta  = cos(beta);
00340     
00341     //We will need both trigonometric numbers of epsilon, the constant angle between
00342     //the ecliptic and the celestial equator great circles. 
00343     const double Alpha = cos(Mphysical::pi*epsilon/180.);
00344     const double Beta  = sin(Mphysical::pi*epsilon/180.);
00345     
00346     beta  =  asin(sindelta*Alpha-cosdelta*Beta*sinalpha);
00347     if (cosbeta!=0){
00348         lamda =  acos(cosalpha*cosdelta/cosbeta); 
00349     } else { //the point lies on pole of ecliptic, and lamda has no meaning
00350         lamda = 0;
00351     }
00352     if (lamda < 0.) lamda += 360.;
00353     return;
00354 }

void AstUtil::CelestialToEquatorial ( double  ra,
double  gmst,
double  longitude,
double &  hourangle 
)

Definition at line 302 of file AstCoordinate.cxx.

References GSTToLST().

Referenced by AstValidate::TestEquatorialToCelestial().

00303                                                               {
00304   // Static method to convert from celestial to equatorial coordinates
00305 
00306   double lst;
00307   AstUtil::GSTToLST(gst,longitude,lst);
00308   lst *= 15.; // convert from hours to degrees
00309   hourangle = lst - ra;
00310   if ( hourangle < 0. ) hourangle += 360.;
00311  
00312   return;
00313 
00314 }

void AstUtil::EclipticToCelestial ( double  beta,
double  lamda,
double &  declination,
double &  ra 
)

Definition at line 357 of file AstCoordinate.cxx.

References Mphysical::pi.

00359 { // Static method to convert from ecliptic to celestial coordinates
00360 
00361     const double epsilon  = 23.43;
00362     
00363     double sinlamda = sin(lamda);
00364     double coslamda = cos(lamda);
00365     double cosbeta  = cos(beta);
00366     double sinbeta  = sin(beta);
00367     double cosdelta = cos(declination);
00368     
00369     //We will need both trigonometric numbers of epsilon, the constant angle between
00370     //the ecliptic and the celestial equator great circles. 
00371     const double Alpha = cos(Mphysical::pi*epsilon/180.);
00372     const double Beta  = sin(Mphysical::pi*epsilon/180.);
00373     
00374     declination  =  asin(sinbeta*Alpha+cosbeta*Beta*sinlamda);
00375     if (cosdelta!=0){
00376         ra =  acos(coslamda*cosbeta/cosdelta); 
00377     } else { //the point lies on pole of equator, and ra has no meaning
00378         ra = 0;
00379     }
00380     if (ra <0.) ra += 360.;
00381     return;
00382 }

void AstUtil::EquatorialToCelestial ( double  hourangle,
double  gmst,
double  longitude,
double &  ra 
)

Definition at line 316 of file AstCoordinate.cxx.

References GSTToLST().

Referenced by NtpSRModule::FillNtpTrackCosmicRay(), and AstValidate::TestEquatorialToCelestial().

00317                                                                   {
00318   // Static method to convert from equatorial to celestial coordinates
00319 
00320   double lst; 
00321   AstUtil::GSTToLST(gst,longitude,lst);
00322   lst *= 15.; // convert from hours to degrees
00323   ra = lst - hourangle; // in degrees
00324   if ( ra < 0. ) ra += 360.;
00325 
00326   return;
00327 }

void AstUtil::EquatorialToHorizon ( double  hourangle,
double  declination,
double  latitude,
double &  altitude,
double &  azimuth 
)

Definition at line 243 of file AstCoordinate.cxx.

References Mphysical::pi.

Referenced by AstValidate::TestHorizonToEquatorial().

00244                                                         {
00245   // Static method to convert from equatorial to horizon coordinates
00246   // From Practical Ephemeris Calculations by O. Montenbruck:
00247   // 1)sin(alt)          =  sin(lat)*sin(dec) + cos(lat)*cos(dec)*cos(ha)
00248   // 2)cos(alt)*sin(azi) = -cos(dec)*sin(ha)
00249   // 3)cos(alt)*cos(azi) =  cos(lat)*sin(dec) - sin(lat)*cos(dec)*cos(ha)
00250   // This implementation is adapted from an M. Thomson Soudan2 fortran
00251   // routine.
00252 
00253   double latrad = latitude*Mphysical::pi/180.;
00254   double harad  = hourangle*Mphysical::pi/180.;
00255   double decrad = declination*Mphysical::pi/180.;
00256 
00257   double sinlat = sin(latrad);
00258   double sinha  = sin(harad);
00259   double sindec = sin(decrad);
00260   double coslat = cos(latrad);
00261   double cosha  = cos(harad);
00262   double cosdec = cos(decrad);
00263 
00264   // Solve equation 1 for altitude
00265   double sinalt = sindec*sinlat + cosdec*cosha*coslat;
00266   if ( sinalt >= 1 ) altitude = Mphysical::pi/2.;
00267   else if ( sinalt <= -1 ) altitude = -Mphysical::pi/2.;
00268   else altitude = asin(sinalt);
00269 
00270   // Solve equation 2 to determine azimuth in range -pi/2 to pi/2.
00271   double du = 90.0001*Mphysical::pi/180.;
00272   double dl = 89.9999*Mphysical::pi/180.;
00273   if (fabs(altitude) > dl && fabs(altitude) < du ) {
00274     azimuth = 0;
00275   }
00276   else {
00277     double sinazi = -cosdec*sinha/cos(altitude);
00278     if ( sinazi >= 1 ) azimuth = Mphysical::pi/2.;
00279     else if (sinazi <= -1 ) azimuth = -Mphysical::pi/2.; 
00280     else azimuth = asin(sinazi);
00281   }
00282 
00283   // Use 3rd equation to fully determine azimuth
00284   double lhs = cos(altitude)*cos(azimuth);
00285   double rhs = sindec*coslat - cosdec*cosha*sinlat;
00286 
00287   double prod = lhs*rhs;
00288   if ( prod != fabs(prod) ) {
00289     if ( azimuth > 0. ) azimuth = Mphysical::pi - azimuth;
00290     else azimuth = -Mphysical::pi - azimuth;
00291   }
00292 
00293   if ( azimuth < 0. ) azimuth += 2.*Mphysical::pi;
00294 
00295   altitude = altitude*180./Mphysical::pi;  // degrees
00296   azimuth  = azimuth*180./Mphysical::pi;   // degrees
00297 
00298   return;
00299 
00300 }

double AstUtil::GetDetLatitude ( Detector::Detector_t  detector  ) 

Definition at line 23 of file Ast.cxx.

References bfld::AsString(), Detector::kFar, kFarDetLatitude, Detector::kNear, kNearDetLatitude, Msg::kWarning, and MSG.

Referenced by NtpSRModule::FillNtpTrackCosmicRay().

00023                                                           {
00024   // 
00025   // Return the latitudinal position of the detector of the requested type.
00026   //
00027 
00028   switch( detector ) {
00029 
00030   case Detector::kFar: 
00031     return kFarDetLatitude;
00032 
00033   case Detector::kNear: 
00034     return kNearDetLatitude;
00035 
00036   default:
00037     MSG("Ast",Msg::kWarning) << "Latitudinal position for detector "
00038         << Detector::AsString(detector) << " unavailable." << endl;
00039     return 0;
00040 
00041   }// end of switch
00042 
00043 }

double AstUtil::GetDetLongitude ( Detector::Detector_t  detector  ) 

Definition at line 45 of file Ast.cxx.

References bfld::AsString(), Detector::kFar, kFarDetLongitude, Detector::kNear, kNearDetLongitude, Msg::kWarning, and MSG.

Referenced by NtpSRModule::FillNtpTrackCosmicRay().

00045                                                            {
00046   //
00047   // Return the longitudinal position of the detector of the requested type.
00048   //
00049   switch( detector ) {
00050 
00051   case Detector::kFar: 
00052     return kFarDetLongitude;
00053 
00054   case Detector::kNear: 
00055     return kNearDetLongitude;
00056 
00057   default:
00058     MSG("Ast",Msg::kWarning) << "Longitudinal position for detector "
00059         << Detector::AsString(detector) << " unavailable." << endl;
00060     return 0;
00061 
00062   } // end of switch
00063 
00064 }

const double * AstUtil::GetDetRotMatrixIdealToLocal ( Detector::Detector_t  detector  ) 

Definition at line 91 of file Ast.cxx.

References bfld::AsString(), Detector::kFar, kFarDetRotMatrixIdealToLocal, Detector::kNear, kNearDetRotMatrixIdealToLocal, Msg::kWarning, and MSG.

Referenced by IdealToLocal().

00091                                                                   {
00092   //
00093   // Return the rotation matrix from ideal to local detector coordinates for
00094   // the  requested type.
00095   //
00096   switch( detector ) {
00097 
00098   case Detector::kFar: 
00099     return kFarDetRotMatrixIdealToLocal;
00100 
00101   case Detector::kNear: 
00102     return kNearDetRotMatrixIdealToLocal;
00103 
00104   default:
00105     MSG("Ast",Msg::kWarning) 
00106         << "Rotation matrix from ideal to local coordinates for detector "
00107         << Detector::AsString(detector) << " unavailable." << endl;
00108     return 0;
00109 
00110   } // end of switch
00111 
00112 }

const double * AstUtil::GetDetRotMatrixLocalToIdeal ( Detector::Detector_t  detector  ) 

Definition at line 67 of file Ast.cxx.

References bfld::AsString(), Detector::kFar, kFarDetRotMatrixLocalToIdeal, Detector::kNear, kNearDetRotMatrixLocalToIdeal, Msg::kWarning, and MSG.

Referenced by LocalToIdeal().

00067                                                                   {
00068   //
00069   // Return the rotation matrix from local to ideal detector coordinates for
00070   // the  requested type.
00071   //
00072   switch( detector ) {
00073 
00074   case Detector::kFar: 
00075     return kFarDetRotMatrixLocalToIdeal;
00076 
00077   case Detector::kNear: 
00078     return kNearDetRotMatrixLocalToIdeal;
00079 
00080   default:
00081     MSG("Ast",Msg::kWarning) 
00082         << "Rotation matrix from local to ideal coordinates for detector "
00083         << Detector::AsString(detector) << " unavailable." << endl;
00084     return 0;
00085 
00086   } // end of switch
00087 
00088 }

void AstUtil::GSTToLST ( double  gst,
double  longitude,
double &  lst 
)

Definition at line 51 of file AstTime.cxx.

Referenced by CelestialToEquatorial(), EquatorialToCelestial(), ANtpInfoObjectFiller::FillHeaderInformation(), NtpSRModule::FillNtpTrackCosmicRay(), and AstValidate::TestJulianDateToSiderealTime().

00051                                                               {
00052   // Static method to convert from greenwich sidereal time (hours) to local 
00053   // sidereal time (hours) 
00054   // Longitude is expressed in degrees and east of 0^o is +, west -.
00055 
00056   lst = gst + longitude*12./180.; // hours
00057   if ( lst < 0. ) lst += 24.;
00058   if ( lst > 24. ) lst -= 24.;
00059 }

void AstUtil::HorizonToEquatorial ( double  altitude,
double  azimuth,
double  latitude,
double &  hourangle,
double &  declination 
)

Definition at line 184 of file AstCoordinate.cxx.

References Mphysical::pi.

Referenced by NtpSRModule::FillNtpTrackCosmicRay(), and AstValidate::TestHorizonToEquatorial().

00185                                                                        {
00186   // Static method to convert from horizon to equatorial coordinates.
00187   // From Practical Ephemeris Calculations by O. Montenbruck:
00188   // 1)sin(dec)         = sin(lat)*sin(alt) + cos(lat)*cos(alt)*cos(azi)
00189   // 2)cos(dec)*sin(ha) = -cos(alt)*sin(azi)
00190   // 3)cos(dec)*cos(ha) = cos(lat)*sin(alt)-sin(lat)*cos(alt)*cos(azi)
00191   // This implementation is adapted from an M. Thomson Soudan2 fortran
00192   // routine.
00193 
00194   double latrad = latitude*Mphysical::pi/180.;
00195   double altrad = altitude*Mphysical::pi/180.;
00196   double azirad = azimuth*Mphysical::pi/180.;
00197 
00198   double sinlat = sin(latrad);
00199   double sinalt = sin(altrad);
00200   double sinazi = sin(azirad);
00201   double coslat = cos(latrad);
00202   double cosalt = cos(altrad);
00203   double cosazi = cos(azirad);
00204 
00205   // solve equation 1 to determine declination
00206   double sindec = sinalt*sinlat + cosalt*cosazi*coslat;
00207   if ( sindec >= 1 ) declination = Mphysical::pi/2.;
00208   else if ( sindec <= -1 ) declination = -Mphysical::pi/2.;
00209   else declination = asin(sindec);
00210 
00211   // solve equation 2 to determine hourangle in range -pi/2 to pi/2
00212   double du = 90.0001*Mphysical::pi/180.;
00213   double dl = 89.9999*Mphysical::pi/180.;
00214   if ( fabs(declination) > dl && fabs(declination) < du ) {
00215     hourangle = 0.;
00216   }
00217   else {
00218    double sinhourangle = -cosalt*sinazi/cos(declination);
00219    if ( sinhourangle >= 1 ) hourangle = Mphysical::pi/2.;
00220    else if ( sinhourangle <= -1 ) hourangle = -Mphysical::pi/2.;
00221    else hourangle = asin(sinhourangle);
00222   }
00223 
00224   // use 3rd equation to fully determine hourangle
00225   double lhs = cos(declination)*cos(hourangle);
00226   double rhs = sinalt*coslat - cosalt*cosazi*sinlat;
00227 
00228   double prod = lhs*rhs;
00229   if ( prod != fabs(prod) ) {
00230     if ( hourangle > 0. ) hourangle = Mphysical::pi - hourangle;
00231     else hourangle = -Mphysical::pi - hourangle;
00232   }
00233 
00234   if ( hourangle < 0. ) hourangle += 2.*Mphysical::pi;
00235 
00236   hourangle   = hourangle*180./Mphysical::pi; // degrees
00237   declination = declination*180./Mphysical::pi; // degrees
00238 
00239   return;
00240 
00241 }

void AstUtil::HorizonToIdeal ( double  altitude,
double  azimuth,
double &  dcosx_ideal,
double &  dcosy_ideal,
double &  dcosz_ideal 
)

Definition at line 158 of file AstCoordinate.cxx.

References Mphysical::pi.

Referenced by HorizonToLocal(), and AstValidate::TestIdealToHorizon().

00159                                                                    {
00160   // Static method to convert horizon coordinates to ideal detector
00161   // coordinates.
00162   double zenrad = (90. - altitude)*Mphysical::pi/180.; 
00163   double azirad = azimuth*Mphysical::pi/180.;
00164   dcosy_ideal =  cos(zenrad);
00165   dcosx_ideal = -sin(zenrad)*sin(azirad);
00166   dcosz_ideal =  sin(zenrad)*cos(azirad);
00167   return;
00168 
00169 }

void AstUtil::HorizonToLocal ( double  altitude,
double  azimuth,
Detector::Detector_t  dettype,
double &  dcosx,
double &  dcosy,
double &  dcosz 
)

Definition at line 171 of file AstCoordinate.cxx.

References HorizonToIdeal(), and IdealToLocal().

00173                          {
00174   // Static method to convert horizon coordinates to direction cosines
00175 
00176   double dcosx_ideal,dcosy_ideal,dcosz_ideal;
00177   AstUtil::HorizonToIdeal(altitude,azimuth,dcosx_ideal,dcosy_ideal,
00178                                                        dcosz_ideal);
00179   AstUtil::IdealToLocal(dcosx_ideal,dcosy_ideal,dcosz_ideal,dettype,
00180                         dcosx,dcosy,dcosz);
00181   return;
00182 }

void AstUtil::IdealToHorizon ( double  dcosx_ideal,
double  dcosy_ideal,
double  dcosz_ideal,
double &  altitude,
double &  azimuth 
)

Definition at line 146 of file AstCoordinate.cxx.

References Mphysical::pi.

Referenced by LocalToHorizon(), and AstValidate::TestIdealToHorizon().

00147                                                                       {
00148   // Static method to convert ideal coordinate system direction cosines to 
00149   // horizon coordinates.
00150 
00151   double zenith = acos(dcosy_ideal)*180./Mphysical::pi;
00152   altitude = 90. - zenith;
00153   azimuth = 180.*atan2(-dcosx_ideal,dcosz_ideal)/Mphysical::pi;
00154   if ( azimuth < 0. ) azimuth += 360.;
00155 
00156 }

void AstUtil::IdealToLocal ( double  dcosx_ideal,
double  dcosy_ideal,
double  dcosz_ideal,
Detector::Detector_t  dettype,
double &  dcosx,
double &  dcosy,
double &  dcosz 
)

Definition at line 100 of file AstCoordinate.cxx.

References GetDetRotMatrixIdealToLocal(), Msg::kWarning, and MSG.

Referenced by HorizonToLocal(), and AstValidate::TestLocalToIdeal().

00102                                                    {
00103   // Static method to convert direction cosines from ideal detector 
00104   // coordinates to local detector coordinates.
00105 
00106   const double* rotmatrix = AstUtil::GetDetRotMatrixIdealToLocal(dettype);
00107   if ( !rotmatrix ) {
00108     MSG("Ast",Msg::kWarning) 
00109       << "No rotation matrix available for requested det type " << dettype
00110       << ".\n No rotation from ideal to local coordinates  will be applied." 
00111       << endl;
00112     dcosx = dcosx_ideal;
00113     dcosy = dcosy_ideal;
00114     dcosz = dcosz_ideal;
00115     return;
00116   }
00117 
00118   dcosx = rotmatrix[0]*dcosx_ideal
00119         + rotmatrix[1]*dcosy_ideal
00120         + rotmatrix[2]*dcosz_ideal;
00121   dcosy = rotmatrix[3]*dcosx_ideal
00122         + rotmatrix[4]*dcosy_ideal
00123         + rotmatrix[5]*dcosz_ideal;
00124   dcosz = rotmatrix[6]*dcosx_ideal
00125         + rotmatrix[7]*dcosy_ideal
00126         + rotmatrix[8]*dcosz_ideal;
00127   return;
00128 
00129 }

void AstUtil::JulianToGAST ( double  juliandate,
double &  gast 
)

Definition at line 38 of file AstTime.cxx.

References earthtilt(), and sidereal_time().

Referenced by NtpSRModule::FillNtpTrackCosmicRay(), and AstValidate::TestJulianDateToSiderealTime().

00038                                                             {
00039   // Static method to convert from julian date to greenwich
00040   // apparent sidereal time (hours)
00041 
00042   double oblm,oblt,eqeq,psi,eps;
00043   earthtilt(juliandate,&oblm,&oblt,&eqeq,&psi,&eps);
00044 
00045   double fracjuliandate = fmod(juliandate,1.);
00046   double intjuliandate = juliandate - fracjuliandate;
00047   sidereal_time(intjuliandate,fracjuliandate,eqeq,&gast); // nova routine
00048  
00049 }

void AstUtil::JulianToGMST ( double  juliandate,
double &  gmst 
)

Definition at line 28 of file AstTime.cxx.

References sidereal_time().

Referenced by ANtpInfoObjectFiller::FillHeaderInformation(), and AstValidate::TestJulianDateToSiderealTime().

00028                                                             {
00029   // Static method to convert from julian date (hours) to greenwich
00030   // mean sidereal time (hours)
00031 
00032   double fracjuliandate = fmod(juliandate,1.);
00033   double intjuliandate = juliandate - fracjuliandate;
00034   sidereal_time(intjuliandate,fracjuliandate,0,&gmst); // nova routine
00035  
00036 }

void AstUtil::LocalToHorizon ( double  dcosx,
double  dcosy,
double  dcosz,
Detector::Detector_t  dettype,
double &  altitude,
double &  azimuth 
)

Definition at line 131 of file AstCoordinate.cxx.

References IdealToHorizon(), and LocalToIdeal().

Referenced by MNtpModule::Ana(), TrackDirectionModule::Ana(), NtpSRModule::FillNtpTrackCosmicRay(), and AlgRmMu::RunAlg().

00132                                                                    {
00133   // Static method to convert direction cosines to horizon coordinates
00134   // The direction cosines are local to the detector type specified by dettype.
00135 
00136 
00137   double dcosx_ideal,dcosy_ideal,dcosz_ideal;
00138 
00139   AstUtil::LocalToIdeal(dcosx,dcosy,dcosz,dettype,dcosx_ideal,
00140                          dcosy_ideal,dcosz_ideal);
00141   AstUtil::IdealToHorizon(dcosx_ideal,dcosy_ideal,dcosz_ideal,altitude,
00142                              azimuth);
00143 
00144 }

void AstUtil::LocalToIdeal ( double  dcosx,
double  dcosy,
double  dcosz,
Detector::Detector_t  dettype,
double &  dcosx_ideal,
double &  dcosy_ideal,
double &  dcosz_ideal 
)

Definition at line 69 of file AstCoordinate.cxx.

References GetDetRotMatrixLocalToIdeal(), Msg::kWarning, and MSG.

Referenced by LocalToHorizon(), and AstValidate::TestLocalToIdeal().

00071                                                 {
00072   // Static method to convert direction cosines from local detector
00073   // coordinates to ideal detector coordinates.
00074 
00075   const double* rotmatrix = AstUtil::GetDetRotMatrixLocalToIdeal(dettype);
00076   if ( !rotmatrix ) {
00077     MSG("Ast",Msg::kWarning) 
00078       << "No rotation matrix available for requested det type " << dettype
00079       << ".\n No rotation from local to ideal coordinates will be applied." 
00080       << endl;
00081     dcosx_ideal = dcosx;
00082     dcosy_ideal = dcosy;
00083     dcosz_ideal = dcosz;
00084     return;
00085   }
00086 
00087   dcosx_ideal = rotmatrix[0]*dcosx
00088               + rotmatrix[1]*dcosy
00089               + rotmatrix[2]*dcosz;
00090   dcosy_ideal = rotmatrix[3]*dcosx
00091               + rotmatrix[4]*dcosy
00092               + rotmatrix[5]*dcosz;
00093   dcosz_ideal = rotmatrix[6]*dcosx
00094               + rotmatrix[7]*dcosy
00095               + rotmatrix[8]*dcosz;
00096   return;
00097 
00098 }

void AstUtil::LSTToGST ( double  lst,
double  longitude,
double &  gst 
)

Definition at line 61 of file AstTime.cxx.

00061                                                               {
00062   // Static method to convert from lst to gst (hours) 
00063   // Longitude is expressed in degrees and east of 0^o is +, west -.
00064 
00065   gst = lst - longitude*12./180.; // hours
00066   if ( gst < 0. ) gst += 24.;
00067   if ( gst > 24. ) gst -= 24.;
00068 }


Variable Documentation

const double AstUtil::kFarDetLatitude = 47.82026653

Definition at line 28 of file Ast.h.

Referenced by GetDetLatitude().

const double AstUtil::kFarDetLongitude = -92.24141202

Definition at line 27 of file Ast.h.

Referenced by ANtpInfoObjectFiller::FillHeaderInformation(), and GetDetLongitude().

Initial value:
 { kFarDetRotMatrixLocalToIdeal[0],
   kFarDetRotMatrixLocalToIdeal[3],
   kFarDetRotMatrixLocalToIdeal[6],
   kFarDetRotMatrixLocalToIdeal[1],
   kFarDetRotMatrixLocalToIdeal[4],
   kFarDetRotMatrixLocalToIdeal[7],
   kFarDetRotMatrixLocalToIdeal[2],
   kFarDetRotMatrixLocalToIdeal[5],
   kFarDetRotMatrixLocalToIdeal[8] }

Definition at line 56 of file Ast.h.

Referenced by GetDetRotMatrixIdealToLocal().

Initial value:
 { 0.894507011,0,0.447053919,
                 0,          1,          0,
                -0.447053919,0,0.894507011}

Definition at line 53 of file Ast.h.

Referenced by GetDetRotMatrixLocalToIdeal().

const double AstUtil::kNearDetLatitude = 41.84056333

Definition at line 67 of file Ast.h.

Referenced by GetDetLatitude().

const double AstUtil::kNearDetLongitude = -88.27062086

Definition at line 66 of file Ast.h.

Referenced by ANtpInfoObjectFiller::FillHeaderInformation(), and GetDetLongitude().

Initial value:
{ kNearDetRotMatrixLocalToIdeal[0],
  kNearDetRotMatrixLocalToIdeal[3],
  kNearDetRotMatrixLocalToIdeal[6],
  kNearDetRotMatrixLocalToIdeal[1],
  kNearDetRotMatrixLocalToIdeal[4],
  kNearDetRotMatrixLocalToIdeal[7],
  kNearDetRotMatrixLocalToIdeal[2],
  kNearDetRotMatrixLocalToIdeal[5],
  kNearDetRotMatrixLocalToIdeal[8] }

Definition at line 74 of file Ast.h.

Referenced by GetDetRotMatrixIdealToLocal().

Initial value:
 { 0.914188882,0,0.405288399,
                              0,          1,          0,
                             -0.405288399,0,0.914188882}

Definition at line 71 of file Ast.h.

Referenced by GetDetRotMatrixLocalToIdeal().


Generated on 14 Dec 2017 for loon by  doxygen 1.6.1