Index: trunk/ppSim/src/ppSimSequence.c
===================================================================
--- trunk/ppSim/src/ppSimSequence.c	(revision 19080)
+++ trunk/ppSim/src/ppSimSequence.c	(revision 19315)
@@ -43,4 +43,11 @@
         psArgumentRemove(argNum, &argc, argv);
         workdir = psStringCopy (argv[argNum]);
+        psArgumentRemove(argNum, &argc, argv);
+    }
+
+    char *ppsim_recipe = NULL;
+    if ((argNum = psArgumentGet (argc, argv, "-ppsim_recipe"))) {
+        psArgumentRemove(argNum, &argc, argv);
+        ppsim_recipe = psStringCopy (argv[argNum]);
         psArgumentRemove(argNum, &argc, argv);
     }
@@ -83,4 +90,6 @@
         fprintf (stderr, " (inject)   : an output file with commands to inject the images into the pipeline\n");
         fprintf (stderr, "options:\n");
+        fprintf (stderr, " -camera (camera) [otherwise must be set in sequences file]\n");
+        fprintf (stderr, " -ppsim_recipe (recipe)\n");
         fprintf (stderr, " -dbname (dbname)\n");
         fprintf (stderr, " -path (path)\n");
@@ -120,4 +129,8 @@
     if (tess_id) psStringAppend (&injectCommand, " --tess_id %s", tess_id);
 
+    // build the base ppSimCommand string
+    psString ppSimCommand = psStringCopy ("ppSim");
+    if (ppsim_recipe) psStringAppend (&ppSimCommand, " -recipe PPSIM %s", ppsim_recipe);
+
     unsigned long seed = psMetadataLookupS32 (&status, config, "RND_SEED");
     if (!status) seed = 0;
@@ -157,18 +170,29 @@
         }
 
+	// determine the camera for the sequence and define the ppSim command
+	if (camera == NULL) {
+	    camera = psMetadataLookupStr (&status, sequence, "CAMERA");
+	}
+
+	psString injectCommandReal = NULL;
+	psString ppSimCommandReal = NULL;
+
+	psStringAppend (&injectCommandReal, "%s --camera %s", injectCommand, camera);
+	psStringAppend (&ppSimCommandReal, "%s -camera %s", ppSimCommand, camera);
+
         if (!strcasecmp (type, "BIAS")) {
-            ppSimSequenceBias (simfile, inject, sequence, i, rng, path, basename, camera, injectCommand);
+            ppSimSequenceBias (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal);
             continue;
         }
         if (!strcasecmp (type, "DARK")) {
-            ppSimSequenceDark (simfile, inject, sequence, i, rng, path, basename, camera, injectCommand);
+            ppSimSequenceDark (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal);
             continue;
         }
         if (!strcasecmp (type, "FLAT")) {
-            ppSimSequenceFlat (simfile, inject, sequence, i, rng, path, basename, camera, injectCommand);
+            ppSimSequenceFlat (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal);
             continue;
         }
         if (!strcasecmp (type, "OBJECT")) {
-            ppSimSequenceObject (simfile, inject, sequence, i, rng, path, basename, camera, injectCommand);
+            ppSimSequenceObject (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal);
             continue;
         }
