Index: /branches/pap_branch_20090128/ppMerge/src/ppMergeArguments.c
===================================================================
--- /branches/pap_branch_20090128/ppMerge/src/ppMergeArguments.c	(revision 21218)
+++ /branches/pap_branch_20090128/ppMerge/src/ppMergeArguments.c	(revision 21219)
@@ -11,6 +11,6 @@
             "\tIMAGE(STR):     Image filename\n"
             "\tMASK(STR):      Mask filename\n"
-            "\tWEIGHT(STR)     Weight map filename\n"
-            "where MASK and WEIGHT are optional.",
+            "\tVARIANCE(STR)   Variance map filename\n"
+            "where MASK and VARIANCE are optional.",
             program);
     fprintf(stderr, "\n");
@@ -127,5 +127,5 @@
     psMetadataAddF32(arguments, PS_LIST_TAIL, "-frachigh", 0, "Fraction of low pixels to discard", NAN);
     psMetadataAddS32(arguments, PS_LIST_TAIL, "-nkeep",    0, "Minimum number of pixels in stack to keep", 0);
-    psMetadataAddBool(arguments, PS_LIST_TAIL, "-weights", 0, "Use image weights in combination?", false);
+    psMetadataAddBool(arguments, PS_LIST_TAIL, "-variances", 0, "Use image variances in combination?", false);
 
     // XXX EAM : not clear this should be allowed on the command line.
@@ -272,5 +272,5 @@
     VALUE_ARG_RECIPE_FLOAT("-frachigh", "FRACHIGH", F32);
     VALUE_ARG_RECIPE_INT("-nkeep",      "NKEEP",    S32, 0);
-    VALUE_ARG_RECIPE_BOOL("-weights",   "WEIGHTS");
+    VALUE_ARG_RECIPE_BOOL("-variances", "VARIANCES");
 
     // XXX we do not supply this on the command line
Index: /branches/pap_branch_20090128/ppMerge/src/ppMergeCamera.c
===================================================================
--- /branches/pap_branch_20090128/ppMerge/src/ppMergeCamera.c	(revision 21218)
+++ /branches/pap_branch_20090128/ppMerge/src/ppMergeCamera.c	(revision 21219)
@@ -82,5 +82,5 @@
 {
     bool haveMasks = false;             // Do we have masks?
-    bool haveWeights = false;           // Do we have weight maps?
+    bool haveVariances = false;           // Do we have variance maps?
 
     ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); // Type of frame
@@ -108,5 +108,5 @@
         bool mdok;
         psString mask = psMetadataLookupStr(&mdok, input, "MASK"); // Name of mask
-        psString weight = psMetadataLookupStr(&mdok, input, "WEIGHT"); // Name of weight map
+        psString variance = psMetadataLookupStr(&mdok, input, "VARIANCE"); // Name of variance map
 
         // Add the image file
@@ -150,25 +150,26 @@
         }
 
-        // Optionally add the weight file
-        if (weight && strlen(weight) > 0) {
-            haveWeights = true;
-            psArray *weightFiles = psArrayAlloc(1); // Array of filenames for this FPA
-            weightFiles->data[0] = psMemIncrRefCounter(weight);
-            psMetadataAddArray(config->arguments, PS_LIST_TAIL, "WEIGHT.FILENAMES", PS_META_REPLACE,
-                               "Filenames of weight files", weightFiles);
-            psFree(weightFiles);
+        // Optionally add the variance file
+        if (variance && strlen(variance) > 0) {
+            haveVariances = true;
+            psArray *varianceFiles = psArrayAlloc(1); // Array of filenames for this FPA
+            varianceFiles->data[0] = psMemIncrRefCounter(variance);
+            psMetadataAddArray(config->arguments, PS_LIST_TAIL, "VARIANCE.FILENAMES", PS_META_REPLACE,
+                               "Filenames of variance files", varianceFiles);
+            psFree(varianceFiles);
 
             bool status;
-            pmFPAfile *weightFile = pmFPAfileBindFromArgs(&status, imageFile, config, "PPMERGE.INPUT.WEIGHT",
-                                                          "WEIGHT.FILENAMES");
+            pmFPAfile *varianceFile = pmFPAfileBindFromArgs(&status, imageFile, config,
+                                                            "PPMERGE.INPUT.VARIANCE", "VARIANCE.FILENAMES");
             if (!status) {
-                psError(PS_ERR_UNKNOWN, false, "Unable to define file from weight %d (%s)", numFiles, weight);
-                return false;
-            }
-            if (weightFile->type != PM_FPA_FILE_WEIGHT) {
-                psError(PS_ERR_IO, true, "PPMERGE.INPUT.WEIGHT is not of type WEIGHT");
-                return false;
-            }
-            haveWeights = true;
+                psError(PS_ERR_UNKNOWN, false, "Unable to define file from variance %d (%s)",
+                        numFiles, variance);
+                return false;
+            }
+            if (varianceFile->type != PM_FPA_FILE_VARIANCE) {
+                psError(PS_ERR_IO, true, "PPMERGE.INPUT.VARIANCE is not of type VARIANCE");
+                return false;
+            }
+            haveVariances = true;
         }
 
