Index: /branches/eam_branches/20091201/ppSim/src/Makefile.am
===================================================================
--- /branches/eam_branches/20091201/ppSim/src/Makefile.am	(revision 26373)
+++ /branches/eam_branches/20091201/ppSim/src/Makefile.am	(revision 26374)
@@ -30,4 +30,5 @@
 	ppSimLoadStars.c          \
 	ppSimMakeStars.c          \
+	ppSimMakeStarGrid.c       \
 	ppSimMakeGalaxies.c       \
 	ppSimMakeBiassec.c        \
Index: /branches/eam_branches/20091201/ppSim/src/ppSim.h
===================================================================
--- /branches/eam_branches/20091201/ppSim/src/ppSim.h	(revision 26373)
+++ /branches/eam_branches/20091201/ppSim/src/ppSim.h	(revision 26374)
@@ -103,4 +103,5 @@
 bool ppSimLoadStars (psArray *stars, pmFPA *fpa, pmConfig *config);
 bool ppSimMakeStars(psArray *stars, pmFPA *fpa, pmConfig *config, const psRandom *rng);
+bool ppSimMakeStarGrid(psArray *stars, pmFPA *fpa, pmConfig *config, const psRandom *rng);
 bool ppSimInsertStars (pmReadout *readout, psImage *expCorr, psArray *stars, pmConfig *config);
 
Index: /branches/eam_branches/20091201/ppSim/src/ppSimAddNoise.c
===================================================================
--- /branches/eam_branches/20091201/ppSim/src/ppSimAddNoise.c	(revision 26373)
+++ /branches/eam_branches/20091201/ppSim/src/ppSimAddNoise.c	(revision 26374)
@@ -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;
 	}
     }
Index: /branches/eam_branches/20091201/ppSim/src/ppSimLoop.c
===================================================================
--- /branches/eam_branches/20091201/ppSim/src/ppSimLoop.c	(revision 26373)
+++ /branches/eam_branches/20091201/ppSim/src/ppSimLoop.c	(revision 26374)
@@ -47,4 +47,7 @@
         // Add random stars
         if (!ppSimMakeStars (stars, fpa, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "failed to make random stars");
+
+        // Add random stars
+        if (!ppSimMakeStarGrid (stars, fpa, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "failed to make random stars");
 
         // Add random galaxies
Index: /branches/eam_branches/20091201/ppSim/src/ppSimSetPSF.c
===================================================================
--- /branches/eam_branches/20091201/ppSim/src/ppSimSetPSF.c	(revision 26373)
+++ /branches/eam_branches/20091201/ppSim/src/ppSimSetPSF.c	(revision 26374)
@@ -20,4 +20,6 @@
     // ppSimArguments)
     float seeing   = psMetadataLookupF32(&status, recipe, "SEEING"); // Seeing SIGMA (pixels)
+    float aRatio   = psMetadataLookupF32(&status, recipe, "PSF.ARATIO"); // Seeing SIGMA (pixels)
+    float theta    = psMetadataLookupF32(&status, recipe, "PSF.THETA"); // Seeing SIGMA (pixels)
 
     char *psfModelName = psMetadataLookupStr(&status, recipe, "PSF.MODEL"); // Name of PSF model
@@ -55,6 +57,6 @@
     // supply the semi-major axis (these are SIGMA values in PIXELS)
     axes.major = seeing;
-    axes.minor = seeing;
-    axes.theta = 0.0;
+    axes.minor = aRatio * seeing;
+    axes.theta = theta * PS_RAD_DEG;
 
     pol = psEllipseAxesToPol (axes);
