next up previous contents
Next: Example: caltech_lst program Up: Galactic Modelling Previous: Galactic Modelling   Contents


Function: local_sidereal_time()

float local_sidereal_time(time_t time, float longitude)

Returns the local sidereal time, in decimal hours, for a given calendar time and detector longitude. The arguments are:

time: Input. The time as an integer number of seconds since 0h 1 January 1970. This number is returned by the time routines in <time.h>.
longitude: Input. The longitude of the detector in degrees West.

The local sidereal time is calculated as follows. Let JD be the Julian date of 0h on the desired calendar day. (This is computed using the Numerical Recipes routine julday(), but a value of 0.5 must be subtracted from this routine to give the JD at 0h rather than at 12h.) The Universal Time, UT, is computed using the gmtime() function. The Greenwich Sidereal Time, GST, is

\begin{displaymath}
\mbox{GST} = T_0 + 1.002\,737\,909\times\mbox{UT}
\end{displaymath}

(modulo 24 hours) where

\begin{displaymath}
T_0 = 6.697\,374\,558 + 2\,400.051\,336\times T + 0.000\,025\,862\times T^2
\end{displaymath}

and

\begin{displaymath}
T = \frac{\mbox{JD}-2\,451\,545}{36\,525}.
\end{displaymath}

The local sidereal time is obtained by subtracting the longitude of the detector expressed as decimal hours West of Greenwich.

Author: Jolien Creighton, jolien@tapir.caltech.edu
Comments: This routine is adapted from the method given in: Peter Duffet-Smith Practical Astronomy with Your Calculator, 3rd edition, (Cambridge University Press, 1988).


next up previous contents
Next: Example: caltech_lst program Up: Galactic Modelling Previous: Galactic Modelling   Contents
Bruce Allen 2000-11-19