Index: trunk/psLib/test/astro/tst_psEarthOrientation.c
===================================================================
--- trunk/psLib/test/astro/tst_psEarthOrientation.c	(revision 5450)
+++ trunk/psLib/test/astro/tst_psEarthOrientation.c	(revision 5455)
@@ -1,11 +1,10 @@
 /** @file  tst_psEarthOrientation.c
 *
-*  @brief The code will go on ...
-*
+*  @brief The code will perform earth orientation calculations and sphere rotations.
 *
 *  @author d-Rob, MHPCC
 *
-*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-10-28 02:25:22 $
+*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-11-02 01:07:25 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -43,21 +42,21 @@
 psS32 testAberration(void)
 {
-    psSphere *actual = NULL;
-    psSphere *apparent = psSphereAlloc();
+    psSphere *apparent = NULL;
+    psSphere *actual = psSphereAlloc();
     psSphere *direction = psSphereAlloc();
     psSphere *empty = NULL;
 
-    apparent->r = 0.2;
-    apparent->d = 0.2;
+    actual->r = 0.2;
+    actual->d = 0.2;
     direction->r = 0.2035;
     direction->d = 0.2035;
 
-    empty = psAberration(empty, actual, direction, 0.1);
+    empty = psAberration(empty, apparent, direction, 0.1);
     if (empty != NULL) {
         psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psAberration failed to return NULL for NULL apparent input.\n");
+                "psAberration failed to return NULL for NULL actual input.\n");
         return 1;
     }
-    empty = psAberration(empty, apparent, actual, 0.1);
+    empty = psAberration(empty, actual, apparent, 0.1);
     if (empty != NULL) {
         psError(PS_ERR_BAD_PARAMETER_NULL, false,
@@ -66,9 +65,9 @@
     }
 
-    actual = psAberration(actual, apparent, direction, 0.4);
-    printf("\nactual = r,d  = %.8g, %.8g\n", actual->r, actual->d);
+    apparent = psAberration(apparent, actual, direction, 0.4);
+    printf("\napparent = r,d  = %.8g, %.8g\n", apparent->r, apparent->d);
 
+    psFree(apparent);
     psFree(actual);
-    psFree(apparent);
     psFree(direction);
 
@@ -79,6 +78,6 @@
 {
 
-    psSphere *actual = NULL;
-    psSphere *apparent = psSphereAlloc();
+    psSphere *actual = psSphereAlloc();
+    psSphere *apparent = NULL;
     psSphere *sun = psSphereAlloc();
     psSphere *empty = NULL;
@@ -86,14 +85,14 @@
     sun->r = 0.2;
     sun->d = 0.2;
-    apparent->r = 0.2035;
-    apparent->d = 0.2035;
+    actual->r = 0.2035;
+    actual->d = 0.2035;
 
-    empty = psGravityDeflection(empty, actual, sun);
+    empty = psGravityDeflection(apparent, empty, sun);
     if (empty != NULL) {
         psError(PS_ERR_BAD_PARAMETER_NULL, true,
-                "psGravityDeflection Failed to return NULL for NULL apparent input sphere.\n");
+                "psGravityDeflection Failed to return NULL for NULL actual input sphere.\n");
         return 1;
     }
-    empty = psGravityDeflection(empty, apparent, actual);
+    empty = psGravityDeflection(apparent, actual, empty);
     if (empty != NULL) {
         psError(PS_ERR_BAD_PARAMETER_NULL, true,
@@ -102,8 +101,8 @@
     }
 
-    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",
-           apparent->r, apparent->d, result->r, result->d);
+    apparent = psGravityDeflection(apparent, actual, sun);
+    psSphere *result = psSphereSetOffset(actual, apparent, PS_SPHERICAL, PS_RADIAN);
+    printf("\nActual r,d = %.13g,%.13g    Apparent r,d = %.13g, %.13g \n",
+           actual->r, actual->d, result->r, result->d);
     psFree(result);
     psFree(actual);
Index: trunk/psLib/test/astro/tst_psSphereOps.c
===================================================================
--- trunk/psLib/test/astro/tst_psSphereOps.c	(revision 5450)
+++ trunk/psLib/test/astro/tst_psSphereOps.c	(revision 5455)
@@ -1,11 +1,10 @@
 /** @file  tst_psSphereOps.c
 *
-*  @brief The code will ..... Work ....
-*
+*  @brief The code will perform sphere rotations and transformations.
 *
 *  @author d-Rob, MHPCC
 *
-*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-10-28 02:25:22 $
+*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-11-02 01:07:25 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -14,4 +13,5 @@
 #include "psTest.h"
 #include "pslib_strict.h"
+
 static psS32 testSphereRotAlloc(void);
 static psS32 testSphereRotQuat(void);
@@ -275,10 +275,8 @@
                     RAD_TO_DEG(galactic->r),RAD_TO_DEG(galactic->d),
                     l[x], b[x]);
-            printf("togal- %lf,%lf,%lf,%lf   fromgal- %lf,%lf,%lf,%lf\n",
-                   toGalactic->q0, toGalactic->q1, toGalactic->q2, toGalactic->q3,
-                   fromGalactic->q0, fromGalactic->q1, fromGalactic->q2, fromGalactic->q3);
             return 3;
         }
-        if (fabs(RAD_TO_DEG(icrsFromGalactic->r) - alpha[x]) > TOLERANCE ||
+        if ( (fabs(RAD_TO_DEG(icrsFromGalactic->r) - alpha[x]) > TOLERANCE &&
+                fabs(RAD_TO_DEG(icrsFromGalactic->d) - 90.0) > TOLERANCE ) ||
                 fabs(RAD_TO_DEG(icrsFromGalactic->d) - delta[x]) > TOLERANCE) {
             psError(PS_ERR_UNKNOWN, false,
Index: trunk/psLib/test/astro/verified/tst_psEarthOrientation.stderr
===================================================================
--- trunk/psLib/test/astro/verified/tst_psEarthOrientation.stderr	(revision 5450)
+++ trunk/psLib/test/astro/verified/tst_psEarthOrientation.stderr	(revision 5455)
@@ -6,5 +6,5 @@
 
 <DATE><TIME>|<HOST>|E|psAberration (FILE:LINENO)
-    Unallowable operation: apparent is NULL.
+    Unallowable operation: actual is NULL.
 <DATE><TIME>|<HOST>|E|psAberration (FILE:LINENO)
     Unallowable operation: direction is NULL.
@@ -19,5 +19,5 @@
 
 <DATE><TIME>|<HOST>|E|psGravityDeflection (FILE:LINENO)
-    Unallowable operation: apparent is NULL.
+    Unallowable operation: actual is NULL.
 <DATE><TIME>|<HOST>|E|psGravityDeflection (FILE:LINENO)
     Unallowable operation: sun is NULL.
Index: trunk/psLib/test/astro/verified/tst_psEarthOrientation.stdout
===================================================================
--- trunk/psLib/test/astro/verified/tst_psEarthOrientation.stdout	(revision 5450)
+++ trunk/psLib/test/astro/verified/tst_psEarthOrientation.stdout	(revision 5455)
@@ -1,4 +1,4 @@
 
-actual = r,d  = 0.10218436, 0.10218436
+apparent = r,d  = 0.10218436, 0.10218436
 
-Apparent r,d = 0.2035,0.2035    Actual r,d = 0.2035000000002, 0.2035000000391 
+Actual r,d = 0.2035,0.2035    Apparent r,d = 0.2035000000002, 0.2035000000391 
Index: trunk/psLib/test/astro/verified/tst_psSphereOps.stderr
===================================================================
--- trunk/psLib/test/astro/verified/tst_psSphereOps.stderr	(revision 5450)
+++ trunk/psLib/test/astro/verified/tst_psSphereOps.stderr	(revision 5455)
@@ -1,23 +1,23 @@
 /***************************** TESTPOINT ******************************************\
 *             TestFile: tst_psSphereOps.c                                          *
-*            TestPoint: psCoord{psSphereRotAlloc()}                                *
+*            TestPoint: psSphereOps{psSphereRotAlloc()}                            *
 *             TestType: Positive                                                   *
 \**********************************************************************************/
 
 