@@ -180,6 +181,6 @@
         psMetadataRemoveKey(config->arguments, "MASK.FILENAMES");
     }
-    if (psMetadataLookup(config->arguments, "WEIGHT.FILENAMES")) {
-        psMetadataRemoveKey(config->arguments, "WEIGHT.FILENAMES");
+    if (psMetadataLookup(config->arguments, "VARIANCE.FILENAMES")) {
+        psMetadataRemoveKey(config->arguments, "VARIANCE.FILENAMES");
     }
     if (psMetadataLookup(config->arguments, "PSF.FILENAMES")) {
@@ -189,6 +190,6 @@
     psMetadataAddS32(config->arguments, PS_LIST_TAIL, "INPUTS.NUM", 0, "Number of input files", numFiles);
     psMetadataAddBool(config->arguments, PS_LIST_TAIL, "INPUTS.MASKS", 0, "Got input masks?", haveMasks);
-    psMetadataAddBool(config->arguments, PS_LIST_TAIL, "INPUTS.WEIGHTS", 0,
-                      "Got input weights?", haveWeights);
+    psMetadataAddBool(config->arguments, PS_LIST_TAIL, "INPUTS.VARIANCES", 0,
+                      "Got input variances?", haveVariances);
 
 
Index: /branches/pap_branch_20090128/ppMerge/src/ppMergeFiles.c
===================================================================
--- /branches/pap_branch_20090128/ppMerge/src/ppMergeFiles.c	(revision 21218)
+++ /branches/pap_branch_20090128/ppMerge/src/ppMergeFiles.c	(revision 21219)
@@ -1,8 +1,8 @@
 #include "ppMerge.h"
 
-const char *allFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.WEIGHT",
+const char *allFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.VARIANCE",
                            "PPMERGE.OUTPUT", "PPMERGE.OUTPUT.COUNT", "PPMERGE.OUTPUT.SIGMA",
                            NULL };      // All files
-const char *inputFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.WEIGHT",
+const char *inputFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.VARIANCE",
                              NULL };    // Input files
 const char *outputFiles[] = { "PPMERGE.OUTPUT", "PPMERGE.OUTPUT.COUNT", "PPMERGE.OUTPUT.SIGMA",
@@ -37,8 +37,8 @@
         }
     }
-    if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS")) {
-        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.WEIGHT", num);
-        if (!pmReadoutReadChunkWeight(readout, file->fits, 0, rows, 0, config)) {
-            psError(PS_ERR_UNKNOWN, false, "Unable to read readout weight.");
+    if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES")) {
+        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.VARIANCE", num);
+        if (!pmReadoutReadChunkVariance(readout, file->fits, 0, rows, 0, config)) {
+            psError(PS_ERR_UNKNOWN, false, "Unable to read readout variance.");
             return false;
         }
@@ -77,9 +77,10 @@
         psFree(fileView);
     }
