KELT-South: KELT -South: calculating JD and Local Sidereal Time Update - PROBLEM RESOLVED!!: Just like (almost) all frustrating problems in science using computers co mputers,, this this proble pr oblem m had had a trivi trivial al,, eas eas y, and al altogether obvious soluti s olution on (in retrospect). retros pect). I chased the intriguing difference between the correct sideral time and the calculated sidereal time of 4 minutes, suggestively close to the difference between a sidereal day (23h 56m 4.09s)) and a me 4.09s mean an solar day day (24 hours). hours ). How Howeve ever, r, after rea r eading ding up on the arcane is is s ues in precise timekee timekeepi ping, ng, with a semi-inte semi-interes resti ting ng digress digres s ion to lea earn rn about the 10 days mi mis s sing in October 1582 at the adopti adoption on of the Gregorian Grego rian calenda calendarr , I decided to recheck my program code. co de. Everything looked OK, and I decided decided to start star t fiddli fiddling ng with with data data types. In VBScript, VBSc ript, one does not declare variables as a certain type, although you can change them into certain types in the progr pro gram am after decla dec laration. ration. I experim exper imented ented with with changing all all my numer numerical ical variables to double-precision type, rer reran an the pr progr ogram, am, and it now works wor ks perfectl perf ectly. y. So it it goes...
Update (sort of): A little little context for the problem pro blem below. We need need the JD and LST for calcul ca lculating ating whi which ch fields fields of the sky are vi visible sible at a given given time, time, and for where to moon moo n is. is. We do do not use these values for the time time tags for the images images we take, that comes directly from the computer clock, which employs synchronization software to stay accurate to less than one second. sec ond. Gi Given ven that that fact, we coul co uld d also a lso calculate calculate LST LS T directly from from loca locall clock clock tim time, e, rather than using using JD - we had simply wanted to use JD since it seemed like the most sensible method for getting LST, and all formulas for obtaining it went though JD. Therefor Therefore, e, if you you have a good method for gettin gett ing g LST with with or without using using JD, send it our way! ---------------------------------------------------------------------------------------
Here is a pro problem blem I would would invite invite anyone anyone to comm comment ent about. abo ut. As part par t of the internal internal programmin programming g for for KELT, we need to calculate the current curr ent Julian Julian Day (JD) along with with the Local Sideral Sidera l Tim Timee (LST). (LST). I have employed two differe different nt formul formulas as to calculate JD:
JD = 367*Y 367*Yea earr - Int( 7*[Yea 7*[Yearr + Int( [Mon [Month th + 9]/1 9]/12 2 )]/4 )]/4 ) - Int( Int( 3*[Int( 3*[Int( [Yea [Yearr + (Month (Month 9)/7]/100 ) + 1]/4 ) + Int( 275*Month/9 ) + Day + 1721028.5 + Hour/24 + Minute/1440 + Second/86400 Second/86400 a = Int( [14 - Month]/1 Month]/12 2) b = Year + 4800 - a c = Month + 12*a - 3 JD = Int( [153*c + 2]/5 ) +b*365 + Int( b/4 ) - Int( b/100 ) + Int( b/400 ) - 32045.5 + Day + Hour/24 + Minute/1440 + Second/86400 These formu formulas las both appear to accurately ac curately calcul calculate ate JD to at least 4 decimal decimal places (8.6s)* (8. 6s)*(see (see post p ost above). abo ve). I currently currently have a problem prob lem,, however, accurate accurately ly calcul calculatin ating g LST. I have so far found found 2 form formul ulas as to pro provi vide de LST from JD. They are:
a = 280.46061837 + 360.98564736629*JD 360.98564736629*JD + 0.000387933*( Int(JD/36525.0) )^2 - ( Int(JD/36525.0) )^3/3871 )^3/38710000 0000 GMST = mod(a,360)
a = 18.697374558 + 24.06570982441908*(JD-2451545.0) GMST = mod( a, 24 ) LST = mod( (GMST+L), 24 )
where GMST is Greenwich Mean Sidereal Time, and L is the Longitude of Sutherland. The first formula calculates GMST and LST in degrees, while the second formula calculates it in hours. In the first formula, L is expressed as negative decimal degrees (-20.810694), and in the second formula, L is expressed in negative decimal hours (1.3873796). The top formula comes from the website of Steve Schmitt. It seems to give LST...almost. It is off by about -4 minutes (giving g a value for LST 4 minutes early than the correct value). The second formula is from a USNO website, yet it seems to provide a completely wrong answer. As a worked example, at about 10:15pm, Sunday, September 21, 2008, the JD is 2454731.3439 and the LST is 21:42:45. While the above formulas calculate JD correctly, the top formula gives LST = 21:38:28, and the bottom formula gives 18:56:03.
Anyway, if someone has any comments about an error in the calculations, or a suggestion for a different way to calculate LST from JD, please chime in. And we need an algorithm that will directly compute LST from JD, not a method like "determine JD at most recent UT midnight..." since we want something that will be simple to code, check, and modify if necessary.