Index: /branches/eam_branch_20080511/ppSim/src/ppSim.h
===================================================================
--- /branches/eam_branch_20080511/ppSim/src/ppSim.h	(revision 17900)
+++ /branches/eam_branch_20080511/ppSim/src/ppSim.h	(revision 17901)
@@ -169,4 +169,11 @@
     );
 
+bool ppSimArgToRecipeBool(bool *status,
+			  psMetadata *options,    // Target to which to add value
+			  const char *recipeName, // Name for value in the recipe
+			  psMetadata *arguments,  // Command-line arguments
+			  const char *argName	    // Argument name in the command-line arguments
+    );
+
 ppSimType ppSimTypeFromString (char *typeStr);
 char *ppSimTypeToString (ppSimType type);
Index: /branches/eam_branch_20080511/ppSim/src/ppSimArguments.c
===================================================================
--- /branches/eam_branch_20080511/ppSim/src/ppSimArguments.c	(revision 17900)
+++ /branches/eam_branch_20080511/ppSim/src/ppSimArguments.c	(revision 17901)
@@ -29,28 +29,29 @@
 
     psMetadata *arguments = psMetadataAlloc(); // Command-line arguments
-    psMetadataAddStr(arguments, PS_LIST_TAIL, "-format", 0, "Camera format name", NULL);
-    psMetadataAddStr(arguments, PS_LIST_TAIL, "-type", 0, "Exposure type (BIAS|DARK|FLAT|OBJECT)", NULL);
-    psMetadataAddStr(arguments, PS_LIST_TAIL, "-filter", 0, "Filter name", NULL);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-exptime", 0, "Exposure time (s)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-biaslevel", 0, "Bias level (e)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-biasrange", 0, "Bias range (e)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-darkrate", 0, "Dark rate (e/s)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-flatsigma", 0, "Flat sigma", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-flatrate", 0, "Flat rate (e/s)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-shuttertime", 0, "Shutter time (s)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-skyrate", 0, "Sky rate (e/s)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-skymags", 0, "Sky brightness in mags / square arcsec", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-ra", 0, "RA (degrees)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-dec", 0, "Dec (degrees)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-pa", 0, "Position angle (degrees)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-scale", 0, "Plate scale (arcsec/pixel)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp", 0, "Photometric zero point", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-seeing", 0, "Seeing FWHM (arcsec)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-starslum", 0, "Fake star luminosity function slope", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-starsmag", 0, "Brightest magnitude for fake stars", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-starsdensity", 0, "Density of fake stars at magnitude", NAN);
-    psMetadataAddStr(arguments, PS_LIST_TAIL, "-psfclass", 0, "Type of PSF model", NULL);
-    psMetadataAddStr(arguments, PS_LIST_TAIL, "-galmodel", 0, "Type of Galaxy model", NULL);
-    psMetadataAddS32(arguments, PS_LIST_TAIL, "-bin", 0, "Binning in x and y", 1);
+    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-format", 0, "Camera format name", NULL);
+    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-type", 0, "Exposure type (BIAS|DARK|FLAT|OBJECT)", NULL);
+    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-filter", 0, "Filter name", NULL);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-exptime", 0, "Exposure time (s)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-biaslevel", 0, "Bias level (e)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-biasrange", 0, "Bias range (e)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-darkrate", 0, "Dark rate (e/s)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-flatsigma", 0, "Flat sigma", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-flatrate", 0, "Flat rate (e/s)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-shuttertime", 0, "Shutter time (s)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-skyrate", 0, "Sky rate (e/s)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-skymags", 0, "Sky brightness in mags / square arcsec", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-ra", 0, "RA (degrees)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-dec", 0, "Dec (degrees)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-pa", 0, "Position angle (degrees)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-scale", 0, "Plate scale (arcsec/pixel)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-zp", 0, "Photometric zero point", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-seeing", 0, "Seeing FWHM (arcsec)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-starslum", 0, "Fake star luminosity function slope", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-starsmag", 0, "Brightest magnitude for fake stars", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-starsdensity", 0, "Density of fake stars at magnitude", NAN);
+    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-psfclass", 0, "Type of PSF model", NULL);
+    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-galmodel", 0, "Type of Galaxy model", NULL);
+    psMetadataAddS32(arguments,  PS_LIST_TAIL, "-bin", 0, "Binning in x and y", 1);
+    psMetadataAddBool(arguments, PS_LIST_TAIL, "+photom", 0, "Perform photometry on fake sources", 1);
 
     if (psArgumentGet (argc, argv, "-h")) { usage(argv[0], arguments, config); }