----> TESTPOINT PASSED (psCoord{psSphereRotAlloc()} | tst_psSphereOps.c)
+---> TESTPOINT PASSED (psSphereOps{psSphereRotAlloc()} | tst_psSphereOps.c)
 
 /***************************** TESTPOINT ******************************************\
 *             TestFile: tst_psSphereOps.c                                          *
-*            TestPoint: psCoord{psSphereRotQuat()}                                 *
+*            TestPoint: psSphereOps{psSphereRotQuat()}                             *
 *             TestType: Positive                                                   *
 \**********************************************************************************/
 
 
----> TESTPOINT PASSED (psCoord{psSphereRotQuat()} | tst_psSphereOps.c)
+---> TESTPOINT PASSED (psSphereOps{psSphereRotQuat()} | tst_psSphereOps.c)
 
 /***************************** TESTPOINT ******************************************\
 *             TestFile: tst_psSphereOps.c                                          *
-*            TestPoint: psCoord{psSphereRotApply()}                                *
+*            TestPoint: psSphereOps{psSphereRotApply()}                            *
 *             TestType: Positive                                                   *
 \**********************************************************************************/
@@ -32,20 +32,18 @@
     Unallowable operation: coord is NULL.
 
----> TESTPOINT PASSED (psCoord{psSphereRotApply()} | tst_psSphereOps.c)
+---> TESTPOINT PASSED (psSphereOps{psSphereRotApply()} | tst_psSphereOps.c)
 
 /***************************** TESTPOINT ******************************************\
 *             TestFile: tst_psSphereOps.c                                          *
-*            TestPoint: psCoord{psSphereRotApplyCel()}                             *
+*            TestPoint: psSphereOps{psSphereRotApplyCel()}                         *
 *             TestType: Positive                                                   *
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|E|testSphereRotApplyCelestial (FILE:LINENO)
-    ICRS for Galactic tranformation incorrect.  Result is (180,90), expected (0,90)
 
----> TESTPOINT PASSED (psCoord{psSphereRotApplyCel()} | tst_psSphereOps.c)
+---> TESTPOINT PASSED (psSphereOps{psSphereRotApplyCel()} | tst_psSphereOps.c)
 
 /***************************** TESTPOINT ******************************************\
 *             TestFile: tst_psSphereOps.c                                          *
-*            TestPoint: psCoord{psSphereRotPrecess()}                              *
+*            TestPoint: psSphereOps{psSphereRotPrecess()}                          *
 *             TestType: Positive                                                   *
 \**********************************************************************************/
