Index: /trunk/psLib/src/astro/Makefile.am
===================================================================
--- /trunk/psLib/src/astro/Makefile.am	(revision 5014)
+++ /trunk/psLib/src/astro/Makefile.am	(revision 5015)
@@ -1,5 +1,5 @@
 #Makefile for astronomy functions of psLib
 #
-AM_CFLAGS=$(CFLAGS) -DPS_CONFIG_FILE_DEFAULT=\"$(sysconfdir)/pslib/psTime.config\"
+AM_CFLAGS=$(CFLAGS) -DPS_CONFIG_FILE_DEFAULT=\"$(sysconfdir)/pslib/pslib.config\"
 
 noinst_LTLIBRARIES = libpslibastro.la
Index: /trunk/psLib/src/astro/psTime.c
===================================================================
--- /trunk/psLib/src/astro/psTime.c	(revision 5014)
+++ /trunk/psLib/src/astro/psTime.c	(revision 5015)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-02 21:32:03 $
+ *  @version $Revision: 1.70 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-13 01:09:58 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -88,6 +88,4 @@
 static char *cleanString(char *inString, int sLen);
 static char* getToken(char **inString, char *delimiter, psParseErrorType *status);
-static psF64 searchTables(psF64 index, psU64 column, char *metadataTableNames[],
-                          psU32 nTables, psLookupStatusType* status);
 static psTime* convertTimeTAIUTC(psTime* time);
 static psTime* convertTimeUTCTAI(psTime* time);
@@ -156,5 +154,5 @@
 }
 
-// get the psTime.config filename by checking environment variable first, then original installation area.
+// get the pslib.config filename by checking environment variable first, then original installation area.
 char* p_psGetConfigFileName()
 {
@@ -171,6 +169,6 @@
 // Searches time tables in priority order and performs interpolation if input index value is within a table.
 // If the index value is out of range, the status is set accordingly.
-static psF64 searchTables(psF64 index, psU64 column, char *metadataTableNames[],
-                          psU32 nTables, psLookupStatusType* status)
+psF64 p_psTimeSearchTables(psF64 index, psU64 column, char *metadataTableNames[],
+                           psU32 nTables, psLookupStatusType* status)
 {
     char*            tableName          = NULL;
@@ -179,8 +177,7 @@
     psMetadataItem*  tableMetadataItem  = NULL;
 
-    // Check time metadata. Function call reports errors.
-    if(timeMetadata == NULL) {
-        if(!p_psTimeInit(p_psGetConfigFileName()))
-            *status = PS_LOOKUP_ERROR;
+    // Check if psTime tables are already loaded
+    if(!p_psTimeInit(p_psGetConfigFileName())) {
+        *status = PS_LOOKUP_ERROR;
         return NAN;
     }
@@ -254,5 +251,10 @@
     char metadataTableNames[4][MAX_STRING_LENGTH] = {"daily", "eopc",  "finals", "tai"};
 
-    // Read time config file
+    // Check if the p_psTimeInit has already been ran
+    if (timeMetadata != NULL) {
+        return true;
+    }
+
+    // Read config file
     timeMetadata = psMetadataConfigParse(timeMetadata, &nFail, fileName, true);
     if(timeMetadata == NULL) {
@@ -847,5 +849,5 @@
     // Attempt to find value through table lookup and interpolation
     mjd = psTimeToMJD(time);
-    result = searchTables(mjd,tableColumn,metadataTableNames,nTables,&status);
+    result = p_psTimeSearchTables(mjd,tableColumn,metadataTableNames,nTables,&status);
 
     // Value could not be found through table lookup and interpolation
@@ -855,5 +857,5 @@
         psLogMsg(__func__,PS_LOG_WARN,PS_ERRORTEXT_psTime_TIME_PREDATES_TABLES,mjd,"UT1-UTC");
 
-        // Lookup value from time metadata loaded from psTime.config
+        // Lookup value from time metadata loaded from pslib.config
         tableMetadataItem = psMetadataLookup(timeMetadata, "psLib.time.before.dut");
         if(tableMetadataItem == NULL) {
@@ -926,8 +928,8 @@
     // Attempt to find value through table lookup and interpolation
     mjd = psTimeToMJD(time);
-    //    x = searchTables(mjd, 0, &xStatus, metadataTableNames, nTables);
-    x = searchTables(mjd, 0, metadataTableNames, nTables,&xStatus);
-    //    y = searchTables(mjd, 0, &yStatus, metadataTableNames, nTables);
-    y = searchTables(mjd, 0, metadataTableNames, nTables,&yStatus);
+    //    x = p_psTimeSearchTables(mjd, 0, &xStatus, metadataTableNames, nTables);
+    x = p_psTimeSearchTables(mjd, 0, metadataTableNames, nTables,&xStatus);
+    //    y = p_psTimeSearchTables(mjd, 0, &yStatus, metadataTableNames, nTables);
+    y = p_psTimeSearchTables(mjd, 0, metadataTableNames, nTables,&yStatus);
 
     // Value could not be found through table lookup and interpolation
@@ -1037,10 +1039,9 @@
     PS_ASSERT_INT_WITHIN_RANGE(time->nsec,0,(psU32)((1e9)-1),NAN);
 
-    // Check time metadata
-    if(timeMetadata == NULL) {
-        if(!p_psTimeInit(p_psGetConfigFileName())) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_FILE_NOT_FOUND, "psTime.config");
-            return 0.0;
-        }
+    // Check if psTime tables are loaded/loadable
+    if(!p_psTimeInit(p_psGetConfigFileName())) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_FILE_NOT_FOUND,
+                p_psGetConfigFileName());
+        return 0.0;
     }
 
Index: /trunk/psLib/src/astro/psTime.h
===================================================================
--- /trunk/psLib/src/astro/psTime.h	(revision 5014)
+++ /trunk/psLib/src/astro/psTime.h	(revision 5015)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-02 21:32:03 $
+ *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-13 01:09:58 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -26,4 +26,5 @@
 #include "psType.h"
 #include "psImage.h"
+#include "psLookupTable.h"
 #include "psCoord.h"
 
@@ -360,4 +361,12 @@
 char* p_psGetConfigFileName();
 
+psF64 p_psTimeSearchTables(
+    psF64 index,
+    psU64 column,
+    char *metadataTableNames[],
+    psU32 nTables,
+    psLookupStatusType* status
+);
+
 /// @}
 
Index: /trunk/psLib/src/sys/psString.h
===================================================================
--- /trunk/psLib/src/sys/psString.h	(revision 5014)
+++ /trunk/psLib/src/sys/psString.h	(revision 5015)
@@ -13,6 +13,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-30 00:33:36 $
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-13 01:09:58 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -64,5 +64,5 @@
 psString psStringNCopy(
     const char *string,                ///< Input string of characters to copy
-    unsigned int nChar                          ///< Number of bytes to allocate for string copy
+    unsigned int nChar                 ///< Number of bytes to allocate for string copy
 );
 