@@ -59,5 +60,8 @@
 
     pmConfigFileSetsMD (config->arguments, &argc, argv, "PSPHOT.PSF", "-psf", "-psflist");
-    if (psErrorCodeLast () != PS_ERR_NONE) { psAbort ("problem with PSPHOT.PSF option"); }
+    if (psErrorCodeLast () != PS_ERR_NONE) { psAbort ("problem with -psf or -psflist option"); }
+
+    pmConfigFileSetsMD (config->arguments, &argc, argv, "INPUT.SOURCES", "-cmf", "-cmflist");
+    if (psErrorCodeLast () != PS_ERR_NONE) { psAbort ("problem with -cmf or -cmflist option"); }
 
     // Only one of -camera and -file is needed or allowed.  The -camera option would have been
@@ -103,4 +107,5 @@
     ppSimArgToRecipeF32(&status, options, "STARS.MAG",     arguments, "-starsmag");
     ppSimArgToRecipeF32(&status, options, "STARS.DENSITY", arguments, "-starsdensity");
+    ppSimArgToRecipeBool(&status, options, "PHOTOM",        arguments, "+photom");
 
     // if we are loading the input image (not creating it), then we can skip the remaining arguments
@@ -168,12 +173,12 @@
 
     // these values all get moved from arguments to RECIPE:OPTIONS
-    ppSimArgToRecipeF32(&status, options, "BIAS.LEVEL",    arguments, "-biaslevel");
-    ppSimArgToRecipeF32(&status, options, "BIAS.RANGE",    arguments, "-biasrange");
-    ppSimArgToRecipeF32(&status, options, "DARK.RATE",     arguments, "-darkrate");
-    ppSimArgToRecipeF32(&status, options, "FLAT.SIGMA",    arguments, "-flatsigma");
-    ppSimArgToRecipeF32(&status, options, "FLAT.RATE",     arguments, "-flatrate");
-    ppSimArgToRecipeF32(&status, options, "SHUTTER.TIME",  arguments, "-shuttertime");
-    ppSimArgToRecipeF32(&status, options, "SKY.RATE",      arguments, "-skyrate");
-    ppSimArgToRecipeS32(&status, options, "BINNING",       arguments, "-bin");
+    ppSimArgToRecipeF32(&status,  options, "BIAS.LEVEL",    arguments, "-biaslevel");
+    ppSimArgToRecipeF32(&status,  options, "BIAS.RANGE",    arguments, "-biasrange");
+    ppSimArgToRecipeF32(&status,  options, "DARK.RATE",     arguments, "-darkrate");
+    ppSimArgToRecipeF32(&status,  options, "FLAT.SIGMA",    arguments, "-flatsigma");
+    ppSimArgToRecipeF32(&status,  options, "FLAT.RATE",     arguments, "-flatrate");
+    ppSimArgToRecipeF32(&status,  options, "SHUTTER.TIME",  arguments, "-shuttertime");
+    ppSimArgToRecipeF32(&status,  options, "SKY.RATE",      arguments, "-skyrate");
+    ppSimArgToRecipeS32(&status,  options, "BINNING",       arguments, "-bin");
 
     if (type == PPSIM_TYPE_OBJECT) {
Index: /branches/eam_branch_20080511/ppSim/src/ppSimDetections.c
===================================================================
--- /branches/eam_branch_20080511/ppSim/src/ppSimDetections.c	(revision 17900)
+++ /branches/eam_branch_20080511/ppSim/src/ppSimDetections.c	(revision 17901)
@@ -2,28 +2,29 @@
 
 bool ppSimDetections (psImage *significance, psMetadata *recipe, psArray *sources) {
+    psAssert (sources, "programming error: ppSimDetections passed NULL sources");
 
-  bool status;
+    bool status;
 
-  // for each source, measure the significance of the peak at the given coordinate
-  // where does this get stored?
+    // for each source, measure the significance of the peak at the given coordinate
+    // where does this get stored?
 
-  // XXX need to get the effective Area from the PSF sigma
-  float SIGMA_SMTH  = psMetadataLookupF32 (&status, recipe, "SIGMA_SMOOTH"); 
-  psAssert (status, "SIGMA_SMOOTH missing: call psphotSignificanceImage first"); 
-  float effArea = 4.0*M_PI*PS_SQR(SIGMA_SMTH);
+    // XXX need to get the effective Area from the PSF sigma
+    float SIGMA_SMTH  = psMetadataLookupF32 (&status, recipe, "SIGMA_SMOOTH"); 
+    psAssert (status, "SIGMA_SMOOTH missing: call psphotSignificanceImage first"); 
+    float effArea = 4.0*M_PI*PS_SQR(SIGMA_SMTH);
 
-  int row0 = significance->row0;
-  int col0 = significance->col0;
+    int row0 = significance->row0;
+    int col0 = significance->col0;
 
-  for (int i = 0; i < sources->n; i++) {
+    for (int i = 0; i < sources->n; i++) {
 
-    pmSource *source = sources->data[i];
-    pmPeak *peak = source->peak;
-    psAssert (peak, "peak is not defined for the source");
+	pmSource *source = sources->data[i];
+	pmPeak *peak = source->peak;
+	psAssert (peak, "peak is not defined for the source");
 
-    peak->value = significance->data.F32[peak->y-row0][peak->x-col0];
-    peak->SN = sqrt(peak->value*effArea);
+	peak->value = significance->data.F32[peak->y-row0][peak->x-col0];
+	peak->SN = sqrt(peak->value*effArea);
 
-  }
-  return true;
+    }
+    return true;
 }
Index: /branches/eam_branch_20080511/ppSim/src/ppSimLoadForceSources.c
===================================================================
--- /branches/eam_branch_20080511/ppSim/src/ppSimLoadForceSources.c	(revision 17900)
+++ /branches/eam_branch_20080511/ppSim/src/ppSimLoadForceSources.c	(revision 17901)
@@ -2,4 +2,7 @@
 
 psArray *ppSimLoadForceSources(pmConfig *config, const pmFPAview *view) {
+
+    psArray *result = psArrayAlloc(0);
+    return result;
 
 # if (0)
Index: /branches/eam_branch_20080511/ppSim/src/ppSimLoop.c
===================================================================
--- /branches/eam_branch_20080511/ppSim/src/ppSimLoop.c	(revision 17900)
+++ /branches/eam_branch_20080511/ppSim/src/ppSimLoop.c	(revision 17901)
@@ -56,4 +56,7 @@
 
     ppSimUpdateConceptsFPA (fpa, config);
+    if (fpa->hdu) { // XXX only do this if there is no INPUT image
+        if (!ppSimInitHeader(config, fpa, NULL, NULL)) ESCAPE (PS_ERR_UNKNOWN, "problem setting output header");
+    }
 
     pmChip *chip;                       // Chip from FPA
@@ -179,4 +182,6 @@
         }
 
+	// XXX why no UpdateConceptsChip??
+
         if (chip->hdu) {
 	    // XXX only do this if there is no INPUT image
@@ -193,14 +198,8 @@
             return false;
         }
-
     }
 
     psFree(stars);
     psFree(galaxies);
