Index: /branches/rel10_ifa/psModules/src/astrom/Makefile.am
===================================================================
--- /branches/rel10_ifa/psModules/src/astrom/Makefile.am	(revision 6672)
+++ /branches/rel10_ifa/psModules/src/astrom/Makefile.am	(revision 6673)
@@ -8,7 +8,8 @@
 	pmFPAMaskWeight.c \
 	pmFPARead.c \
+	pmFPAUtils.c \
 	pmFPAWrite.c \
 	pmHDU.c \
-	pmHDUGetLowest.c \
+	pmHDUUtils.c \
 	pmReadout.c \
 	pmConcepts.c \
@@ -29,7 +30,8 @@
 	pmFPAMaskWeight.h \
 	pmFPARead.h \
+	pmFPAUtils.h \
 	pmFPAWrite.h \
 	pmHDU.h \
-	pmHDUGetLowest.h \
+	pmHDUUtils.h \
 	pmReadout.h \
 	psAdditionals.h \
Index: /branches/rel10_ifa/psModules/src/astrom/pmFPA.c
===================================================================
--- /branches/rel10_ifa/psModules/src/astrom/pmFPA.c	(revision 6672)
+++ /branches/rel10_ifa/psModules/src/astrom/pmFPA.c	(revision 6673)
@@ -12,6 +12,6 @@
 * XXX: Should we implement non-linear cell->chip transforms?
 *
-*  @version $Revision: 1.1.4.3 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-03-15 02:37:16 $
+*  @version $Revision: 1.1.4.4 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-03-23 03:09:57 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -363,32 +363,4 @@
 }
 
-pmHDU *pmHDUFromFPA(pmFPA *fpa          // FPA for which to find HDU
-                   )
-{
-    return fpa->hdu;
-}
-
-pmHDU *pmHDUFromChip(pmChip *chip       // Chip for which to find HDU
-                    )
-{
-    pmHDU *hdu = chip->hdu;             // The HDU information
-    if (!hdu) {
-        hdu = pmHDUFromFPA(chip->parent); // Grab HDU info from the FPA
-    }
-
-    return hdu;
-}
-
-pmHDU *pmHDUFromCell(pmCell *cell       // Cell for which to find HDU
-                    )
-{
-    pmHDU *hdu = cell->hdu;             // The HDU information
-    if (!hdu) {
-        hdu = pmHDUFromChip(cell->parent); // Grab HDU info from the chip
-    }
-
-    return hdu;
-}
-
 static psBool cellCheckParents(pmCell *cell)
 {
Index: /branches/rel10_ifa/psModules/src/astrom/pmFPA.h
===================================================================
--- /branches/rel10_ifa/psModules/src/astrom/pmFPA.h	(revision 6672)
+++ /branches/rel10_ifa/psModules/src/astrom/pmFPA.h	(revision 6673)
@@ -7,6 +7,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.1.4.3 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-03-09 03:08:08 $
+*  @version $Revision: 1.1.4.4 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-03-23 03:09:57 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -194,11 +194,4 @@
 );
 