-    if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS")) {
-        pmFPAfile *weight = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.WEIGHT", num); // Weight file
-        pmFPAview *fileView = pmFPAviewForLevel(weight->fileLevel, view);
-        if (!pmFPAfileOpen(weight, fileView, config)) {
-            psError(PS_ERR_UNKNOWN, false, "Unable to open weight file %d", num);
+    if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES")) {
+        pmFPAfile *variance = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.VARIANCE",
+                                                    num); // Variance file
+        pmFPAview *fileView = pmFPAviewForLevel(variance->fileLevel, view);
+        if (!pmFPAfileOpen(variance, fileView, config)) {
+            psError(PS_ERR_UNKNOWN, false, "Unable to open variance file %d", num);
             psFree(fileView);
             return false;
@@ -113,5 +114,5 @@
     bool mdok;                          // Status of MD lookup
     bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks?
-    bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); // Got weights?
+    bool haveVariances = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES"); // Got variances?
 
     const char **fileList = selectFiles(files); // Files to activate
@@ -120,5 +121,5 @@
             continue;
         }
-        if (!haveWeights && strcmp(fileList[i], "PPMERGE.INPUT.WEIGHT") == 0) {
+        if (!haveVariances && strcmp(fileList[i], "PPMERGE.INPUT.VARIANCE") == 0) {
             continue;
         }
@@ -149,5 +150,5 @@
     bool mdok;                          // Status of MD lookup
     bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks?
-    bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); // Got weights?
+    bool haveVariances = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES"); // Got variances?
 
     psList *list = psListAlloc(NULL);   // List of files
@@ -157,5 +158,5 @@
             continue;
         }
