Index: trunk/ppSim/src/ppSimLoop.c
===================================================================
--- trunk/ppSim/src/ppSimLoop.c	(revision 18011)
+++ trunk/ppSim/src/ppSimLoop.c	(revision 21365)
@@ -34,14 +34,14 @@
     psArray *galaxies = psArrayAllocEmpty (1);
     if (type == PPSIM_TYPE_OBJECT) {
-	// Load forced-photometry positions (these are placed on fpa->analysis for use in ppSimPhotomReadout)
-	if (!ppSimLoadSpots (fpa, config)) ESCAPE (PS_ERR_UNKNOWN, "failed to load forced-photometry spots");
-
-	// Load catalogue stars
+        // Load forced-photometry positions (these are placed on fpa->analysis for use in ppSimPhotomReadout)
+        if (!ppSimLoadSpots (fpa, config)) ESCAPE (PS_ERR_UNKNOWN, "failed to load forced-photometry spots");
+
+        // Load catalogue stars
         if (!ppSimLoadStars (stars, fpa, config)) ESCAPE (PS_ERR_UNKNOWN, "failed to load catalog stars");
 
-	// Add random stars
+        // Add random stars
         if (!ppSimMakeStars (stars, fpa, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "failed to make random stars");
 
-	// Add random galaxies
+        // Add random galaxies
         if (!ppSimMakeGalaxies (galaxies, fpa, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "failed to make random galaxies");
     }
@@ -105,8 +105,8 @@
                 // TO DO: Decide if cell is to be windowed, reduce numCols, numRows appropriately
                 readout->image = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Signal in pixels
-                readout->weight = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Noise in pixels
+                readout->variance = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Noise in pixels
 
                 psImageInit (readout->image, 0.0);
-                psImageInit (readout->weight, 0.0);
+                psImageInit (readout->variance, 0.0);
 
                 psFree(readout);        // Drop reference
@@ -115,12 +115,12 @@
             psVector *biasCols = ppSimMakeBiassec (cell, config);
 
-	    pmReadout *readout;
-	    while ((readout = pmFPAviewNextReadout (view, fpa, 1))) {
-
-                // if we have not read in a weight or generated a fake image above, we need to
+            pmReadout *readout;
+            while ((readout = pmFPAviewNextReadout (view, fpa, 1))) {
+
+                // if we have not read in a variance or generated a fake image above, we need to
                 // build one here
-                if (!readout->weight) {
-                    if (!pmReadoutGenerateWeight(readout, true)) {
-                        psError (PS_ERR_UNKNOWN, false, "trouble creating weight");
+                if (!readout->variance) {
+                    if (!pmReadoutGenerateVariance(readout, true)) {
+                        psError (PS_ERR_UNKNOWN, false, "trouble creating variance");
                         return false;
                     }
@@ -133,8 +133,8 @@
 
                 psVector *biasRows = ppSimMakeBias (&status, readout, config, rng);
-		if (!status) ESCAPE (PS_ERR_UNKNOWN, "problem generating dark structure");
+                if (!status) ESCAPE (PS_ERR_UNKNOWN, "problem generating dark structure");
                 if (type == PPSIM_TYPE_BIAS) goto done;
 
-		if (!ppSimMakeDark (readout, config)) ESCAPE (PS_ERR_UNKNOWN, "problem generating dark structure");
+                if (!ppSimMakeDark (readout, config)) ESCAPE (PS_ERR_UNKNOWN, "problem generating dark structure");
                 if (type == PPSIM_TYPE_DARK) goto done;
 
@@ -153,5 +153,5 @@
 
             done:
-                if (!ppSimAddNoise(readout->image, readout->weight, cell, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "problem adding noise");
+                if (!ppSimAddNoise(readout->image, readout->variance, cell, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "problem adding noise");
                 if (!ppSimSaturate(readout, config)) ESCAPE (PS_ERR_UNKNOWN, "problem setting saturation levels");
 
@@ -165,6 +165,6 @@
                 readout->parent->parent->data_exists = true;
 
-		// if there is an input image, merge it with the simulated image
-		if (!ppSimMergeReadouts (config, view)) ESCAPE (PS_ERR_UNKNOWN, "problem merging input image with simulated image");
+                // if there is an input image, merge it with the simulated image
+                if (!ppSimMergeReadouts (config, view)) ESCAPE (PS_ERR_UNKNOWN, "problem merging input image with simulated image");
             }
             psFree(biasCols);
@@ -173,5 +173,5 @@
 
             if (cell->hdu) {
-		// XXX only do this if there is no INPUT image?
+                // XXX only do this if there is no INPUT image?
                 if (!ppSimInitHeader(config, NULL, NULL, cell)) ESCAPE (PS_ERR_UNKNOWN, "problem setting output header");
             }
@@ -186,13 +186,13 @@
         }
 
-	// XXX why no UpdateConceptsChip??
+        // XXX why no UpdateConceptsChip??
 
         if (chip->hdu) {
-	    // XXX only do this if there is no INPUT image
+            // XXX only do this if there is no INPUT image
             if (!ppSimInitHeader(config, NULL, chip, NULL)) ESCAPE (PS_ERR_UNKNOWN, "problem setting output header");
         }
 
         // we perform photometry on the readouts of this chip in the output
-	if (!ppSimPhotom (config, view)) ESCAPE (PS_ERR_UNKNOWN, "problem performing photometry");
+        if (!ppSimPhotom (config, view)) ESCAPE (PS_ERR_UNKNOWN, "problem performing photometry");
 
         if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
