Index: /trunk/psLib/src/astro/psEarthOrientation.c
===================================================================
--- /trunk/psLib/src/astro/psEarthOrientation.c	(revision 5446)
+++ /trunk/psLib/src/astro/psEarthOrientation.c	(revision 5447)
@@ -9,6 +9,6 @@
 *  @author Robert Daniel DeSonia, MHPCC
 *
-*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-10-26 01:20:15 $
+*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-10-27 20:38:18 $
 *
 *  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
@@ -158,12 +158,17 @@
 }
 
-psSphere *psAberration(psSphere *apparent, const psSphere *actual, const psSphere *direction, double speed)
-{
-
-
-    return NULL;
-}
-
-psSphere *psGravityDeflection(psSphere *apparent, psSphere *actual, psSphere *sun)
+psSphere *psAberration(psSphere *actual,
+                       const psSphere *apparent,
+                       const psSphere *direction,
+                       double speed)
+{
+
+
+    return NULL;
+}
+
+psSphere *psGravityDeflection(psSphere *actual,
+                              psSphere *apparent,
+                              psSphere *sun)
 {
     PS_ASSERT_PTR_NON_NULL(apparent, NULL);
@@ -223,5 +228,6 @@
 
 
-double psEOC_ParallaxFactor(const psSphere *coords, const psTime *time)
+double psEOC_ParallaxFactor(const psSphere *coords,
+                            const psTime *time)
 {
 
@@ -373,5 +379,6 @@
 
 
-psEarthPole *psEOC_PrecessionCorr(const psTime *time, psTimeBulletin bulletin)
+psEarthPole *psEOC_PrecessionCorr(const psTime *time,
+                                  psTimeBulletin bulletin)
 {
     return NULL;
@@ -391,5 +398,6 @@
 
 
-psEarthPole* psEOC_GetPolarMotion(const psTime *time, psTimeBulletin bulletin)
+psEarthPole* psEOC_GetPolarMotion(const psTime *time,
+                                  psTimeBulletin bulletin)
 {
     return NULL;
Index: /trunk/psLib/src/astro/psEarthOrientation.h
===================================================================
--- /trunk/psLib/src/astro/psEarthOrientation.h	(revision 5446)
+++ /trunk/psLib/src/astro/psEarthOrientation.h	(revision 5447)
@@ -9,6 +9,6 @@
 *  @author Robert Daniel DeSonia, MHPCC
 *
-*  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-10-26 01:20:15 $
+*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-10-27 20:38:18 $
 *
 *  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
@@ -22,36 +22,41 @@
 #include "psSphereOps.h"
 
-/**
- *
- *
- */
+/** Structure for respresenting the Earth's pole at any moment or determine velocity
+ *  at the pole.  This structure carries the polar coordinate information.       */
 typedef struct
 {
-    double x;                          ///<
-    double y;                          ///<
-    double s;                          ///<
+    double x;                          ///< X component of the earth's pole
+    double y;                          ///< Y component of the earth's pole
+    double s;                          ///< s component of the earth's pole
 }
 psEarthPole;
 
-/**
+/** Method for spherical precession used to specify the level of detail used in
+ *  calculation.
  *
+ *  @see psSpherePrecess
  *
  */
 typedef enum {
-    PS_PRECESS_ROUGH,                  ///<
-    PS_PRECESS_COMPLETE,               ///<
-    PS_PRECESS_IAU2000A,               ///<
+    PS_PRECESS_ROUGH,                  ///< roughest, lowest level of detail
+    PS_PRECESS_COMPLETE,               ///< complete level of detail
+    PS_PRECESS_IAU2000A,               ///< highest level of detail
 } psPrecessMethod;
 
-/**
+/** Calculates the actual position of a star, given its apparent position and the
+ *  velocity vector of the observer.
  *
+ *  The actual and apparent positions are represented as psSphere entries, as is the
+ *  direction of motion.  The speed in that direction is given in units of the speed
+ *  of light.  If the value of actual is NULL, a new psSphere is allocated, otherwise
+ *  the point to actual is used for the result.
  *
- *
+ *  @return psSphere*:      the actual position of a star.
  */
 psSphere *psAberration(
-    psSphere *apparent,                ///<
-    const psSphere *actual,            ///<
-    const psSphere *direction,         ///<
-    double speed                       ///<
+    psSphere *actual,                  ///< actual position of star
+    const psSphere *apparent,          ///< apparent position of star
+    const psSphere *direction,         ///< direction of motion of observer
+    double speed                       ///< speed of motion of observer
 );
 
@@ -66,84 +71,97 @@
  */
 psSphere *psGravityDeflection(
+    psSphere *actual,                  ///< actual position of star
     psSphere *apparent,                ///< apparent position of star
-    psSphere *actual,                  ///< actual position of star
     psSphere *sun                      ///< position of the sun
 );
 
-/**
+/** Calculate the parallax factor for the given position and time.
  *
- *
+ *  @return double:     the calculated parallax factor.
  */
 double psEOC_ParallaxFactor(
-    const psSphere *coords,            ///<
-    const psTime *time                 ///<
+    const psSphere *coords,            ///< specified position
+    const psTime *time                 ///< specified time
 );
 
-/**
+/** Calculates the components of the rotation between the CEO and GCRS frames, X, Y,
+ *  and s, using the IAU2000A precession & nutation model.
  *
+ *  The input time may be represented in any format other than UT1.  This routine must
+ *  give results identical to the IERS XYS2000A subroutine.
  *
+ *  @return psEarthPole*:       the calculated components of the rotation.
  */
 psEarthPole *psEOC_PrecessionModel(
-    const psTime *time                 ///<
+    const psTime *time                 ///< specified time
 );
 
-/**
+/** Provides interpolated corrections to the X and Y components of the polar
+ *  coordinates from the tables provided by the IERS, just as it does for UT1 and
+ *  polar motion.
  *
- *
+ *  @return psEarthPole*:       interpolated corrections to the precession components.
  */
 psEarthPole *psEOC_PrecessionCorr(
-    const psTime *time,                ///<
-    psTimeBulletin bulletin            ///<
+    const psTime *time,                ///< specified time
+    psTimeBulletin bulletin            ///< IERS tables for polar coordinate components.
 );
 
-/**
+/** Constructs the spherical rotation for transforming from CEO to GCRS coordinates.
  *
+ *  The resulting psSphereRot may be used to determine the rotation from CIP/CEO to
+ *  GCRS.  This function must give results identical to the IERS BPN2000.
  *
+ *  @return psSphereRot*:       spherical rotation for CEO to GCRS transformation.
  */
 psSphereRot *psSphereRot_CEOtoGCRS(
-    const psEarthPole *pole            ///<
+    const psEarthPole *pole            ///< input coordinates to transform
 );
 
-/**
+/** Calculates the rotation of the Earth about the CIP.
  *
- *
+ *  @return psSphereRot*:       sphereical rotation
  */
 psSphereRot *psSphereRot_TEOtoCEO(
-    const psTime *time                 ///<
+    const psTime *time                 ///< specified time
 );
 
-/**
+/** Provides interpolated values of the polar motion components extracted from the
+ *  IERS tables.
  *
- *
+ *  @return psEarthPole*:       interpolated polar motion components.
  */
 psEarthPole *psEOC_GetPolarMotion(
-    const psTime *time,                ///<
-    psTimeBulletin bulletin            ///<
+    const psTime *time,                ///< specified time
+    psTimeBulletin bulletin            ///< IERS tables for polar coordinate components.
 );
 
-/**
+/** Provides tidal corrections to the polar motion components using the Ray model
+ *  of Simon et al.
  *
- *
+ *  @return psEarthPole*:       corrected polar motion components.
  */
 psEarthPole *psEOC_PolarTideCorr(
-    const psTime *time                 ///<
+    const psTime *time                 ///< specified time
 );
 
-/**
+/** Provides the additional corrections due to nutation terms with periods less than
+ *  or equal to two days, as well as the correction to the s-prime component of polar
+ *  motion.
  *
- *
- *
+ *  @return psEarthPole*:       corrected polar motion components.
  */
 psEarthPole *psEOC_NutationCorr(
-    psTime *time                       ///<
+    psTime *time                       ///< specified time
 );
 
-/**
+/** Converts the polar motion corrections to a spherical rotation.
  *
+ *  This function should give identical results to the IERS POM2000 subroutine.
  *
- *
+ *  @return psSphereRot*:       ITRS to TEO sphere rotation.
  */
 psSphereRot *psSphereRot_ITRStoTEO(
-    const psEarthPole *motion          ///<
+    const psEarthPole *motion          ///< corrected polar motion components
 );
 
Index: /trunk/psLib/test/astro/tst_psEarthOrientation.c
===================================================================
--- /trunk/psLib/test/astro/tst_psEarthOrientation.c	(revision 5446)
+++ /trunk/psLib/test/astro/tst_psEarthOrientation.c	(revision 5447)
@@ -6,6 +6,6 @@
 *  @author d-Rob, MHPCC
 *
-*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-10-26 01:20:15 $
+*  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-10-27 20:38:19 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -59,4 +59,5 @@
     psSphere *apparent = psSphereAlloc();
     psSphere *sun = psSphereAlloc();
+    psSphere *empty = NULL;
 
     sun->r = 0.2;
@@ -65,5 +66,19 @@
     apparent->d = 0.2035;
 
-    actual = psGravityDeflection(apparent, actual, sun);
+    empty = psGravityDeflection(empty, actual, sun);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                "psGravityDeflection Failed to return NULL for NULL apparent input sphere.\n");
+        return 1;
+    }
+    empty = psGravityDeflection(empty, apparent, actual);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                "psGravityDeflection Failed to return NULL for NULL sun input sphere.\n");
+        return 2;
+    }
+
+
+    actual = psGravityDeflection(actual, apparent, sun);
     psSphere *result = psSphereSetOffset(apparent, actual, PS_SPHERICAL, PS_RADIAN);
     printf("\nApparent r,d = %.13g,%.13g    Actual r,d = %.13g, %.13g \n",
