Index: /trunk/psLib/psTableParse.c
===================================================================
--- /trunk/psLib/psTableParse.c	(revision 5824)
+++ /trunk/psLib/psTableParse.c	(revision 5824)
@@ -0,0 +1,85 @@
+/** @file  psTableParse.c
+ *
+ *  @brief Parses input data tables and outputs .dat files for specified format
+ *
+ *  @ingroup psTableParse
+ *
+ *  @author Dave Robbins, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-12-21 06:15:58 $
+ *
+ *  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
+ */
+
+#include "pslib.h"
+
+int main(int argc, char *argv[])
+{
+    if (argc < 2) {
+        printf("\n Insufficient arguments.  Use [-h] for help.\n");
+        return 0;
+    }
+    if (!strncmp(argv[1], "-h", 2) ) {
+        printf("\n Usage:  psTableParse inputTable.data outputTable.dat columnNumbers.\n");
+        printf(" i.e.    psTableParse finals.data finals.dat 1 3 4 8\n");
+        return 0;
+    }
+
+    FILE *output;
+    FILE *input;
+    input = fopen(argv[1], "r");
+    output = fopen(argv[2], "w");
+    char data;
+    char data2[200];
+    int i;
+    while ( fscanf(input, "%188c", &data2) != EOF) {
+        for (i = 7; i <= 14; i++) {
+            fprintf(output, "%c", data2[i]);
+        }
+        fprintf(output, "  ");
+        for (i = 97; i <= 105; i++) {
+            if (data2[102] == ' ') {
+                fprintf(output, "    0.000 ");
+                i = 106;
+            } else {
+                fprintf(output, "%c", data2[i]);
+            }
+        }
+        fprintf(output, "  ");
+        for (i = 116; i <= 124; i++) {
+            if (data2[121] == ' ') {
+                fprintf(output, "   0.000");
+                i = 125;
+            } else {
+                fprintf(output, "%c", data2[i]);
+            }
+        }
+        fprintf(output, "  ");
+        for (i = 165; i <= 174; i++) {
+            if (data2[170] == ' ') {
+                fprintf(output, "     0.000 ");
+                i = 175;
+            } else {
+                fprintf(output, "%c", data2[i]);
+            }
+        }
+        fprintf(output, "  ");
+        for (i = 175; i <= 184; i++) {
+            if (data2[180] == ' ') {
+                fprintf(output, "    0.000 ");
+                i = 185;
+            } else {
+                fprintf(output, "%c", data2[i]);
+            }
+        }
+
+
+        fprintf(output, "\n");
+    }
+
+    fclose(input);
+    fclose(output);
+    return 0;
+}
+
Index: /trunk/psLib/test/astro/tst_psEarthOrientation.c
===================================================================
--- /trunk/psLib/test/astro/tst_psEarthOrientation.c	(revision 5823)
+++ /trunk/psLib/test/astro/tst_psEarthOrientation.c	(revision 5824)
@@ -5,6 +5,6 @@
 *  @author d-Rob, MHPCC
 *
-*  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-12-20 05:05:37 $
+*  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-12-21 06:15:58 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -363,4 +363,49 @@
     }
 
+    pcorr->x = 2.857175590089105e-4;
+    pcorr->y = 2.3968739377734732e-5;
+    pcorr->s = -1.3970066457904322e-8;
+    //    pcorr->x += 3.05224300720406e-7;
+    //    pcorr->y += -1.39441339235822e-7;
+    double q0, q1, q2;
+    q0 = -1.1984522406756289e-5;
+    q1 = 1.4285893358610674e-4;
+    q2 = 1.2191193518914336e-10;
+    psSphereRot *pni = psSphereRot_CEOtoGCRS(pcorr);
+    if (fabs(pni->q0-q0) > FLT_EPSILON || fabs(pni->q1-q1) > FLT_EPSILON ||
+            fabs(pni->q2-q2) > FLT_EPSILON ) {
+        printf("\n Error at CEOtoGCRS, output psSphereRot doesn't match expected.\n");
+    }
+    printf("\n  Output sphere rotation   = %.13g,%.13g,%.13g,%.13g\n",
+           pni->q0, pni->q1, pni->q2, pni->q3);
+    printf("  Expected sphere rotation = %.13g,%.13g,%.13g\n", q0,q1,q2);
+    psCube *objC = psCubeAlloc();
+    //    objC->x = -3.5963388069046304;
+    //    objC->y = 0.5555192509816625;
+    //    objC->z = 0.7497078321908413;
+    objSetup();
+    psSphereRot *pn = psSphereRotConjugate(NULL, pni);
+    //    psSphere *sphere = psCubeToSphere(objC);
+    psSphere *sphere = psSphereAlloc();
+    *sphere = *obj;
+    psFree(obj);
+    psSphere *result = psSphereRotApply(NULL, pn, sphere);
+    objC->x = -0.3598480726985338;
+    objC->y = 0.5555012823608123;
+    objC->z = 0.7496183628158023;
+    psFree(sphere);
+    sphere = psCubeToSphere(objC);
+    psFree(objC);
+    printf("\n Spheres:  out = %.13g, %.13g,    expect = %.13g, %.13g\n",
+           result->r, result->d, sphere->r, sphere->d);
+    double xx = acos(cos(result->r)*cos(sphere->r)*cos(result->d - sphere->d) + sin(result->r)*sin(sphere->r));
+    printf("GREAT CIRCLE DIFFERENCE = %.13g \n\n", xx);
+
+    psFree(sphere);
+    psFree(result);
+    psFree(pn);
+    //    psFree(obj);
+    psFree(pni);
+
     psFree(pcorr);
 
