Index: trunk/psModules/src/astrom/pmAstrometryTable.c
===================================================================
--- trunk/psModules/src/astrom/pmAstrometryTable.c	(revision 15357)
+++ trunk/psModules/src/astrom/pmAstrometryTable.c	(revision 15562)
@@ -1,16 +1,16 @@
 /** @file  pmAstrometryObjects.c
-*
-*  @brief This file defines the basic types for matching objects
-*  based on their astrometry.
-*
-*  @ingroup AstroImage
-*
-*  @author EAM, IfA
-*
-*  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2007-10-23 20:52:42 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*/
+ *
+ *  @brief This file defines the basic types for matching objects
+ *  based on their astrometry.
+ *
+ *  @ingroup AstroImage
+ *
+ *  @author EAM, IfA
+ *
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-11-10 01:09:20 $
+ *
+ *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
+ */
 
 #ifdef HAVE_CONFIG_H
@@ -29,7 +29,13 @@
 #include <pslib.h>
 
+#include "pmConfig.h"
+#include "pmDetrendDB.h"
 #include "pmHDU.h"
 #include "pmFPA.h"
-#include "pmAstrometryObjects.h"
+#include "pmFPALevel.h"
+#include "pmFPAview.h"
+#include "pmFPAfile.h"
+#include "pmAstrometryTable.h"
+
 
 /********************* CheckDataStatus functions *****************************/
@@ -179,24 +185,28 @@
 bool pmAstromWriteChip (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
 {
-    // define the EXTNAME values used for the table data, and residual image segments
-    {
-        // lookup the EXTNAME values used for table data and image header segments
-        char *rule = NULL;
-
-        // Menu of EXTNAME rules
-        psMetadata *menu = psMetadataLookupMetadata(&status, file->camera, "EXTNAME.RULES");
-        if (!menu) {
-            psError(PS_ERR_UNKNOWN, true, "missing EXTNAME.RULES in camera.config");
-            return false;
-        }
-
-        // EXTNAME for image header
-        rule = psMetadataLookupStr(&status, menu, "ASTROMETRY");
-        if (!rule) {
-            psError(PS_ERR_UNKNOWN, false, "missing entry for ASTROMETRY in EXTNAME.RULES in camera.config");
-            return false;
-        }
-        extname = pmFPAfileNameFromRule (rule, file, view);
-    }
+    bool status;
+    // *** define the EXTNAME values used for the table data, and residual image segments ***
+
+    // lookup the EXTNAME values used for table data and image header segments
+    char *rule = NULL;
+
+    // Menu of EXTNAME rules
+    psMetadata *menu = psMetadataLookupMetadata(&status, file->camera, "EXTNAME.RULES");
+    if (!menu) {
+	psError(PS_ERR_UNKNOWN, true, "missing EXTNAME.RULES in camera.config");
+	return false;
+    }
+
+    // EXTNAME for image header
+    rule = psMetadataLookupStr(&status, menu, "ASTROMETRY");
+    if (!rule) {
+	psError(PS_ERR_UNKNOWN, false, "missing entry for ASTROMETRY in EXTNAME.RULES in camera.config");
+	return false;
+    }
+
+    // XXX need to finish this: uncomment when used
+    # if (0)
+    char *extname = pmFPAfileNameFromRule (rule, file, view);
+    # endif
 
     // write the chip elements in the following form:
@@ -244,24 +254,27 @@
 bool pmAstromReadChip (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
 {
-    // define the EXTNAME values used for the table data, and residual image segments
-    {
-        // lookup the EXTNAME values used for table data and image header segments
-        char *rule = NULL;
-
-        // Menu of EXTNAME rules
-        psMetadata *menu = psMetadataLookupMetadata(&status, file->camera, "EXTNAME.RULES");
-        if (!menu) {
-            psError(PS_ERR_UNKNOWN, true, "missing EXTNAME.RULES in camera.config");
-            return false;
-        }
-
-        // EXTNAME for image header
-        rule = psMetadataLookupStr(&status, menu, "ASTROMETRY");
-        if (!rule) {
-            psError(PS_ERR_UNKNOWN, false, "missing entry for ASTROMETRY in EXTNAME.RULES in camera.config");
-            return false;
-        }
-        extname = pmFPAfileNameFromRule (rule, file, view);
-    }
+    bool status;
+
+    // lookup the EXTNAME values used for table data and image header segments
+    char *rule = NULL;
+
+    // Menu of EXTNAME rules
+    psMetadata *menu = psMetadataLookupMetadata(&status, file->camera, "EXTNAME.RULES");
+    if (!menu) {
+	psError(PS_ERR_UNKNOWN, true, "missing EXTNAME.RULES in camera.config");
+	return false;
+    }
+
+    // EXTNAME for image header
+    rule = psMetadataLookupStr(&status, menu, "ASTROMETRY");
+    if (!rule) {
+	psError(PS_ERR_UNKNOWN, false, "missing entry for ASTROMETRY in EXTNAME.RULES in camera.config");
+	return false;
+    }
+
+    // XXX finish this: uncomment when used
+    # if (0)
+    char *extname = pmFPAfileNameFromRule (rule, file, view);
+    # endif
 
     // read the chip elements in the following form:
