Index: trunk/ppSim/src/ppSimSequenceFlat.c
===================================================================
--- trunk/ppSim/src/ppSimSequenceFlat.c	(revision 19080)
+++ trunk/ppSim/src/ppSimSequenceFlat.c	(revision 19315)
@@ -1,11 +1,7 @@
 # include "ppSimSequence.h"
 
-bool ppSimSequenceFlat (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, char *camera, const char *injectCommand) {
+bool ppSimSequenceFlat (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, const char *ppSimCommand, const char *injectCommand) {
 
     bool status;
-
-    if (camera == NULL) {
-	camera = psMetadataLookupStr (&status, sequence, "CAMERA");
-    }
 
     // determine the filters & exposure times
@@ -28,38 +24,38 @@
     for (int i = 0; i < filters->n; i++) {
 	    
-      // loop over the filters & exposure times
-      for (int j = 0; j < nSetup; j++) {
+	// loop over the filters & exposure times
+	for (int j = 0; j < nSetup; j++) {
 	    
-	psString command = NULL;
+	    // 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);
+	    }
 
-	psStringAppend (&command, "ppSim -type FLAT");
-	psStringAppend (&command, " -camera %s", camera);
+	    // define the ppSim comand
+	    psString command = NULL;
 
-	psStringAppend (&command, " -filter %s", (char *) filters->data[i]);
-	psStringAppend (&command, " -exptime %f", exptimes->data.F32[i]);
+	    psStringAppend (&command, "%s -type FLAT", ppSimCommand);
 
-	// 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, " -filter %s", (char *) filters->data[i]);
+	    psStringAppend (&command, " -exptime %f", exptimes->data.F32[i]);
+
+	    psStringAppend (&command, " %s", filename);
+
+	    fprintf (simfile, "%s\n", command);
+	    psFree (command);
+
+	    // define the inject command
+	    // path should be dirname/filename
+	    command = psStringCopy (injectCommand);
+	    psStringAppend (&command, " %s*.fits",    filename);
+	    fprintf (inject, "%s\n", command);
+	    psFree (command);
+	    psFree (filename);
+
+	    nImage ++;
 	}
-	psStringAppend (&command, " %s", filename);
-
-
-	fprintf (simfile, "%s\n", command);
-	psFree (command);
-
-	// path should be dirname/filename
-	command = psStringCopy (injectCommand);
-	psStringAppend (&command, " --camera %s", camera);
-	psStringAppend (&command, " %s*.fits",    filename);
-	fprintf (inject, "%s\n", command);
-	psFree (command);
-	psFree (filename);
-
-	nImage ++;
-      }
     }
     return true;
