Index: /branches/eam_branches/20091201/psModules/src/detrend/pmPatternIO.c
===================================================================
--- /branches/eam_branches/20091201/psModules/src/detrend/pmPatternIO.c	(revision 26842)
+++ /branches/eam_branches/20091201/psModules/src/detrend/pmPatternIO.c	(revision 26843)
@@ -14,29 +14,4 @@
 #include "pmPatternIO.h"
 
-#define ARRAY_BUFFER 16                 // Number to add to array at a time
-
-// Names of FITS table columns
-#define NAME_XMIN "XMIN"                // Region of applicability: minimum x value
-#define NAME_XMAX "XMAX"                // Region of applicability: maximum x value
-#define NAME_YMIN "YMIN"                // Region of applicability: minimum y value
-#define NAME_YMAX "YMAX"                // Region of applicability: maximum y value
-#define NAME_KERNEL "KERNEL"            // Kernel description
-#define NAME_TYPE "TYPE"                // Kernel type
-#define NAME_SIZE "SIZE"                // Kernel half-size
-#define NAME_INNER "INNER"              // Size of inner region (only applicable for some kernel types)
-#define NAME_SPATIAL "SPATIAL_ORDER"    // Order of spatial polynomial
-#define NAME_BG "BG_ORDER"              // Order of background polynomial
-#define NAME_MODE "MODE"                // Matching mode
-#define NAME_COLS "COLUMNS"             // Number of columns
-#define NAME_ROWS "ROWS"                // Number of rows
-#define NAME_SOL1 "SOLUTION_1"          // Solution for convolving image 1
-#define NAME_SOL2 "SOLUTION_2"          // Solution for convolving image 2
-#define NAME_MEAN "MEAN"                // Mean of chi^2 from stamps
-#define NAME_RMS  "RMS"                 // RMS of chi^2 from stamps
-#define NAME_NUMSTAMPS "NUMSTAMPS"      // Number of good stamps
-
-#define EXTNAME_KERNEL "SUBTRACTION_KERNEL"    // Extension name for kernel
-#define EXTNAME_IMAGE  "SUBTRACTION_KERNEL_IMAGE"    // Extension name for image
-
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -193,7 +168,10 @@
     }
 
+    bool data = false;                  // Did we find any data?
+
     psMetadataItem *cellCorr = psMetadataLookup(header, PM_PATTERN_CELL_CORRECTION); // Cell pattern correction
     if (cellCorr) {
         psMetadataAddItem(ro->analysis, cellCorr, PS_LIST_TAIL, PS_META_REPLACE);
+        data = true;
     }
 
@@ -204,4 +182,11 @@
                            "Pattern row correction", rowCorr);
         psFree(rowCorr);
+        data = true;
+    }
+
+    if (data) {
+        ro->data_exists = true;
+        ro->parent->data_exists = true;
+        ro->parent->parent->data_exists = true;
     }
 
