Index: trunk/psLib/src/astronomy/psTime.h
===================================================================
--- trunk/psLib/src/astronomy/psTime.h	(revision 1211)
+++ trunk/psLib/src/astronomy/psTime.h	(revision 1223)
@@ -1,14 +1,17 @@
 /** @file  psTime.h
  *
- *  @brief Provides time and timing utilities for psLib.
+ *  @brief Definitions for time, time utilities, and conversion functions for use with psLib astronomy
+ *  functions.
  *
- *  Time, time utilities, and conversion functions are defined for use with psLib astronomy functions.
- *
- *  @ingroup Time
+ *  A collection of functions are required by psLib to manipulate time data. These functions primarily consist
+ *  of conversions between specific time formats.  PSLib currently uses the UNIX timeval time system as the
+ *  base upon which International Atomic Time (TAI) time is calculated. All time conversion functions within
+ *  psLib, except those noted, are calculated in terms of TAI time, which is approxinmately 32 seconds faster
+ *  than UTC/timeval.
  *
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-13 01:04:37 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-15 19:02:13 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -17,4 +20,10 @@
 #ifndef PSTIME_H
 #define PSTIME_H
+
+#include <time.h>
+#include <sys/types.h>
+#include <sys/time.h>
+
+#include "psType.h"
 
 /// @addtogroup Time
@@ -25,13 +34,14 @@
 /******************************************************************************/
 
-/** Struct containing psTime.
+/** Definition of psTime.
  *
- *  This struct defines current time in terms of seconds, nanoseconds, and attoseconds. 
+ *  The psTime struct is used by psLib to represent time values critical to astronomical calculations.  This
+ *  structure represents a time which is equivalent to TAI (International Atomic Time) and is measured in
+ *  both seconds and microseconds.
  */
 typedef struct
 {
-    long tv_sec;    /**< Seconds since epoch, Jan 1, 1970. */
-    long tv_nsec;   /**< Nanoseconds since last second. */
-    long tv_asec;   /**< Attoseconds since last nanosecond. */
+    time_t        tv_sec;    /**< Seconds since epoch, Jan 1, 1970. */
+    suseconds_t   tv_usec;   /**< Microseconds since last second. */
 }
 psTime;
@@ -41,34 +51,123 @@
 /*****************************************************************************/
 
-/** Get current UTC time.
+/** Get current TAI time.
  *
- * Gets current UTC timespec time.
+ * Gets current time from the system clock in correct TAI units.
  *
- *  @return  psTime*: Pointer to struct with current time.
+ *  @return  psTime: Struct with current time.
  */
-psTime* psGetTime(
-    psTime *time    /** Time to return or null for auto allocation. */
+psTime psTimeGetTime(
+    void   /** No argument. */
 );
 
-/** Convert psTime to ISO time.
+/** Convert psTime to ISO time in TAI units.
  *
- * Converts psTime to a null terminated string in the form of: YYYY/MM/DD,HH:MM:SS.SSS.
+ * Converts psTime to a null terminated string in the form of: YYYY/MM/DD,HH:MM:SS.SSS. The result from this
+ * function is in TAI units.
  *
- *  @return  char*: Pointer null terminated array of chars.
+ *  @return  char*: Pointer null terminated array of chars in ISO/TAI time.
  */
-char* psTimeToISOTime(
-    psTime *time    /** Input time to be converted. */
+char* psTimeToISO(
+    psTime time     /** Input time to be converted. */
 );
 
 /** Convert psTime to UTC time.
  *
- * Converts psTime to UTC time in double precision floating point notation.
+ * Converts psTime to UTC time in double precision floating point notation. The result from this function is
+ * not in TAI units, but that of UTC, which does not contain leapseconds.
  *
  *  @return  double: UTC time in floating point notation.
  */
-double psTimeToISOTime(
-    psTime *time    /** Input time to be converted. */
+double psTimeToUTC(
+    psTime time    /** Input time to be converted. */
 );
 
+/** Convert psTime to modified Julian date time.
+ *
+ * Converts psTime to modified Julian date (MJD) time. The result from this function is in TAI units.
+ *
+ *  @return  double: MJD/TAI time in floating point notation.
+ */
+double psTimeToMJD(
+    psTime time    /** Input time to be converted. */
+);
+
+/** Convert psTime to Julian date time.
+ *
+ * Converts psTime to Julian date (JD) time. The result from this function is in TAI units.
+ *
+ *  @return  double: JD/TAI time in floating point notation.
+ */
+double psTimeToJD(
+    psTime time    /** Input time to be converted. */
+);
+
+/** Convert psTime to timeval time.
+ *
+ * Converts psTime to timeval time. The result from this function is in TAI units.
+ *
+ *  @return  timeval: timeval/TAI time.
+ */
+struct timeval psTimeToTimeval(
+                psTime time    /** Input time to be converted. */
+            );
+
+/** Convert psTime to tm time.
+ *
+ * Converts psTime to tm time. The result from this function is in TAI units.
+ *
+ *  @return  tm: tm/TAI time.
+ */
+struct tm* psTimeToTM(
+                psTime time    /** Input time to be converted. */
+            );
+
+/** Convert ISO to psTime.
+ *
+ * Converts ISO time to psTime. The result from this function is in TAI units.
+ *
+ *  @return  psTime: time in TAI units.
+ */
+psTime psISOToTime(char *time);
+
+/** Convert UTC to psTime.
+ *
+ * Converts UTC time to psTime. The result from this function is in TAI units.
+ *
+ *  @return  psTime: time in TAI units.
+ */
+psTime psUTCToTime(double time);
+
+/** Convert MJD to psTime.
+ *
+ * Converts MJD time to psTime. The result from this function is in TAI units.
+ *
+ *  @return  psTime: time in TAI units.
+ */
+psTime psMJDToTime(double time);
+
+/** Convert JD to psTime.
+ *
+ * Converts JD time to psTime. The result from this function is in TAI units.
+ *
+ *  @return  psTime: time in TAI units.
+ */
+psTime psJDToTime(double time);
+
+/** Convert timeval to psTime.
+ *
+ * Converts timeval time to psTime. The result from this function is in TAI units.
+ *
+ *  @return  psTime: time in TAI units.
+ */
+psTime psTimevalToTime(struct timeval *time);
+
+/** Convert tm time to psTime.
+ *
+ * Converts tm time to psTime. The result from this function is in TAI units.
+ *
+ *  @return  psTime: time in TAI units.
+ */
+psTime psTMToTime(struct tm *time);
 /// @}
 
