Index: trunk/ppSim/src/ppSimAddNoise.c
===================================================================
--- trunk/ppSim/src/ppSimAddNoise.c	(revision 18011)
+++ trunk/ppSim/src/ppSimAddNoise.c	(revision 26900)
@@ -16,11 +16,11 @@
     psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSIM_RECIPE); // Recipe
 
-    float gain = psMetadataLookupF32(NULL, cell->concepts, "CELL.GAIN"); // CCD gain, e/ADU
+    // the recipe should set GAIN to NAN, and only modify to override the concept value
+    float gain = psMetadataLookupF32(&mdok, recipe, "GAIN"); // CCD gain, e/ADU
     if (isnan(gain)) {
-	psWarning("CELL.GAIN is not set; reverting to recipe value GAIN.");
-	gain = psMetadataLookupF32(&mdok, recipe, "GAIN");
+	gain = psMetadataLookupF32(&mdok, cell->concepts, "CELL.GAIN");
 	if (!mdok) {
-	    psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to find GAIN in recipe.");
-	    return false;
+	    psWarning("CELL.GAIN is not set; assuming gain of 1.0.");
+	    gain = 1.0;
 	}
     }
