Index: /trunk/psLib/src/astro/parse_gcov-out.c
===================================================================
--- /trunk/psLib/src/astro/parse_gcov-out.c	(revision 9932)
+++ /trunk/psLib/src/astro/parse_gcov-out.c	(revision 9932)
@@ -0,0 +1,111 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define MAXSTR 10000
+
+static char outStr[MAXSTR];
+static float average;
+static int sum;
+
+void parseFile(FILE *in, const char *filename);
+
+int main(void)
+{
+
+    FILE *output = NULL;
+    FILE *input = NULL;
+    average = 0.0;
+    sum = 0;
+    int N = 0;
+
+    input = fopen("sph_gcov.out", "r");
+    parseFile(input, "psSphereOps.c");
+    fclose(input);
+    N++;
+
+    input = fopen("eoc_gcov.out", "r");
+    parseFile(input, "psEarthOrientation.c");
+    fclose(input);
+    N++;
+
+    input = fopen("time_gcov.out", "r");
+    parseFile(input, "psTime.c");
+    fclose(input);
+    N++;
+
+    input = fopen("crd_gcov.out", "r");
+    parseFile(input, "psCoord.c");
+    fclose(input);
+    N++;
+
+    average = average / sum;
+
+    output = fopen("Coverage-Report.txt", "w");
+    fprintf(output, "\nTOTAL COVERAGE IN THE ../src/astro/ DIRECTORY\n");
+    fprintf(output, "\n%s", outStr);
+    fprintf(output, "  -------------------------------"
+            "-------------------------------------\n");
+    fprintf(output, "  ---> Total                        = Lines executed:");
+    fprintf(output, "%3.2f%%  of %d\n\n", average, sum);
+    fclose(output);
+    return 0;
+}
+
+void parseINT(const char *nums, float percent)
+{
+    sum += atoi(nums);
+    average += (float)((int)(percent * atoi(nums)));
+}
+
+float parseDBL(const char *nums)
+{
+    char temp[7];
+    int i = 0;
+    int j = 9;
+    float out = 0.0;
+    while (nums[j] != '%') {
+        temp[i] = nums[j];
+        i++;
+        j++;
+    }
+    //    average += (float)atof(temp);
+    out = (float)atof(temp);
+    return out;
+}
+
+void parseFile(FILE *in, const char *filename)
+{
+    char currentStr[100];
+    char searchStr[100];
+    char out[250];
+    sprintf(out, "  >><< %-25s    =", filename);
+    sprintf(searchStr, "'%s'", filename);
+    //    printf("\n searchStr = %s\n", searchStr);
+    strcat(outStr, out);
+    int i;
+    float numLines = 0.0;
+    while ( fscanf(in, "%s", currentStr) != EOF) {
+        if ( strncmp(currentStr, searchStr, 99) == 0 ) {
+            for (i = 0; i < 4; i++) {
+                if (i == 1) {
+                    fscanf(in, "%s", out);
+                    numLines = parseDBL(out);
+                    sprintf(currentStr, "%-16s", out);
+                } else if ( i == 3) {
+                    fscanf(in, "%s", out);
+                    parseINT(out, numLines);
+                    sprintf(currentStr, "%s", out);
+                } else {
+                    fscanf(in, "%s", currentStr);
+                }
+                strcat(outStr, " ");
+                strcat(outStr, currentStr);
+            }
+            continue;
+        }
+    }
+    strcat(outStr, "\n\n");
+}
+
Index: /trunk/psLib/src/astro/profile_tap
===================================================================
--- /trunk/psLib/src/astro/profile_tap	(revision 9932)
+++ /trunk/psLib/src/astro/profile_tap	(revision 9932)
@@ -0,0 +1,9 @@
+
+gcov -f --object-file ./.libs/libpslibastro_la-psSphereOps.o psSphereOps.c > sph_gcov.out
+gcov -f --object-file ./.libs/libpslibastro_la-psEarthOrientation.o psEarthOrientation.c > eoc_gcov.out
+gcov -f --object-file ./.libs/libpslibastro_la-psTime.o psTime.c > time_gcov.out
+gcov -f --object-file ./.libs/libpslibastro_la-psCoord.o psCoord.c > crd_gcov.out
+gcc parse_gcov-out.c -o parse_gcov
+./parse_gcov
+rm *.out
+more Coverage-Report.txt
Index: /trunk/psLib/src/astro/psSphereOps.c
===================================================================
--- /trunk/psLib/src/astro/psSphereOps.c	(revision 9931)
+++ /trunk/psLib/src/astro/psSphereOps.c	(revision 9932)
@@ -8,6 +8,6 @@
  *  @author Dave Robbins, MHPCC
  *
- *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-13 21:13:47 $
+ *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-11-09 23:26:04 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -50,4 +50,9 @@
                               double phiP)
 {
+    if (isnan(alphaP) || isnan(deltaP) || isnan(phiP) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "Input angles cannot be NaN in psSphereRotAlloc.");
+        return NULL;
+    }
     psSphereRot *r = sphereRotAlloc();
     psSphereRot *s = sphereRotAlloc();
@@ -95,4 +100,9 @@
                              double q3)
 {
+    if (isnan(q0) || isnan(q1) || isnan(q2) || isnan(q3) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "Input quaternions cannot be NaN in psSphereRotQuat.");
+        return NULL;
+    }
     //allocate space for a new sphere rotation and set deallocator
     psSphereRot* rot = sphereRotAlloc();