-
-    if (fpa->hdu) {
-	// XXX only do this if there is no INPUT image
-        if (!ppSimInitHeader(config, fpa, NULL, NULL)) ESCAPE (PS_ERR_UNKNOWN, "problem setting output header");
-    }
 
     if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
Index: /branches/eam_branch_20080511/ppSim/src/ppSimPhotom.c
===================================================================
--- /branches/eam_branch_20080511/ppSim/src/ppSimPhotom.c	(revision 17900)
+++ /branches/eam_branch_20080511/ppSim/src/ppSimPhotom.c	(revision 17901)
@@ -25,9 +25,14 @@
     }
 
-    // we make a new copy of the output chip to keep psphot from modifying the output image
-    // XXX is this needed for ppSim? only if we want to write out the image with and without subtracted sources
-    pmChip *oldChip = pmFPAviewThisChip (view, input->src);
-    pmChip *newChip = pmFPAviewThisChip (view, input->fpa);
-    pmChipCopy (newChip, oldChip);
+    // XXX If we want to be able to write out both the positive and residual images, we will
+    // need to define an additional pmFPAfile container, and then make a copy as is done for
+    // PPIMAGE.CHIP -> PSPHOT.INPUT in ppImage.  At the moment, PPSIM.CHIP will write out the
+    // mosaicked image with the sources subtracted.
+
+    // XXX if input -> PSPHOT.INPUT, which is tied to PPSIM.CHIP with pmFPAfileDefineFromFile,
+    // then the following code creates the chip copy:
+    // pmChip *oldChip = pmFPAviewThisChip (view, input->src);
+    // pmChip *newChip = pmFPAviewThisChip (view, input->fpa);
+    // pmChipCopy (newChip, oldChip);
 
     // iterate over the cells and readout for this chip
