Index: trunk/ppSim/src/ppSimMakeStars.c
===================================================================
--- trunk/ppSim/src/ppSimMakeStars.c	(revision 14531)
+++ trunk/ppSim/src/ppSimMakeStars.c	(revision 14667)
@@ -3,9 +3,11 @@
 bool ppSimMakeStars(psArray *stars, pmFPA *fpa, pmConfig *config, const psRandom *rng) {
 
+    bool mdok;
     assert (stars);
 
-    bool mdok;
+    psMetadata *recipe = psMetadataLookupMetadata(&mdok, config->recipes, PPSIM_RECIPE); // Recipe
 
-    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSIM_RECIPE); // Recipe
+    bool starsFake = psMetadataLookupBool(&mdok, recipe, "STARS.FAKE"); // Density of fakes
+    if (!starsFake) return true;
 
     float starsLum = psMetadataLookupF32(NULL, config->arguments, "STARS.LUM"); // Star luminosity func slope
@@ -45,31 +47,34 @@
 	psLogMsg("ppSim", PS_LOG_INFO,
 		 "Image noise is above brightest random star --- no random stars added.");
-    } else {
+	return true;
+    }
 
-	// Normalisation, set by the specified stellar density at the specified bright magnitude
-	float norm = starsDensity * xSize * ySize * PS_SQR(scale * 180.0 / M_PI) /
-	    powf(bright, starsLum);
+    // Normalisation, set by the specified stellar density at the specified bright magnitude
+    float norm = starsDensity * xSize * ySize * PS_SQR(scale * 180.0 / M_PI) /
+	powf(bright, starsLum);
 
-	// Total number of stars down to the faint flux end
-	long num = expf(logf(norm) + starsLum * logf(faint)) + 0.5;
+    // Total number of stars down to the faint flux end
+    long num = expf(logf(norm) + starsLum * logf(faint)) + 0.5;
 
-	psLogMsg("ppSim", PS_LOG_INFO, "Adding %ld stars down to %f mag\n", num,
-		 -2.5 * log10(faint * sqrt(2.0*M_PI) * seeing / expTime) + zp);
+    psLogMsg("ppSim", PS_LOG_INFO, "Adding %ld stars down to %f mag\n", num,
+	     -2.5 * log10(faint * sqrt(2.0*M_PI) * seeing / expTime) + zp);
 
-	long oldSize = stars->n;
-	psArrayRealloc (stars, stars->n + num);
+    long oldSize = stars->n;
+    psArrayRealloc (stars, stars->n + num);
 
-	for (long i = 0; i < num; i++) {
-	    ppSimStar *star = ppSimStarAlloc ();
+    for (long i = 0; i < num; i++) {
+	ppSimStar *star = ppSimStarAlloc ();
 
-	    // make fpa center of distribution
-	    star->x    = psRandomUniform(rng) * xSize; // x position
-	    star->y    = psRandomUniform(rng) * ySize; // y position
-	    star->peak = expf((logf(i + 1) - logf(norm)) / starsLum); // Peak flux
-	    star->flux = star->peak * sqrt(2.0*M_PI)*seeing;
-	    stars->data[oldSize + i] = star;
-	}
-	stars->n = stars->nalloc;
+	// make fpa center of distribution
+	star->x    = psRandomUniform(rng) * xSize; // x position
+	star->y    = psRandomUniform(rng) * ySize; // y position
+
+	star->flux = expf((logf(i + 1) - logf(norm)) / starsLum); // Peak flux
+	star->peak = star->flux / (2.0*M_PI*PS_SQR(seeing));
+
+	stars->data[oldSize + i] = star;
     }
+    stars->n = stars->nalloc;
+
     return true;
 }
