00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00013
00014 #include "AstroUtil/novas.h"
00015 #include "AstroUtil/AstTime.h"
00016
00017
00018
00019
00020 void AstUtil::CalendarToJulian( int year, int month, int day,
00021 double hour, double& juliandate ) {
00022
00023
00024 juliandate = julian_date(year,month,day,hour);
00025
00026 }
00027
00028 void AstUtil::JulianToGMST( double juliandate, double& gmst ) {
00029
00030
00031
00032 double fracjuliandate = fmod(juliandate,1.);
00033 double intjuliandate = juliandate - fracjuliandate;
00034 sidereal_time(intjuliandate,fracjuliandate,0,&gmst);
00035
00036 }
00037
00038 void AstUtil::JulianToGAST( double juliandate, double& gast ) {
00039
00040
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);
00048
00049 }
00050
00051 void AstUtil::GSTToLST(double gst,double longitude,double& lst) {
00052
00053
00054
00055
00056 lst = gst + longitude*12./180.;
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
00063
00064
00065 gst = lst - longitude*12./180.;
00066 if ( gst < 0. ) gst += 24.;
00067 if ( gst > 24. ) gst -= 24.;
00068 }
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078