Index: /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequence.h
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequence.h	(revision 43080)
+++ /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequence.h	(revision 43081)
@@ -17,3 +17,6 @@
 bool ppSimSequenceObject (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, const char *refcat, const char *ppSimCommand, const char *injectCommand, psArray *files);
 
+psString ppSimDefineExpname (const char *basename, int nSeq, int nImage);
+psString ppSimDefineFilename (const char *path, const char *expname);
+
 #endif
Index: /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceBias.c
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceBias.c	(revision 43080)
+++ /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceBias.c	(revision 43081)
@@ -15,12 +15,4 @@
     for (int i = 0; i < nImages; i++) {
 	        
-	// 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;
@@ -30,5 +22,10 @@
 	if (setLevel) psStringAppend (&command, " -biaslevel %f", level);
 	if (setRange) psStringAppend (&command, " -biasrange %f", range);
-          
+
+	// define the exposure name and output filename
+	psString expname = ppSimDefineExpname (basename, nSeq, nImage);
+	psString filename = ppSimDefineFilename (path, expname);
+
+	// add output filename to the end of the full command
 	psStringAppend (&command, " %s", filename);
 
@@ -42,9 +39,10 @@
 	for (int i = 0; i < files->n; i++) {
 	    command = psStringCopy (injectCommand);
-            psStringAppend (&command, " %s.%s", filename, (char *) files->data[i]);
+            psStringAppend (&command, " --exp_name %s %s.%s", expname, filename, (char *) files->data[i]);
             fprintf (inject, "%s\n", command);
 	    psFree (command);
 	}
 
+	psFree (expname);
 	psFree (filename);
         nImage ++;
@@ -52,2 +50,22 @@
     return true;
 }
+
+psString ppSimDefineExpname (const char *basename, int nSeq, int nImage) {
+  
+  // define the exposure name
+  psString expname = NULL;
+  psStringAppend (&expname, "%s.%03d.%03d", basename, nSeq, nImage);
+  return expname;
+}
+  
+psString ppSimDefineFilename (const char *path, const char *expname) {
+
+  // define the output filename
+  psString filename = NULL;
+  if (path) {
+    psStringAppend (&filename, "%s/%s", path, expname);
+  } else {
+    psStringAppend (&filename, "%s", expname);
+  }
+  return filename;
+}
Index: /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceDark.c
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceDark.c	(revision 43080)
+++ /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceDark.c	(revision 43081)
@@ -27,12 +27,4 @@
 	for (int j = 0; j < n; j++) {
 
-	    // 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);
-	    }
-
 	    // define the ppSim command
 	    psString command = NULL;
@@ -48,4 +40,9 @@
 	    psStringAppend (&command, " -exptime %f", exptime);
 
+	    // define the exposure name and output filename
+	    psString expname = ppSimDefineExpname (basename, nSeq, nImage);
+	    psString filename = ppSimDefineFilename (path, expname);
+	    
+	    // add output filename to the end of the full command
 	    psStringAppend (&command, " %s", filename);
 
@@ -59,9 +56,10 @@
 	    for (int i = 0; i < files->n; i++) {
 		command = psStringCopy (injectCommand);
-		psStringAppend (&command, " %s.%s", filename, (char *) files->data[i]);
+		psStringAppend (&command, " --exp_name %s %s.%s", expname, filename, (char *) files->data[i]);
 		fprintf (inject, "%s\n", command);
 		psFree (command);
 	    }
 
+	    psFree (expname);
             psFree (filename);
             nImage ++;
Index: /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceFlat.c
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceFlat.c	(revision 43080)
+++ /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceFlat.c	(revision 43081)
@@ -27,19 +27,14 @@
 	for (int j = 0; j < nSetup; j++) {
 	        
-	    // 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 comand
 	    psString command = NULL;
 
 	    psStringAppend (&command, "%s -type FLAT", ppSimCommand);
-
 	    psStringAppend (&command, " -filter %s", (char *) filters->data[i]);
 	    psStringAppend (&command, " -exptime %f", exptimes->data.F32[i]);
+
+	    // define the exposure name and output filename
+	    psString expname = ppSimDefineExpname (basename, nSeq, nImage);
+	    psString filename = ppSimDefineFilename (path, expname);
 
 	    psStringAppend (&command, " %s", filename);
@@ -54,9 +49,10 @@
 	    for (int i = 0; i < files->n; i++) {
 		command = psStringCopy (injectCommand);
-		psStringAppend (&command, " %s.%s", filename, (char *) files->data[i]);
+		psStringAppend (&command, " --exp_name %s %s.%s", expname, filename, (char *) files->data[i]);
 		fprintf (inject, "%s\n", command);
 		psFree (command);
 	    }
 
+	    psFree (expname);
             psFree (filename);
             nImage ++;
Index: /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceObject.c
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceObject.c	(revision 43080)
+++ /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceObject.c	(revision 43081)
@@ -79,11 +79,7 @@
 			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 exposure name and output filename
+			    psString expname = ppSimDefineExpname (basename, nSeq, nImage);
+			    psString filename = ppSimDefineFilename (path, expname);
 
 			    // define the ppSim command
@@ -121,9 +117,10 @@
 			    for (int i = 0; i < files->n; i++) {
 				command = psStringCopy (injectCommand);
-				psStringAppend (&command, " %s.%s", filename, (char *) files->data[i]);
+				psStringAppend (&command, " --exp_name %s %s.%s", expname, filename, (char *) files->data[i]);
 				fprintf (inject, "%s\n", command);
 				psFree (command);
 			    }
 
+			    psFree (expname);
 			    psFree (filename);
 			    nImage ++;