Index: /branches/eam_branch_20080511/ppSim/src/ppSimPhotomFiles.c
===================================================================
--- /branches/eam_branch_20080511/ppSim/src/ppSimPhotomFiles.c	(revision 17900)
+++ /branches/eam_branch_20080511/ppSim/src/ppSimPhotomFiles.c	(revision 17901)
@@ -44,5 +44,5 @@
         pmFPAfile *output = pmFPAfileDefineFromFile (config, input,  1,  1, "PSPHOT.BACKSUB");
         if (!output) {
-            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.");
+            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKSUB");
             return false;
         }
@@ -51,7 +51,7 @@
 
     // the input sources are required for sensible measurements of the fake or force sources
-    pmFPAfileDefineFromArgs (&status, config, "PPSIM.REAL.SOURCES", "INPUT.SOURCES");
-    if (!status) {
-      psError(PS_ERR_UNKNOWN, false, "Failed to build FPA from PPSIM.REAL.SOURCES");
+    pmFPAfile *cmffile = pmFPAfileDefineFromArgs (&status, config, "PPSIM.REAL.SOURCES", "INPUT.SOURCES");
+    if (!cmffile) {
+      psError(PS_ERR_UNKNOWN, false, "input sources not found; required for photometry (or error with PPSIM.REAL.SOURCES filerule)");
       return false;
     }
@@ -60,13 +60,14 @@
     pmFPAfile *outsources = pmFPAfileDefineOutputFromFile (config, input, "PPSIM.FAKE.SOURCES");
     if (!outsources) {
-        psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.OUTPUT");
+        psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PPSIM.FAKE.SOURCES");
         return false;
     }
     outsources->save = true;
 
-    pmFPAfileBindFromArgs(&status, input, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF");
-    if (!status) {
+    // we bind the psffile to the chip-mosaicked image so we have a reference to the image 
+    pmFPAfile *psffile = pmFPAfileBindFromArgs(&status, input, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF");
+    if (!psffile) {
       psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.PSF.LOAD");
-      return status;
+      return false;
     }
 
Index: /branches/eam_branch_20080511/ppSim/src/ppSimPhotomReadout.c
===================================================================
--- /branches/eam_branch_20080511/ppSim/src/ppSimPhotomReadout.c	(revision 17900)
+++ /branches/eam_branch_20080511/ppSim/src/ppSimPhotomReadout.c	(revision 17901)
@@ -1,3 +1,28 @@
 # include "ppSim.h"
+
+psArray *ppSimSelectSources (pmConfig *config, const pmFPAview *view, const char *filename) {
+
+    pmReadout *readout = pmFPAfileThisReadout (config->files, view, filename);
+    PS_ASSERT_PTR_NON_NULL (readout, NULL);
+
+    psArray *sources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES");
+    return sources;
+}
+
+bool ppSimDefinePixels (psArray *sources, pmReadout *readout, psMetadata *recipe) {
+
+    bool status;
+
+    float OUTER = psMetadataLookupF32 (&status, recipe, "SKY_OUTER_RADIUS");
+    if (!status) return NULL;
+
+    for (int i = 0; i < sources->n; i++) {
+	pmSource *source = sources->data[i];
+
+        // allocate image, weight, mask arrays for each peak (square of radius OUTER)
+        pmSourceDefinePixels (source, readout, source->peak->x, source->peak->y, OUTER);
+    }
+    return true;
+}
 
 bool ppSimPhotomReadout(pmConfig *config, const pmFPAview *view) {
@@ -13,5 +38,5 @@
 
     // set the photcode for this image
-    if (!psphotAddPhotcode (recipe, config, view)) {
+    if (!psphotAddPhotcode (recipe, config, view, "PPSIM.CHIP")) {
         psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
         return false;
@@ -23,6 +48,26 @@
     PS_ASSERT_PTR_NON_NULL (readout, false);
 
-    pmReadout *realSourceReadout = pmFPAfileThisReadout (config->files, view, "PPSIM.REAL.SOURCES");
-    PS_ASSERT_PTR_NON_NULL (realSourceReadout, false);
+    // the previously measured real sources are loaded into the PPSIM.REAL.SOURCES pmFPAfile
+    psArray *realSources = ppSimSelectSources (config, view, "PPSIM.REAL.SOURCES");
+    PS_ASSERT_PTR_NON_NULL (realSources, false);
+
+    // the newly injected fake sources are saved on the PPSIM.OUTPUT pmFPAfile
+    psArray *injectedSources = ppSimSelectSources (config, view, "PPSIM.OUTPUT");
+    PS_ASSERT_PTR_NON_NULL (injectedSources, false);
+
+    // XXX need to define the source pixels
+    ppSimDefinePixels (realSources, readout, recipe);
+    ppSimDefinePixels (injectedSources, readout, recipe);
+
+    // make a copy of the fake-source parameters so these can be saved independently from the
+    // measured fake-source parameters
+    psArray *fakeSources = psArrayAlloc (injectedSources->n);
+    for (int i = 0; i < injectedSources->n; i++) {
+      fakeSources->data[i] = pmSourceCopy (injectedSources->data[i]);
+    }
+
+    // load the forced source lists
+    psArray *forceSources = ppSimLoadForceSources (config, view);
+    psAssert (forceSources, "failed to load force photometry sources");
 
     // Generate the mask and weight images, including the user-defined analysis region of interest
@@ -33,17 +78,4 @@
     pmPSF *psf = psphotLoadPSF (config, view, recipe);
     assert (psf);
-
-    // load the source lists
-    // PPSIM.REAL.SOURCES carries the pmSource objects (from psphot analysis or loaded externally)
-    psArray *realSources = psMetadataLookupPtr (NULL, realSourceReadout->analysis, "PSPHOT.SOURCES");
-    psArray *forceSources = ppSimLoadForceSources (config, view);
-
-    // XXX make a copy of the fake-source parameters so these can be saved independently 
-    // from the measured fake-source parameters
-    psArray *injectedSources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES");
-    psArray *fakeSources = psArrayAlloc (injectedSources->n);
-    for (int i = 0; i < injectedSources->n; i++) {
-      fakeSources->data[i] = pmSourceCopy (injectedSources->data[i]);
-    }
 
     // remove all sources 
@@ -97,7 +129,9 @@
     // XXX for the fake sources, these must be identically zero
     // XXX for the force sources, need the apresid to put the mags on the correct system
-    if (!psphotApResid (readout, forceSources, recipe, psf)) {
-        psLogMsg ("psphot", 3, "failed on psphotApResid");
-        return psphotReadoutCleanup (config, readout, recipe, NULL, psf, NULL);
+    if (0) {
+	if (!psphotApResid (readout, forceSources, recipe, psf)) {
+	    psLogMsg ("psphot", 3, "failed on psphotApResid");
+	    return psphotReadoutCleanup (config, readout, recipe, NULL, psf, NULL);
+	}
     }
 
@@ -119,5 +153,8 @@
     // add forceSources to the readout (real and fake already there)
     // these are outputs: we need to generate the fpa structure
-    // psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PPSIM.FAKE.SOURCES", PS_DATA_ARRAY, "fake photometry ", fakeSources);
+    
+    pmReadout *fakeReadout = pmFPAfileThisReadout (config->files, view, "PPSIM.FAKE.SOURCES");
+    psMetadataAdd (fakeReadout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "fake photometry ", fakeSources);
+
     // psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PPSIM.FORCE.SOURCES", PS_DATA_ARRAY, "forced photometry ", forceSources);
     psFree (forceSources);
Index: /branches/eam_branch_20080511/ppSim/src/ppSimUtils.c
===================================================================
--- /branches/eam_branch_20080511/ppSim/src/ppSimUtils.c	(revision 17900)
+++ /branches/eam_branch_20080511/ppSim/src/ppSimUtils.c	(revision 17901)
@@ -212,4 +212,20 @@
 
 // Get a value from the command-line arguments and add it to recipe options
+bool ppSimArgToRecipeBool(bool *status,
+			  psMetadata *options,    // Target to which to add value
+			  const char *recipeName, // Name for value in the recipe
+			  psMetadata *arguments,  // Command-line arguments
+			  const char *argName	    // Argument name in the command-line arguments
+    )
+{
+    bool myStatus;
+    bool value = psMetadataLookupS32(&myStatus, arguments, argName); // Value of interest
+    if (status) { *status = myStatus; }
+
+    psMetadataAddBool(options, PS_LIST_TAIL, recipeName, PS_META_REPLACE, NULL, value);
+    return value;
+}
+
+// Get a value from the command-line arguments and add it to recipe options
 char *ppSimArgToRecipeStr(bool *status,
 			  psMetadata *options,    // Target to which to add value
