Index: trunk/ppSim/src/ppSimSequenceObject.c
===================================================================
--- trunk/ppSim/src/ppSimSequenceObject.c	(revision 19080)
+++ trunk/ppSim/src/ppSimSequenceObject.c	(revision 19315)
@@ -1,5 +1,5 @@
 # include "ppSimSequence.h"
 
-bool ppSimSequenceObject (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, char *camera, const char *injectCommand) {
+bool ppSimSequenceObject (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, const char *ppSimCommand, const char *injectCommand) {
 
     bool status;
@@ -8,8 +8,4 @@
     // ppSim -camera $camera -type OBJECT -filter $filter -exptime $exptime
     //       -skyrate $sky -ra $ra -dec $dec -pa $pa -scale $scale -zp $zp -seeing $seeing $filename",
-
-    if (camera == NULL) {
-	camera = psMetadataLookupStr (&status, sequence, "CAMERA");
-    }
 
     // sequence reference coordinate
@@ -80,8 +76,16 @@
 			for (float pos = pos_min; pos <= pos_max; pos += pos_delta) {
 	      
+			    // define the output filename
+			    psString filename = NULL;
+			    if (path) {
+				psStringAppend (&filename, "%s/%s.%03d.%03d", path, basename, nSeq, nImage);
+			    } else {
+				psStringAppend (&filename, "%s.%03d.%03d", basename, nSeq, nImage);
+			    }
+
+			    // define the ppSim command
 			    psString command = NULL;
 
-			    psStringAppend (&command, "ppSim -type OBJECT");
-			    psStringAppend (&command, " -camera %s", camera);
+			    psStringAppend (&command, "%s -type OBJECT", ppSimCommand);
 			    psStringAppend (&command, " -filter %s", (char *) filters->data[i]);
 			    psStringAppend (&command, " -exptime %f", exptimes->data.F32[i]);
@@ -97,11 +101,4 @@
 			    psStringAppend (&command, " -seeing %f", seeing);
 
-			    // XXX need to add output filename
-			    psString filename = NULL;
-			    if (path) {
-				psStringAppend (&filename, "%s/%s.%03d.%03d", path, basename, nSeq, nImage);
-			    } else {
-				psStringAppend (&filename, "%s.%03d.%03d", basename, nSeq, nImage);
-			    }
 			    psStringAppend (&command, " %s", filename);
 
@@ -109,7 +106,7 @@
 			    psFree (command);
 			    
+			    // define the inject command
 			    // path should be dirname/filename
 			    command = psStringCopy (injectCommand);
-			    psStringAppend (&command, " --camera %s", camera);
 			    psStringAppend (&command, " %s*.fits",    filename);
 			    fprintf (inject, "%s\n", command);
