Index: trunk/ppImage/src/ppTest.c
===================================================================
--- trunk/ppImage/src/ppTest.c	(revision 6897)
+++ trunk/ppImage/src/ppTest.c	(revision 7216)
@@ -98,44 +98,48 @@
 
     // Read the FPA
+#if 1
+    pmFPARead(fpa, inFile, NULL);
+#else
     psArray *chips = fpa->chips;
-    pmFPAWrite(fpa, outFile, NULL, false);
+    //pmFPAWrite(fpa, outFile, NULL, false);
     for (int i = 0; i < chips->n; i++) {
         pmChip *chip = chips->data[i];
-        pmChipWrite(chip, outFile, NULL, false);
+        //pmChipWrite(chip, outFile, NULL, false);
         psArray *cells = chip->cells;
         for (int j = 0; j < cells->n; j++) {
             pmCell *cell = cells->data[j];
-            pmCellWrite(cell, outFile, NULL, false);
-#if 1
+            //pmCellWrite(cell, outFile, NULL, false);
+#if 0
             pmReadout *readout = pmReadoutAlloc(cell);
-            for (int z = 0; pmReadoutReadNext(readout, inFile, z, 100); z++) {
+            for (int z = 0; pmReadoutReadNext(readout, inFile, z, 512); z++) {
                 do {
                     printf("Chip %d, Cell %d, Plane %d, row0 = %d\n", i, j, z, readout->row0);
                     pmReadoutWriteNext(readout, outFile, z);
                     //pmFPAPrint(fpa, false, true);
-                } while (pmReadoutReadNext(readout, inFile, z, 2048));
+                } while (pmReadoutReadNext(readout, inFile, z, 512));
             }
             psFree(readout);
 #else
             pmCellRead(cell, inFile, NULL);
+            printf("Read chip %d, cell %d\n", i, j);
 #endif
-            psFree(cell);
         }
-        psFree(chip);
+        //pmChipMosaic(chip);
+        //psFree(chip);
     }
+#endif
 
-#if 0
-    pmFPARead(fpa, inFile, NULL);
+
+#if 1
     // Copy to new camera format
     pmFPA *newFPA = pmFPAConstruct(config->camera);
-    psMetadata *newFormat = psMetadataConfigParse(NULL, NULL, "mcshort_splice.config", true);
-    pmConfigConformHeader(phu, newFormat);
+    psMetadata *newFormat = psMetadataConfigParse(NULL, NULL, "/home/mithrandir/price/ipp/config/mcshort/format_spliced.config", true);
     pmFPAAddSourceFromView(newFPA, view, newFormat);
-    pmFPAPrint(newFPA, true, true);
-    pmFPACopyStructure(newFPA, fpa, 5, 5);
-    pmFPAWrite(newFPA, outFile, NULL);
-    exit(EXIT_SUCCESS);
-
-    pmFPAPrint(newFPA, true, true);
+    //pmFPACopyStructure(newFPA, fpa, 5, 5);
+    pmFPACopy(newFPA, fpa);
+    //pmConfigConformHeader(phu, newFormat);
+    //pmHDUGenerateForFPA(newFPA);
+    //pmFPAPrint(newFPA, true, true);
+    pmFPAWrite(newFPA, outFile, NULL, true);
     psFree(newFormat);
     psFree(newFPA);
@@ -152,4 +156,5 @@
     psTimerStop();
     psTraceReset();
+    psErrorClear();
     pmConceptsDone();
     pmConfigDone();
