Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

AstTime.cxx

Go to the documentation of this file.
00001 
00002 //
00003 // AstTime
00004 //
00005 // Package: Ast (AstTime).
00006 //
00007 // S. Kasahara 05/03
00008 //
00009 // Purpose: Provide utility routines to convert between different
00010 //          astronomical time systems.
00011 //
00013 
00014 #include "AstroUtil/novas.h"
00015 #include "AstroUtil/AstTime.h"
00016 
00017 // Definition of methods (alphabetical order)
00018 // ******************************************
00019 
00020 void AstUtil::CalendarToJulian( int year, int month, int day,
00021                                 double hour, double& juliandate ) {
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 }
00027 
00028 void AstUtil::JulianToGMST( double juliandate, double& gmst ) {
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 }
00037 
00038 void AstUtil::JulianToGAST( double juliandate, double& gast ) {
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 }
00050 
00051 void AstUtil::GSTToLST(double gst,double longitude,double& lst) {
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 }
00060 
00061 void AstUtil::LSTToGST(double lst,double longitude,double& gst) {
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 }
00069 
00070 
00071 
00072 
00073 
00074 
00075 
00076 
00077 
00078 

Generated on Mon Feb 15 11:06:23 2010 for loon by  doxygen 1.3.9.1