-        if (!haveWeights && strcmp(fileList[i], "PPMERGE.INPUT.WEIGHT") == 0) {
+        if (!haveVariances && strcmp(fileList[i], "PPMERGE.INPUT.VARIANCE") == 0) {
             continue;
         }
Index: /branches/pap_branch_20090128/ppMerge/src/ppMergeLoop_Threaded.c
===================================================================
--- /branches/pap_branch_20090128/ppMerge/src/ppMergeLoop_Threaded.c	(revision 21218)
+++ /branches/pap_branch_20090128/ppMerge/src/ppMergeLoop_Threaded.c	(revision 21219)
@@ -24,13 +24,13 @@
     bool mdok;                          // Status of MD lookup
     bool haveMasks = psMetadataLookupBool(&mdok, arguments, "INPUTS.MASKS"); // Do we have masks?
-    bool haveWeights = psMetadataLookupBool(&mdok, arguments, "INPUTS.WEIGHTS"); // Do we have weights?
+    bool haveVariances = psMetadataLookupBool(&mdok, arguments, "INPUTS.VARIANCES"); // Do we have variances?
 
     psArray *inputs = ppMergeFileDataLevel(config, "PPMERGE.INPUT", PM_FPA_LEVEL_READOUT); // Input images
-    psArray *masks = NULL, *weights = NULL; // Input masks and weights
+    psArray *masks = NULL, *variances = NULL; // Input masks and variances
     if (haveMasks) {
         masks = ppMergeFileDataLevel(config, "PPMERGE.INPUT.MASK", PM_FPA_LEVEL_READOUT);
     }
-    if (haveWeights) {
-        weights = ppMergeFileDataLevel(config, "PPMERGE.INPUT.WEIGHT", PM_FPA_LEVEL_READOUT);
+    if (haveVariances) {
+        variances = ppMergeFileDataLevel(config, "PPMERGE.INPUT.VARIANCE", PM_FPA_LEVEL_READOUT);
     }
 
@@ -45,5 +45,5 @@
     int nKeep = psMetadataLookupS32(NULL, arguments, "NKEEP"); // Minimum number of values to keep
     psStatsOptions combineStat = psMetadataLookupS32(NULL, arguments, "COMBINE"); // Combination statistic
-    bool useWeights = psMetadataLookupBool(NULL, arguments, "WEIGHTS"); // Use weights?
+    bool useVariances = psMetadataLookupBool(NULL, arguments, "VARIANCES"); // Use variances?
 
     // Fringe parameters
@@ -54,6 +54,5 @@
 
     // set the mask and mark bit values based on the named masks
-    psMaskType maskVal;
-    psMaskType markVal;
+    psImageMaskType maskVal, markVal;
     if (!pmConfigMaskSetBits (&maskVal, &markVal, config)) {
         psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values");
@@ -69,5 +68,5 @@
     combination->iter = iter;
     combination->rej = rej;
-    combination->weights = useWeights;
+    combination->variances = useVariances;
 
     psMetadata *stats = NULL;           // Statistics for output
@@ -421,5 +420,5 @@
     psFree(inputs);
     psFree(masks);
-    psFree(weights);
+    psFree(variances);
     psFree(stats);
     return true;
@@ -430,5 +429,5 @@
     psFree(inputs);
     psFree(masks);
-    psFree(weights);
+    psFree(variances);
     psFree(stats);
     return false;
Index: /branches/pap_branch_20090128/ppMerge/src/ppMergeMask.c
===================================================================
--- /branches/pap_branch_20090128/ppMerge/src/ppMergeMask.c	(revision 21218)
+++ /branches/pap_branch_20090128/ppMerge/src/ppMergeMask.c	(revision 21219)
@@ -26,9 +26,8 @@
     float smoothScale = psMetadataLookupF32(&mdok, config->arguments, "MASK.SMOOTH.SCALE"); // Radius to grow mask
 
-    psMaskType markVal;
-    psMaskType maskValRaw;
-    if (!pmConfigMaskSetBits (&maskValRaw, &markVal, config)) {
-	psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values");
-	return false;
+    psImageMaskType markVal, maskValRaw;
+    if (!pmConfigMaskSetBits(&maskValRaw, &markVal, config)) {
+        psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values");
+        return false;
     }
 
@@ -36,8 +35,8 @@
     psMaskType maskValOut = pmConfigMaskGet (maskOutName, config);
     if (!maskValOut) {
-	psError (PS_ERR_UNKNOWN, true, "Undefined output mask bit value");
-	return false;
-    }
-    
+        psError (PS_ERR_UNKNOWN, true, "Undefined output mask bit value");
+        return false;
+    }
+
     psStats *statistics = psStatsAlloc(meanStat | stdevStat); // Statistics for background
 
@@ -45,14 +44,14 @@
     pmChip *outChip = pmFPAfileThisChip(config->files, view, outName); // Output chip
     psFree(outName);
-    
+
     int numCells = 1;
     if (chipStats) {
-	// count the number of active cells for this chip:
-	numCells = 0;
-	for (int i = 0; i < outChip->cells->n; i++) {
-	    pmCell *cell = outChip->cells->data[i];
-	    if (!cell->process) continue;
-	    numCells ++;
-	}
+        // count the number of active cells for this chip:
+        numCells = 0;
+        for (int i = 0; i < outChip->cells->n; i++) {
+            pmCell *cell = outChip->cells->data[i];
+            if (!cell->process) continue;
+            numCells ++;
+        }
     }
 
@@ -73,7 +72,7 @@
         while ((inCell = pmFPAviewNextCell(inView, inFPA, 1))) {
 
-	    // the output FPA structure carries the information about which cells to process
+            // the output FPA structure carries the information about which cells to process
             pmCell *outCell = pmFPAfileThisCell(config->files, inView, "PPMERGE.OUTPUT.MASK"); // Output cell
-	    if (!outCell->process) continue;
+            if (!outCell->process) continue;
 
             pmHDU *hdu = pmHDUFromCell(inCell); // HDU for cell
@@ -138,6 +137,6 @@
                 int y = pixel / numCols;
                 if (mask && (mask->data.PS_TYPE_MASK_DATA[y][x] & maskValRaw)) continue;
-		if (outMask && (outMask->data.PS_TYPE_MASK_DATA[y][x] & maskValOut)) continue;
-		if (!isfinite(image->data.F32[y][x])) continue;
+                if (outMask && (outMask->data.PS_TYPE_MASK_DATA[y][x] & maskValOut)) continue;
+                if (!isfinite(image->data.F32[y][x])) continue;
 
                 values->data.F32[valueIndex++] = image->data.F32[y][x];
@@ -153,9 +152,9 @@
                 }
 
-		float mean = psStatsGetValue(statistics, meanStat);
-		float stdev = psStatsGetValue(statistics, stdevStat);
-
-		// this function increments the count for each suspect pixel in each input plane
-		// maskValRaw is used to test for valid input pixels
+                float mean = psStatsGetValue(statistics, meanStat);
+                float stdev = psStatsGetValue(statistics, stdevStat);
+
+                // this function increments the count for each suspect pixel in each input plane
+                // maskValRaw is used to test for valid input pixels
                 if (!pmMaskFlagSuspectPixels(outRO, readout, mean, stdev, maskSuspect, maskValRaw)) {
                     psError(PS_ERR_UNKNOWN, false, "Unable to find suspect values in file %d", i);
@@ -186,7 +185,7 @@
             while ((inCell = pmFPAviewNextCell(inView, inFPA, 1))) {
 
-		// the output FPA structure carries the information about which cells to process
-		pmCell *outCell = pmFPAfileThisCell(config->files, inView, "PPMERGE.OUTPUT.MASK"); // Output cell
-		if (!outCell->process) continue;
+                // the output FPA structure carries the information about which cells to process
+                pmCell *outCell = pmFPAfileThisCell(config->files, inView, "PPMERGE.OUTPUT.MASK"); // Output cell
+                if (!outCell->process) continue;
 
                 pmHDU *hdu = pmHDUFromCell(inCell); // HDU for cell
@@ -198,8 +197,8 @@
                 pmReadout *outRO = pmFPAfileThisReadout(config->files, inView, "PPMERGE.OUTPUT.MASK");
 
-		float mean = psStatsGetValue(statistics, meanStat);
-		float stdev = psStatsGetValue(statistics, stdevStat);
-
-		if (!pmMaskFlagSuspectPixels(outRO, readout, mean, stdev, maskSuspect, maskValRaw)) {
+                float mean = psStatsGetValue(statistics, meanStat);
+                float stdev = psStatsGetValue(statistics, stdevStat);
+
+                if (!pmMaskFlagSuspectPixels(outRO, readout, mean, stdev, maskSuspect, maskValRaw)) {
                     psError(PS_ERR_UNKNOWN, false, "Unable to find suspect values in file %d", i);
                     goto MERGE_MASK_ERROR;
@@ -231,6 +230,6 @@
     while ((outCell = pmFPAviewNextCell(outView, outFPA, 1))) {
 
-	// skip inactive cells
-	if (!outCell->process) continue;
+        // skip inactive cells
+        if (!outCell->process) continue;
 
         pmHDU *hdu = pmHDUFromCell(outCell); // HDU for cell
@@ -242,12 +241,12 @@
         pmReadout *outRO = outCell->readouts->data[0]; // Output readout
 
-	if (smoothSuspect) {
-	    // XXX test output of suspect pixel image
-	    psImage *suspects = psMetadataLookupPtr(NULL, outRO->analysis, PM_MASK_ANALYSIS_SUSPECT); // Suspect img
-	    assert (suspects);
-	    psImageSmooth (suspects, smoothScale, 3); // extend smoothing region to 3-sigma
-	}
-
-	// set the bad pixels to the value 'maskVal'
+        if (smoothSuspect) {
+            // XXX test output of suspect pixel image
+            psImage *suspects = psMetadataLookupPtr(NULL, outRO->analysis, PM_MASK_ANALYSIS_SUSPECT); // Suspect img
+            assert (suspects);
+            psImageSmooth (suspects, smoothScale, 3); // extend smoothing region to 3-sigma
+        }
+
+        // set the bad pixels to the value 'maskVal'
         if (!pmMaskIdentifyBadPixels(outRO, maskValOut, maskBad, maskMode)) {
             psError(PS_ERR_UNKNOWN, false, "Unable to mask bad pixels");
@@ -343,5 +342,5 @@
     int numFiles = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); // Number of inputs
     bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks?
-    bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); // Do we have weights?
+    bool haveVariances = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES"); // Got variances?
     int iter = psMetadataLookupS32(NULL, config->arguments, "ITER"); // Number of rejection iterations
 
@@ -363,7 +362,7 @@
         psFree(masks);
     }
-    if (haveWeights) {
-        psArray *weights = ppMergeFileDataLevel(config, "PPMERGE.INPUT.WEIGHT", PM_FPA_LEVEL_READOUT);
-        psFree(weights);
+    if (haveVariances) {
+        psArray *variances = ppMergeFileDataLevel(config, "PPMERGE.INPUT.VARIANCE", PM_FPA_LEVEL_READOUT);
+        psFree(variances);
     }
 
@@ -405,21 +404,21 @@
         }
 
-	if (outChip->data_exists) {
-	    psList *inChips = psListAlloc(NULL);
-	    for (int i=0; i < numFiles; i++) {
-		pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // Input file
-		pmChip *chip = pmFPAviewThisChip(view, file->fpa);
-		psListAdd(inChips, PS_LIST_TAIL, chip);
-	    }
-
-	    // XXX I need to call pmConfigMaskWriteHeader for the PHU somewhere, after it is created!
-
-	    if (!pmConceptsAverageChips(outChip, inChips, true)) {
-		psError(PS_ERR_UNKNOWN, false, "Unable to average Chip concepts.");
-		psFree(inChips);
-		goto PPMERGE_MASK_ERROR;
-	    }
-	    psFree(inChips);
-	}
+        if (outChip->data_exists) {
+            psList *inChips = psListAlloc(NULL);
+            for (int i=0; i < numFiles; i++) {
+                pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // Input file
+                pmChip *chip = pmFPAviewThisChip(view, file->fpa);
+                psListAdd(inChips, PS_LIST_TAIL, chip);
+            }
+
+            // XXX I need to call pmConfigMaskWriteHeader for the PHU somewhere, after it is created!
+
+            if (!pmConceptsAverageChips(outChip, inChips, true)) {
+                psError(PS_ERR_UNKNOWN, false, "Unable to average Chip concepts.");
+                psFree(inChips);
+                goto PPMERGE_MASK_ERROR;
+            }
+            psFree(inChips);
+        }
         if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
             goto PPMERGE_MASK_ERROR;
Index: /branches/pap_branch_20090128/ppMerge/src/ppMergeReadChunk.c
===================================================================
--- /branches/pap_branch_20090128/ppMerge/src/ppMergeReadChunk.c	(revision 21218)
+++ /branches/pap_branch_20090128/ppMerge/src/ppMergeReadChunk.c	(revision 21219)
@@ -9,5 +9,6 @@
     bool mdok;
     bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks?
-    bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS");// Do we have weights?
+    bool haveVariances = psMetadataLookupBool(&mdok, config->arguments,
+                                              "INPUTS.VARIANCES");// Do we have variances?
     int rows = psMetadataLookupS32(NULL, config->arguments, "ROWS"); // Number of rows to read per chunk
 
@@ -40,5 +41,5 @@
                 // override the recorded last scan
                 inRO->thisImageScan  = fileGroup->firstScan;
-                inRO->thisWeightScan = fileGroup->firstScan;
+                inRO->thisVarianceScan = fileGroup->firstScan;
                 inRO->thisMaskScan   = fileGroup->firstScan;
                 inRO->forceScan      = true;
@@ -69,9 +70,10 @@
                 }
 
-                if (haveWeights && pmReadoutMoreWeight(inRO, file->fits, 0, rows, config)) {
+                if (haveVariances && pmReadoutMoreVariance(inRO, file->fits, 0, rows, config)) {
                     keepReading = true;
-                    pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.WEIGHT", i);
-                    if (!pmReadoutReadChunkWeight(inRO, file->fits, 0, rows, 0, config)) {
-                        psError(PS_ERR_IO, false, "Unable to read chunk %d for file PPMERGE.INPUT.WEIGHT %d",
+                    pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.VARIANCE", i);
+                    if (!pmReadoutReadChunkVariance(inRO, file->fits, 0, rows, 0, config)) {
+                        psError(PS_ERR_IO, false,
+                                "Unable to read chunk %d for file PPMERGE.INPUT.VARIANCE %d",
                                 numChunk, i);
                         *status = false;
Index: /branches/pap_branch_20090128/ppMerge/src/ppMergeScaleZero.c
===================================================================
--- /branches/pap_branch_20090128/ppMerge/src/ppMergeScaleZero.c	(revision 21218)
+++ /branches/pap_branch_20090128/ppMerge/src/ppMergeScaleZero.c	(revision 21219)
@@ -43,5 +43,5 @@
         pmFPAfileActivate(config->files, false, NULL);
         psArray *files = ppMergeFileActivateSingle(config, PPMERGE_FILES_INPUT, true, i); // Activated files
-        pmFPAfile *input = files->data[0]; // Representative file; should be the image (not mask or weight)
+        pmFPAfile *input = files->data[0]; // Representative file; should be the image (not mask or variance)
         pmFPA *fpa = input->fpa;        // FPA of interest
         view = pmFPAviewAlloc(0);       // View to component of interest
