Index: trunk/psphot/src/psphotImageLoop.c
===================================================================
--- trunk/psphot/src/psphotImageLoop.c	(revision 28420)
+++ trunk/psphot/src/psphotImageLoop.c	(revision 28421)
@@ -46,4 +46,21 @@
         if (!psphotMosaicChip(config, view, "PSPHOT.INPUT", "PSPHOT.LOAD")) ESCAPE ("Unable to mosaic chip.");
 
+        // Read WCS if easy.
+        // XXX Since we're mosaicking cells, we ignore the case where the WCS is defined for a cell.
+        {
+            pmChip *inChip = pmFPAviewThisChip(view, input->fpa); // Mosaicked chip
+            pmHDU *hduLow = pmHDUGetLowest(input->fpa, inChip, NULL);
+            if (hduLow && !pmAstromReadWCS(input->fpa, inChip, hduLow->header, 1.0)) {
+                psWarning("Unable to read WCS astrometry from header.");
+                psErrorClear();
+                pmHDU *hduHigh = pmHDUGetHighest(input->fpa, inChip, NULL);
+                if (hduHigh && hduHigh != hduLow &&
+                    !pmAstromReadWCS(input->fpa, chip, hduHigh->header, 1.0)) {
+                    psWarning("Unable to read WCS astrometry from primary header.");
+                    psErrorClear();
+                }
+            }
+        }
+
         // try to load other supporting data (PSF, SRC, etc).
         // do not re-load the following three files
@@ -67,19 +84,21 @@
 
                 // Update the header
-		pmHDU *hdu = pmHDUGetHighest(input->fpa, chip, cell);
-		if (hdu && hdu != lastHDU) {
-		    psphotVersionHeaderFull(hdu->header);
-		    lastHDU = hdu;
+                {
+                    pmHDU *hdu = pmHDUGetHighest(input->fpa, chip, cell);
+                    if (hdu && hdu != lastHDU) {
+                        psphotVersionHeaderFull(hdu->header);
+                        lastHDU = hdu;
+                    }
                 }
 
-		// if an external mask is supplied, ensure that NAN pixels are also masked
-		if (readout->mask) {
-		    psImageMaskType maskSat = pmConfigMaskGet("SAT", config); // Mask value for saturated pixels
-		    if (!pmReadoutMaskNonfinite(readout, maskSat)) {
-			psError(psErrorCodeLast(), false, "Unable to mask non-finite pixels.");
-			psFree(view);
-			return false;
-		    }
-		}
+                // if an external mask is supplied, ensure that NAN pixels are also masked
+                if (readout->mask) {
+                    psImageMaskType maskSat = pmConfigMaskGet("SAT", config); // Mask value for saturated pixels
+                    if (!pmReadoutMaskNonfinite(readout, maskSat)) {
+                        psError(psErrorCodeLast(), false, "Unable to mask non-finite pixels.");
+                        psFree(view);
+                        return false;
+                    }
+                }
 
                 // run the actual photometry analysis on this chip/cell/readout
@@ -91,14 +110,14 @@
             }
 
-	    // drop all versions of the internal files
-	    status = true;
-	    status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");
-	    status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV");
-	    status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");
-	    if (!status) {
-		psError(PSPHOT_ERR_PROG, false, "trouble dropping internal files");
-		psFree (view);
-		return false;
-	    }
+            // drop all versions of the internal files
+            status = true;
+            status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");
+            status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV");
+            status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");
+            if (!status) {
+                psError(PSPHOT_ERR_PROG, false, "trouble dropping internal files");
+                psFree (view);
+                return false;
+            }
         }
         // save output which is saved at the chip level
