Index: trunk/ppStack/src/ppStackLoop.c
===================================================================
--- trunk/ppStack/src/ppStackLoop.c	(revision 18419)
+++ trunk/ppStack/src/ppStackLoop.c	(revision 18435)
@@ -13,4 +13,6 @@
 
 //#define TESTING
+
+#define WCS_TOLERANCE 0.001             // Tolerance for WCS
 
 // Here follows lists of files for activation/deactivation at various stages.  Each must be NULL-terminated.
@@ -702,8 +704,37 @@
 
         // Close up
+        bool wcsDone = false;           // Have we done the WCS?
         for (int i = 0; i < num; i++) {
             if (!readouts->data[i]) {
                 continue;
             }
+            if (!wcsDone) {
+                // Copy astrometry over
+                wcsDone = true;
+                pmReadout *inRO = readouts->data[i]; // Template readout
+                pmHDU *inHDU = pmHDUFromCell(inRO->parent); // Template HDU
+                pmHDU *outHDU = pmHDUFromCell(outRO->parent); // Output HDU
+                pmChip *outChip = outRO->parent->parent; // Output chip
+                pmFPA *outFPA = outChip->parent; // Output FPA
+                if (!outHDU || !inHDU) {
+                    psWarning("Unable to find HDU at FPA level to copy astrometry.");
+                } else {
+                    if (!pmAstromReadWCS(outFPA, outChip, inHDU->header, 1.0)) {
+                        psErrorClear();
+                        psWarning("Unable to read WCS astrometry from input FPA.");
+                        wcsDone = false;
+                    } else {
+                        if (!outHDU->header) {
+                            outHDU->header = psMetadataAlloc();
+                        }
+                        if (!pmAstromWriteWCS(outHDU->header, outFPA, outChip, WCS_TOLERANCE)) {
+                            psErrorClear();
+                            psWarning("Unable to write WCS astrometry to output FPA.");
+                            wcsDone = false;
+                        }
+                    }
+                }
+            }
+
             psFitsClose(imageFits->data[i]);
             psFitsClose(maskFits->data[i]);
Index: trunk/ppStack/src/ppStackReadout.c
===================================================================
--- trunk/ppStack/src/ppStackReadout.c	(revision 18419)
+++ trunk/ppStack/src/ppStackReadout.c	(revision 18435)
@@ -9,6 +9,4 @@
 
 #include "ppStack.h"
-
-#define WCS_TOLERANCE 0.001             // Tolerance for WCS
 
 //#define REJECTION_FILES                 // Write rejection mask?
@@ -185,28 +183,4 @@
         }
         totExposure += exposure;        // Total exposure time
-
-#if 0
-        if (i == 0) {
-            // Copy astrometry over
-            pmHDU *hdu = fpa->hdu; // Template HDU
-            pmHDU *outHDU = outFPA->hdu; // Output HDU
-            if (!outHDU || !hdu) {
-                psWarning("Unable to find HDU at FPA level to copy astrometry.");
-            } else {
-                if (!pmAstromReadWCS(outFPA, outChip, hdu->header, 1.0)) {
-                    psErrorClear();
-                    psWarning("Unable to read WCS astrometry from input FPA.");
-                } else {
-                    if (!outHDU->header) {
-                        outHDU->header = psMetadataAlloc();
-                    }
-                    if (!pmAstromWriteWCS(outHDU->header, outFPA, outChip, WCS_TOLERANCE)) {
-                        psErrorClear();
-                        psWarning("Unable to write WCS astrometry to output FPA.");
-                    }
-                }
-            }
-        }
-#endif
 
         // Ensure there is a mask, or pmStackCombine will complain