@@ -64,22 +62,21 @@
     Unallowable operation: coords is NULL.
 
----> TESTPOINT PASSED (psCoord{psSphereRotPrecess()} | tst_psSphereOps.c)
+---> TESTPOINT PASSED (psSphereOps{psSphereRotPrecess()} | tst_psSphereOps.c)
 
 /***************************** TESTPOINT ******************************************\
 *             TestFile: tst_psSphereOps.c                                          *
-*            TestPoint: psCoord{testSphereToFromCube()}                            *
+*            TestPoint: psSphereOps{testSphereOffset()}                            *
 *             TestType: Positive                                                   *
 \**********************************************************************************/
 
+<DATE><TIME>|<HOST>|E|psSphereSetOffset (FILE:LINENO)
+    Unallowable operation: position is NULL.
+<DATE><TIME>|<HOST>|E|psSphereSetOffset (FILE:LINENO)
+    Unallowable operation: offset is NULL.
+<DATE><TIME>|<HOST>|E|psSphereGetOffset (FILE:LINENO)
+    Unallowable operation: position1 is NULL.
+<DATE><TIME>|<HOST>|E|psSphereGetOffset (FILE:LINENO)
+    Unallowable operation: position2 is NULL.
 
----> TESTPOINT PASSED (psCoord{testSphereToFromCube()} | tst_psSphereOps.c)
+---> TESTPOINT PASSED (psSphereOps{testSphereOffset()} | tst_psSphereOps.c)
 
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psSphereOps.c                                          *
-*            TestPoint: psCoord{testSphereOffset()}                                *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (psCoord{testSphereOffset()} | tst_psSphereOps.c)
-
