Index: trunk/pswarp/src/pswarpDataLoad.c
===================================================================
--- trunk/pswarp/src/pswarpDataLoad.c	(revision 12526)
+++ trunk/pswarp/src/pswarpDataLoad.c	(revision 12771)
@@ -17,6 +17,6 @@
     pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSWARP.INPUT");
     if (!input) {
-	psError(PSWARP_ERR_CONFIG, true, "Can't find input data!\n");
-	return false;
+        psError(PSWARP_ERR_CONFIG, true, "Can't find input data!\n");
+        return false;
     }
 
@@ -24,7 +24,7 @@
     pmFPAfile *astrom = psMetadataLookupPtr (NULL, config->files, "PSWARP.ASTROM");
     if (!astrom) {
-	astrom = input;
+        astrom = input;
     }
- 
+
     // select the output readout
     view = pmFPAviewAlloc (0);
@@ -34,6 +34,6 @@
     pmReadout  *output = pmFPAfileThisReadout (config->files, view, "PSWARP.OUTPUT");
     if (!output) {
-	psError(PSWARP_ERR_CONFIG, true, "Can't find output data!\n");
-	return false;
+        psError(PSWARP_ERR_CONFIG, true, "Can't find output data!\n");
+        return false;
     }
     psFree (view);
@@ -42,4 +42,6 @@
     pmFPAfileActivate (config->files, false, "PSWARP.SKYCELL");
     pmFPAfileActivate (config->files, false, "PSWARP.OUTPUT");
+    pmFPAfileActivate (config->files, false, "PSWARP.OUTPUT.MASK");
+    pmFPAfileActivate (config->files, false, "PSWARP.OUTPUT.WEIGHT");
 
     view = pmFPAviewAlloc (0);
@@ -52,12 +54,12 @@
     pmHDU *phu = pmFPAviewThisPHU (view, astrom->fpa);
     if (phu) {
-	char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1");
-	if (ctype) {
-	    bilevelAstrometry = !strcmp (&ctype[4], "-DIS");
-	}
+        char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1");
+        if (ctype) {
+            bilevelAstrometry = !strcmp (&ctype[4], "-DIS");
+        }
     }
     if (bilevelAstrometry) {
-	pmAstromReadBilevelMosaic (input->fpa, phu->header);
-    } 
+        pmAstromReadBilevelMosaic (input->fpa, phu->header);
+    }
 
     // files associated with the science image
@@ -67,34 +69,34 @@
         psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
         if (!chip->process || !chip->file_exists) { continue; }
-	pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
+        pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
 
         // read WCS data from the corresponding header
-	pmHDU *hdu = pmFPAviewThisHDU (view, astrom->fpa);
-	if (bilevelAstrometry) {
-	    pmAstromReadBilevelChip (chip, hdu->header); 
-	} else {
-	    // we use a default FPA pixel scale of 1.0
-	    pmAstromReadWCS (input->fpa, chip, hdu->header, 1.0);
-	}
+        pmHDU *hdu = pmFPAviewThisHDU (view, astrom->fpa);
+        if (bilevelAstrometry) {
+            pmAstromReadBilevelChip (chip, hdu->header);
+        } else {
+            // we use a default FPA pixel scale of 1.0
+            pmAstromReadWCS (input->fpa, chip, hdu->header, 1.0);
+        }
 
-	while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
+        while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
             psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
             if (!cell->process || !cell->file_exists) { continue; }
-	    pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
+            pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
 
-	    // process each of the readouts
-	    while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
-		pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
-		if (! readout->data_exists) { continue; }
+            // process each of the readouts
+            while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
+                pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
+                if (! readout->data_exists) { continue; }
 
-		// XXX _Opt version uses locally-linear map
-		// pswarpTransformReadout (output, readout, config);
-		pswarpTransformReadout_Opt (output, readout, config);
+                // XXX _Opt version uses locally-linear map
+                // pswarpTransformReadout (output, readout, config);
+                pswarpTransformReadout_Opt (output, readout, config);
 
-		pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
-	    }
-	    pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
-	}
-	pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
+                pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
+            }
+            pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
+        }
+        pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     }
     pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
