Index: trunk/psModules/src/imcombine/pmSubtractionIO.c
===================================================================
--- trunk/psModules/src/imcombine/pmSubtractionIO.c	(revision 19669)
+++ trunk/psModules/src/imcombine/pmSubtractionIO.c	(revision 19758)
@@ -36,39 +36,5 @@
 #define NAME_NUMSTAMPS "NUMSTAMPS"      // Number of good stamps
 
-#define FALLBACK_EXTNAME "SUBTRACTION_KERNEL" // Fallback extension name
-
-// Generate an extension name for the subtraction kernel
-// In the case that there is no chip/cell (the readout is orphaned), the fallback extension name is used
-static psString subtractionKernelExtname(const pmReadout *ro // Readout containing kernel
-                                         )
-{
-    psAssert(ro, "Required parameter");
-
-    psString extname = NULL;            // Name of FITS extension
-    pmCell *cell = ro->parent;     // Parent cell
-    if (cell && cell->parent) {
-        pmChip *chip = cell->parent;        // Parent chip
-        const char *chipName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); // Name of chip
-        const char *cellName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // Name of cell
-        psAssert(chipName && cellName, "Chip and cell names should be defined in concepts.");
-        int roNum = -1;                 // Index of readout
-        for (int i = 0; i < cell->readouts->n && roNum == -1; i++) {
-            if (cell->readouts->data[i] == ro) {
-                roNum = i;
-            }
-        }
-        if (roNum != -1) {
-            psStringAppend(&extname, "%s_%s_%d", chipName, cellName, roNum);
-        } else {
-            psWarning("Unable to find readout number");
-        }
-    }
-
-    if (!extname) {
-        extname = psStringCopy(FALLBACK_EXTNAME);
-    }
-
-    return extname;
-}
+#define EXTNAME "SUBTRACTION_KERNEL"    // Extension name
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -173,6 +139,6 @@
     // CVS tags, used to identify the version of this file (in case incompatibilities are introduced)
     psString cvsFile = psStringCopy("$RCSfile: pmSubtractionIO.c,v $");
-    psString cvsRev  = psStringCopy("$Revision: 1.5 $");
-    psString cvsDate = psStringCopy("$Date: 2008-09-12 19:01:46 $");
+    psString cvsRev  = psStringCopy("$Revision: 1.6 $");
+    psString cvsDate = psStringCopy("$Date: 2008-09-25 22:29:12 $");
     psStringSubstitute(&cvsFile, NULL, "RCSfile: ");
     psStringSubstitute(&cvsRev,  NULL, "Revision: ");
@@ -188,11 +154,8 @@
     psFree(version);
 
-    psString extname = subtractionKernelExtname(ro); // Extension name
-
-    if (!psFitsWriteTable(fits, header, rows, extname)) {
+    if (!psFitsWriteTable(fits, header, rows, EXTNAME)) {
         psError(PS_ERR_IO, false, "Unable to write subtraction kernel to FITS table.");
         psFree(header);
         psFree(rows);
-        psFree(extname);
         return false;
     }
@@ -200,5 +163,4 @@
     psFree(header);
     psFree(rows);
-    psFree(extname);
 
     return true;
@@ -282,20 +244,8 @@
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    psString extname = subtractionKernelExtname(ro); // Extension name
-    if (!psFitsMoveExtName(fits, extname)) {
-        if (strcmp(extname, FALLBACK_EXTNAME) != 0) {
-            psErrorClear();
-            if (!psFitsMoveExtName(fits, FALLBACK_EXTNAME)) {
-                psError(PS_ERR_IO, false, "Unable to move to subtraction kernel table.");
-                psFree(extname);
-                return false;
-            }
-        } else {
-            psError(PS_ERR_IO, false, "Unable to move to subtraction kernel table.");
-            psFree(extname);
-            return false;
-        }
-    }
-    psFree(extname);
+    if (!psFitsMoveExtName(fits, EXTNAME)) {
+        psError(PS_ERR_IO, false, "Unable to move to subtraction kernel table.");
+        return false;
+    }
 
     psArray *table = psFitsReadTable(fits); // Table of interest
