Index: trunk/doc/pslib/eoc_testing.txt
===================================================================
--- trunk/doc/pslib/eoc_testing.txt	(revision 5550)
+++ trunk/doc/pslib/eoc_testing.txt	(revision 5551)
@@ -7,5 +7,6 @@
 explicitly setting the values in the struct.
 
-2. Convert obj to a psCube (psSphereToCube), should get:
+
+2. Convert obj to a psCube (psSphereToCube), and check that:
 
     x=-0.3596195125758298
@@ -13,4 +14,5 @@
     z=0.7496834983724809
 
+
 3. Stuff the Sun position into a psCube (sunCube):
 
@@ -19,5 +21,6 @@
     z=1.1220046291457653E10
 
-Convert to a psSphere (psCubeToSphere *sun).
+Convert to a psSphere (psCubeToSphere *sun) for later use.
+
 
 4. Gravitational deflection:
@@ -25,9 +28,10 @@
     psGravityDeflection(obj, obj, sun);
 
-Convert obj to a psCube, should get:
+Convert obj to a psCube, and check that:
 
     x=-0.35961949760293604
     y=0.5555613950298085
     z=0.7496835020836093
+
 
 5. Earth's direction of motion is:
@@ -42,7 +46,9 @@
     z=0.09694774143797581
 
-These two need to be summed.  Converting to a psSphere gives the
-direction of motion (psSphere *direction), while the magnitude gives
-the speed (double speed).
+These two vectors need to be summed (standard vector addition).
+Converting to a psSphere gives the direction of motion (psSphere
+*direction), while the magnitude gives the speed, after dividing by
+the speed of light (double speed).
+
 
 6. Aberration:
@@ -50,5 +56,5 @@
     psAberration(obj, obj, direction, speed);
 
-Convert obj to a psCube, should get:
+Convert obj to a psCube, check that:
 
     x=-0.35963388069046304
@@ -56,24 +62,63 @@
     z=0.7497078321908413
 
-7. Generate a psTime (time) for 2003-04-01T01:30:00 UTC.
-
-8. Precession
+
+7. Generate a psTime (time) for 2003-04-01T01:30:00 UTC.  Check that:
+
+time->sec == 1049160600
+time->nsec == 0
+time->leapsecond = false
+
+Copy time and convert to UT1:
+
+     timeUT1 = psTimeAlloc(PS_TIME_UTC);
+     timeUT1->sec = time->sec;
+     timeUT1->nsec = time->nsec;
+     timeUT1->leapsecond = time->leapsecond;
+     timeUT1 = psTimeConvert(timeUT1, PS_TIME_UT1);
+
+Then check timeUT1:
+
+     timeUT1->sec == 1049160599
+     timeUT1->nsec == 657017200 (+/- hundreds of nsec at least)
+
+
+8. Precession:
 
 (a) psEarthPole *precession = psEOC_PrecessionModel(time);
-(b) psEarthPole *precessionCorr = psEOC_PrecessionCorr(time, PS_IERS_A);
-
-Add the above components:
+
+Check that:
+
+    X=2.857175590089105E-4
+    Y=2.3968739377734732E-5
+    S=-1.3970066457904322E-8
+
+(b) psEarthPole *precessionCorr = psEOC_PrecessionCorr(time, PS_IERS_B);
+
+Check that:
+
+    X = 0.06295703125
+    Y = -0.0287618408203125
+    S = 0
+
+(c) Generate the transformation:
 
     precession->x += precessionCorr->x;
     precession->y += precessionCorr->y;
     precession->s += precessionCorr->s;
-
-Apply these to the position:
-
     psSphereRot *precessionNutationInv = psSphereRot_CEOtoGCRS(earth); // This is CEO->GCRS
     psSphereRot precessionNutation = psSphereRotInvert(precessionNutationInv); // This is GCRS->CEO
+
+Check that the rotation quaternion of precessionNutationInv is:
+
+    -1.1984522406756289E-5
+    1.4285893358610674E-4
+    1.2191193518914336E-10
+    -0.9999999897238481
+
+(d) Apply the rotation to the position:
+
     obj = psSphereRotApply(obj, precessionNutation, obj);
 
-Convert obj to a psCube, should get:
+Convert obj to a psCube and check that:
 
     x=-0.3598480726985338
@@ -81,11 +126,26 @@
     z=0.7496183628158023
 
-9. Earth rotation:
+
+9. Earth rotation
+
+(a) Generate the transformation:
 
     psSphereRot *earthRotInv = psSphereRot_TEOtoCEO(time); // This is TEO->CEO
     psSphereRot *earthRot = psSphereRotInvert(earthRotInv); // This is CEO->TEO
+
+Check that the rotation quaternion of earthRotInv is:
+
+    0.0
+    0.0
+    0.9625401009002903
+    0.2711393629830588
+
+Within psSphereRot_TEOtoCEO, the Earth rotation angle should be 428251.4641536639 degrees
+
+(b) Apply the rotation to the position:
+
     obj = psSphereRotApply(obj, earthRot, obj);
 
-Convert obj to a psCube, should get:
+Convert obj to a psCube and check that:
 
     x=0.01698625430807123
@@ -93,7 +153,8 @@
     z=0.7496183628158023
 
+
 10. Polar Motion:
 
-(a) psEarthPole *earthPM = psEOC_GetPolarMotion(time, PS_IERS_A);
+(a) psEarthPole *earthPM = psEOC_GetPolarMotion(time, PS_IERS_B);
 (b) psEarthPole *nutationCorr = psEOC_NutationCorr(time);
 
@@ -104,8 +165,24 @@
     earthPM->s += nutationCorr->s;
 
-Apply these to the position:
+Check that:
+
+    x=-0.13275353774074533
+    y=0.4359436319739848
+    s=-4.2376965863576153E-10
+
+(c) Generate the transformation:
 
    psSphereRot *polarMotionInv = psSphereRot_ITRStoTEO(earthPM); // This is ITRS->TEO
    psSphereRot *polarMotion = psSphereRotInvert(polarMotionInv); // This is TEO->ITRS
+
+Check that the rotation quaternion of polarMotionInv is:
+
+    -1.0567571848664005E-6
+    3.218036562931509E-7
+    -3.3580195807204483E-12
+    -0.9999999999993899
+
+(d) Apply these to the position:
+
    obj = psSphereRotApply(obj, polarMotion, obj);
 
@@ -116,5 +193,8 @@
     z=0.7496169753347885
 
+
 11. The psLib SDRS does not define functions to go beyond this point
 (specifically, atmospheric refraction correction, and conversion to
-the observer's horizon coordinates), so we stop here.
+the observer's horizon coordinates), so we stop here.  But check that
+the above sequence can be executed faithfully in the reverse order as
+well.