-// Find the HDU in the FPA hierarchy
-pmHDU *pmHDUFromFPA(pmFPA *fpa          // FPA for which to find HDU
-                   );
-pmHDU *pmHDUFromChip(pmChip *chip       // Chip for which to find HDU
-                    );
-pmHDU *pmHDUFromCell(pmCell *cell       // Cell for which to find HDU
-                    );
 
 /** Verify parent links.
Index: /branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c
===================================================================
--- /branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c	(revision 6672)
+++ /branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c	(revision 6673)
@@ -9,4 +9,5 @@
 #include "pmFPAConstruct.h"
 #include "pmFPAview.h"
+#include "pmFPAUtils.h"
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -32,40 +33,4 @@
 
     return cellData;
-}
-
-// Find a chip by name; return the index
-static int findChip(pmFPA *fpa, // FPA in which to find the chip
-                    const char *name // Name of the chip
-                   )
-{
-    psArray *chips = fpa->chips;    // Array of chips
-    for (int i = 0; i < chips->n; i++) {
-        pmChip *chip = chips->data[i]; // The chip of interest
-        psString testName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); // Name of this chip
-        if (strcmp(name, testName) == 0) {
-            return i;
-        }
-    }
-
-    psError(PS_ERR_IO, true, "Unable to find chip %s\n", name);
-    return -1;
-}
-
-// Find a cell by name; return the index
-static int findCell(pmChip *chip, // Chip in which to find the cell
-                    const char *name // Name of the cell
-                   )
-{
-    psArray *cells = chip->cells;    // Array of cells
-    for (int i = 0; i < cells->n; i++) {
-        pmCell *cell = cells->data[i]; // The cell of interest
-        psString testName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // Name of this cell
-        if (strcmp(name, testName) == 0) {
-            return i;
-        }
-    }
-
-    psError(PS_ERR_IO, true, "Unable to find cell %s\n", name);
-    return -1;
 }
 
@@ -232,5 +197,5 @@
         // Get the chip
         phuChipName = phuNameFromHeader("CHIP.NAME", formatSpec, phu); // Name of the chip
-        int chipNum = findChip(fpa, phuChipName); // Chip number
+        int chipNum = pmFPAFindChip(fpa, phuChipName); // Chip number
         if (chipNum == -1) {
             psError(PS_ERR_IO, true, "Unable to find chip %s in FPA.\n", phuChipName);
@@ -257,5 +222,5 @@
             // Added this for possible future plans which might allow PHU=CELL
             phuCellName = phuNameFromHeader("CELL.NAME", formatSpec, phu); // Name of the cell
-            int cellNum = findCell(chip, phuCellName); // Cell number
+            int cellNum = pmChipFindCell(chip, phuCellName); // Cell number
             if (cellNum == -1) {
                 psError(PS_ERR_IO, true, "Unable to find cell %s in chip %s.\n", phuCellName, phuChipName);
@@ -330,5 +295,5 @@
                          "(%s) --- there may be problems when reading!\n", chipName, phuChipName);
                 // Find the other chip
-                int chipNum = findChip(fpa, chipName); // The chip we're looking for
+                int chipNum = pmFPAFindChip(fpa, chipName); // The chip we're looking for
                 if (chipNum == -1) {
                     psLogMsg(__func__, PS_LOG_WARN, "Unable to find chip %s in fpa --- ignored.\n", chipName);
@@ -338,5 +303,5 @@
             }
             psString cellName = values->data[i]; // The name of the cell specified
-            int cellNum = findCell(chip, cellName); // The cell we're looking for
+            int cellNum = pmChipFindCell(chip, cellName); // The cell we're looking for
             if (cellNum == -1) {
                 psLogMsg(__func__, PS_LOG_WARN, "Unable to find cell %s in chip %s --- ignored.\n",
@@ -388,5 +353,5 @@
                 psString chipName = names->data[i]; // The name of the chip
                 psString cellName = values->data[i]; // The name of the cell
-                int chipNum = findChip(fpa, chipName); // The chip we're looking for
+                int chipNum = pmFPAFindChip(fpa, chipName); // The chip we're looking for
                 if (chipNum == -1) {
                     psLogMsg(__func__, PS_LOG_WARN, "Unable to find chip %s in FPA --- ignored.\n", chipName);
@@ -394,5 +359,5 @@
                 }
                 chip = fpa->chips->data[chipNum];
-                int cellNum = findCell(chip, cellName); // The cell we're looking for
+                int cellNum = pmChipFindCell(chip, cellName); // The cell we're looking for
                 if (cellNum == -1) {
                     psLogMsg(__func__, PS_LOG_WARN, "Unable to find cell %s in chip %s --- ignored\n",
@@ -429,5 +394,5 @@
                 // Need to look up the name of the chip
                 chipName = phuNameFromHeader("CHIP.NAME", formatSpec, phu);
-                int chipNum = findChip(fpa, chipName);
+                int chipNum = pmFPAFindChip(fpa, chipName);
                 if (chipNum == -1) {
                     psLogMsg(__func__, PS_LOG_WARN, "Unable to find chip %s in FPA --- ignored.\n", chipName);
@@ -444,5 +409,5 @@
                     chipName = names->data[i];
                     cellName = cellType;
-                    int chipNum = findChip(fpa, chipName); // The chip we're looking for
+                    int chipNum = pmFPAFindChip(fpa, chipName); // The chip we're looking for
                     if (chipNum == -1) {
                         psLogMsg(__func__, PS_LOG_WARN, "Unable to find chip %s in FPA --- ignored.\n",
@@ -455,5 +420,5 @@
                     cellName = names->data[i];
                 }
-                int cellNum = findCell(chip, cellName); // The cell we're looking for
+                int cellNum = pmChipFindCell(chip, cellName); // The cell we're looking for
                 if (cellNum == -1) {
                     psLogMsg(__func__, PS_LOG_WARN, "Unable to find cell %s in chip %s --- ignored.\n",
Index: /branches/rel10_ifa/psModules/src/astrom/pmFPAUtils.c
===================================================================
--- /branches/rel10_ifa/psModules/src/astrom/pmFPAUtils.c	(revision 6673)
+++ /branches/rel10_ifa/psModules/src/astrom/pmFPAUtils.c	(revision 6673)
@@ -0,0 +1,41 @@
+#include <stdio.h>
+#include "pslib.h"
+#include "pmFPA.h"
+#include "pmFPAUtils.h"
+
+// Find a chip by name; return the index
+int pmFPAFindChip(const pmFPA *fpa, // FPA in which to find the chip
+                  const char *name // Name of the chip
+                 )
+{
+    psArray *chips = fpa->chips;    // Array of chips
+    for (int i = 0; i < chips->n; i++) {
+        pmChip *chip = chips->data[i]; // The chip of interest
+        psString testName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); // Name of this chip
+        if (strcmp(name, testName) == 0) {
+            return i;
+        }
+    }
+
+    psError(PS_ERR_IO, true, "Unable to find chip %s\n", name);
+    return -1;
+}
+
+// Find a cell by name; return the index
+int pmChipFindCell(const pmChip *chip, // Chip in which to find the cell
+                   const char *name // Name of the cell
+                  )
+{
+    psArray *cells = chip->cells;    // Array of cells
+    for (int i = 0; i < cells->n; i++) {
+        pmCell *cell = cells->data[i]; // The cell of interest
+        psString testName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // Name of this cell
+        if (strcmp(name, testName) == 0) {
+            return i;
+        }
+    }
+
+    psError(PS_ERR_IO, true, "Unable to find cell %s\n", name);
+    return -1;
+}
+
Index: /branches/rel10_ifa/psModules/src/astrom/pmFPAUtils.h
===================================================================
--- /branches/rel10_ifa/psModules/src/astrom/pmFPAUtils.h	(revision 6673)
+++ /branches/rel10_ifa/psModules/src/astrom/pmFPAUtils.h	(revision 6673)
@@ -0,0 +1,17 @@
+#ifndef PM_FPA_UTILS_H
+#define PM_FPA_UTILS_H
+
+#include "pmFPA.h"
+
+// Find a chip by name; return the index
+int pmFPAFindChip(const pmFPA *fpa, // FPA in which to find the chip
+                  const char *name // Name of the chip
+                 );
+
+// Find a cell by name; return the index
+int pmChipFindCell(const pmChip *chip, // Chip in which to find the cell
+                   const char *name // Name of the cell
+                  );
+
+
+#endif
