Index: /trunk/doc/pslib/psLibADD.tex
===================================================================
--- /trunk/doc/pslib/psLibADD.tex	(revision 1399)
+++ /trunk/doc/pslib/psLibADD.tex	(revision 1400)
@@ -1,3 +1,3 @@
-%%% $Id: psLibADD.tex,v 1.22 2004-07-13 21:43:09 eugene Exp $
+%%% $Id: psLibADD.tex,v 1.23 2004-08-06 19:06:36 eugene Exp $
 \documentclass[panstarrs]{panstarrs}
 
@@ -641,4 +641,71 @@
 Positional Astronomy Library}.
 
+\subsubsection{Time}
+
+Correct time representation is critical in astronomical software.
+PSLib uses the \code{psTime} structure to represent all time
+values.  This structure represents a time which is equivalent to TAI
+(International Atomic Time) and has the following properties:
+\begin{itemize}
+\item it represents both seconds and microseconds
+\item the seconds are continuous (no leap seconds)
+\item the zero reference point is \tbd{1970/01/01,00:00:10} UTC.
+\end{itemize}
+
+Julian Day (JD) and Modified Julian Day (MJD) are both continuous time
+representations, with one julian day interval having a length of 86400
+TAI seconds.  MJD is equal to JD - 2400000.5 and has a zero point
+equal to that of TAI, while JD has a zero point 0.5 off of TAI.
+Conversion between \code{psTime} values and MJD and JD are determined
+from:
+
+\begin{verbatim}
+mjd = psTime.tv_sec/86400.0 + psTime.tv_usec/86400000000.0 + 40587.0;
+ jd = psTime.tv_sec/86400.0 + psTime.tv_usec/86400000000.0 + 2440587.5;
+\end{verbatim}
+
+The entry below gives the current relationship between JD, MJD, UTC,
+and TAI, and comes from the reference at
+\code{http://tycho.usno.navy.mil/leapsec.html}
+
+\begin{verbatim}
+ 1961 JAN  1 =JD 2437300.5  TAI-UTC=   1.4228180 S + (MJD - 37300.) X 0.001296 S
+ 1961 AUG  1 =JD 2437512.5  TAI-UTC=   1.3728180 S + (MJD - 37300.) X 0.001296 S
+ 1962 JAN  1 =JD 2437665.5  TAI-UTC=   1.8458580 S + (MJD - 37665.) X 0.0011232S
+ 1963 NOV  1 =JD 2438334.5  TAI-UTC=   1.9458580 S + (MJD - 37665.) X 0.0011232S
+ 1964 JAN  1 =JD 2438395.5  TAI-UTC=   3.2401300 S + (MJD - 38761.) X 0.001296 S
+ 1964 APR  1 =JD 2438486.5  TAI-UTC=   3.3401300 S + (MJD - 38761.) X 0.001296 S
+ 1964 SEP  1 =JD 2438639.5  TAI-UTC=   3.4401300 S + (MJD - 38761.) X 0.001296 S
+ 1965 JAN  1 =JD 2438761.5  TAI-UTC=   3.5401300 S + (MJD - 38761.) X 0.001296 S
+ 1965 MAR  1 =JD 2438820.5  TAI-UTC=   3.6401300 S + (MJD - 38761.) X 0.001296 S
+ 1965 JUL  1 =JD 2438942.5  TAI-UTC=   3.7401300 S + (MJD - 38761.) X 0.001296 S
+ 1965 SEP  1 =JD 2439004.5  TAI-UTC=   3.8401300 S + (MJD - 38761.) X 0.001296 S
+ 1966 JAN  1 =JD 2439126.5  TAI-UTC=   4.3131700 S + (MJD - 39126.) X 0.002592 S
+ 1968 FEB  1 =JD 2439887.5  TAI-UTC=   4.2131700 S + (MJD - 39126.) X 0.002592 S
+ 1972 JAN  1 =JD 2441317.5  TAI-UTC=  10.0       S + (MJD - 41317.) X 0.0      S
+ 1972 JUL  1 =JD 2441499.5  TAI-UTC=  11.0       S + (MJD - 41317.) X 0.0      S
+ 1973 JAN  1 =JD 2441683.5  TAI-UTC=  12.0       S + (MJD - 41317.) X 0.0      S
+ 1974 JAN  1 =JD 2442048.5  TAI-UTC=  13.0       S + (MJD - 41317.) X 0.0      S
+ 1975 JAN  1 =JD 2442413.5  TAI-UTC=  14.0       S + (MJD - 41317.) X 0.0      S
+ 1976 JAN  1 =JD 2442778.5  TAI-UTC=  15.0       S + (MJD - 41317.) X 0.0      S
+ 1977 JAN  1 =JD 2443144.5  TAI-UTC=  16.0       S + (MJD - 41317.) X 0.0      S
+ 1978 JAN  1 =JD 2443509.5  TAI-UTC=  17.0       S + (MJD - 41317.) X 0.0      S
+ 1979 JAN  1 =JD 2443874.5  TAI-UTC=  18.0       S + (MJD - 41317.) X 0.0      S
+ 1980 JAN  1 =JD 2444239.5  TAI-UTC=  19.0       S + (MJD - 41317.) X 0.0      S
+ 1981 JUL  1 =JD 2444786.5  TAI-UTC=  20.0       S + (MJD - 41317.) X 0.0      S
+ 1982 JUL  1 =JD 2445151.5  TAI-UTC=  21.0       S + (MJD - 41317.) X 0.0      S
+ 1983 JUL  1 =JD 2445516.5  TAI-UTC=  22.0       S + (MJD - 41317.) X 0.0      S
+ 1985 JUL  1 =JD 2446247.5  TAI-UTC=  23.0       S + (MJD - 41317.) X 0.0      S
+ 1988 JAN  1 =JD 2447161.5  TAI-UTC=  24.0       S + (MJD - 41317.) X 0.0      S
+ 1990 JAN  1 =JD 2447892.5  TAI-UTC=  25.0       S + (MJD - 41317.) X 0.0      S
+ 1991 JAN  1 =JD 2448257.5  TAI-UTC=  26.0       S + (MJD - 41317.) X 0.0      S
+ 1992 JUL  1 =JD 2448804.5  TAI-UTC=  27.0       S + (MJD - 41317.) X 0.0      S
+ 1993 JUL  1 =JD 2449169.5  TAI-UTC=  28.0       S + (MJD - 41317.) X 0.0      S
+ 1994 JUL  1 =JD 2449534.5  TAI-UTC=  29.0       S + (MJD - 41317.) X 0.0      S
+ 1996 JAN  1 =JD 2450083.5  TAI-UTC=  30.0       S + (MJD - 41317.) X 0.0      S
+ 1997 JUL  1 =JD 2450630.5  TAI-UTC=  31.0       S + (MJD - 41317.) X 0.0      S
+ 1999 JAN  1 =JD 2451179.5  TAI-UTC=  32.0       S + (MJD - 41317.) X 0.0      S
+\end{verbatim}
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
Index: /trunk/doc/pslib/psLibSDRS.tex
===================================================================
--- /trunk/doc/pslib/psLibSDRS.tex	(revision 1399)
+++ /trunk/doc/pslib/psLibSDRS.tex	(revision 1400)
@@ -1,3 +1,3 @@
-%%% $Id: psLibSDRS.tex,v 1.61 2004-07-13 21:42:55 eugene Exp $
+%%% $Id: psLibSDRS.tex,v 1.62 2004-08-06 19:06:36 eugene Exp $
 \documentclass[panstarrs,spec]{panstarrs}
 
@@ -2661,18 +2661,16 @@
 We require a collection of functions to manipulate time data.  These
 operations primarily consist of conversions between specific time
-formats.  PSLib wraps the libTAI structure \code{taia} for use as the
-native time format.  
+formats.  PSLib currently uses the UNIX \code{timeval} structure
+representation of time as the native time format.
 \begin{verbatim}
 typedef struct {
-  struct taia t;
+  time_t         tv_sec;   /* seconds */
+  suseconds_t    tv_usec;  /* microseconds */
 } psTime;
 \end{verbatim}
 
-Two utility functions provide the current time in two formats, MJD
-(modified Julian day) and the Sidereal time.  
-
-\begin{verbatim}
-psTime psGetMJD(void);
-psTime psGetSidereal(float mjd, float longitude);
+A utility function provides the current time from the system clock, in correct TAI units:
+\begin{verbatim}
+psTime psTimeGetTime (void);
 \end{verbatim}
 
@@ -2698,4 +2696,9 @@
 psTime *psTimevalToTime (struct timeval *input);
 psTime *psTMtoTime (struct tm *input);
+\end{verbatim}
+
+\begin{verbatim}
+double psMJDToSidereal (double MJD, double longitude);
+double psSiderealToMJD (double sidereal, double longitude);
 \end{verbatim}
 
Index: /trunk/doc/pslib/psLibSRS.tex
===================================================================
--- /trunk/doc/pslib/psLibSRS.tex	(revision 1399)
+++ /trunk/doc/pslib/psLibSRS.tex	(revision 1400)
@@ -1,3 +1,3 @@
-%%% $Id: psLibSRS.tex,v 1.6 2004-06-25 03:04:46 eugene Exp $
+%%% $Id: psLibSRS.tex,v 1.7 2004-08-06 19:06:36 eugene Exp $
 \documentclass[panstarrs]{panstarrs}
 
@@ -82,5 +82,5 @@
 `gcc' version v2.95 or higher.
 
-Scripting language must be in \tbd{Python, version TBD}. 
+Scripting language must be in \tbd{Perl, version TBD}. 
 
 \paragraph{Interfaces}
@@ -101,5 +101,5 @@
 convention (line-feed only).  C coding style must adhere to the
 standard defined in the document 'Pan-STARRS C-coding standard'
-(PSDC-430-004).  \tbd{Python coding must follow the Python standard
+(PSDC-430-004).  \tbd{Perl coding must follow the Perl standard
 defined in the document TBD}.
 
@@ -179,6 +179,6 @@
 \paragraph{Commenting and Documentation}
 
-Commenting of delivered C and Python code must follow the C and
-Python coding standards and must provide tags for Doxygen
+Commenting of delivered C and Perl code must follow the C and
+Perl coding standards and must provide tags for Doxygen
 interpretation of the comments and program structures.
 
