Index: trunk/stac/src/stacErrorImages.c
===================================================================
--- trunk/stac/src/stacErrorImages.c	(revision 3375)
+++ trunk/stac/src/stacErrorImages.c	(revision 3666)
@@ -4,9 +4,10 @@
 
 psArray *stacErrorImages(psArray *inputs, // Array of input images
-			 stacConfig *config // Configuration details
+			 float gain,	// Gain, in e/ADU
+			 float rn	// Read noise, in e
     )
 {
-    float invGain = 1.0/config->gain;	// Inverse square root of gain
-    float rn = config->readnoise/config->gain; // Read noise in ADU
+    float invGain = 1.0/gain;		// Inverse square root of gain
+    rn /= gain;				// Read noise in ADU
     psArray *errors = psArrayAlloc(inputs->n);
 
@@ -32,17 +33,4 @@
 	// Put image onto the array
 	errors->data[i] = error;
- 
-#ifdef TESTING
-	// Write error image out to check
-	char errName[MAXCHAR];		// Filename of error image
-	sprintf(errName,"%s.err",config->inputs->data[i]);
-	psFits *errorFile = psFitsAlloc(errName);
-	if (!psFitsWriteImage(errorFile, NULL, error, 0, NULL)) {
-	    psErrorStackPrint(stderr, "Unable to write image: %s\n", errName);
-	}
-	psTrace("stac", 1, "Error image written to %s\n", errName);
-	psFree(errorFile);
-#endif
-
     }
 
