Index: branches/tap_branches/ppStack/src/ppStackCombinePrepare.c
===================================================================
--- branches/tap_branches/ppStack/src/ppStackCombinePrepare.c	(revision 25900)
+++ branches/tap_branches/ppStack/src/ppStackCombinePrepare.c	(revision 27838)
@@ -10,5 +10,7 @@
 #include "ppStackLoop.h"
 
-bool ppStackCombinePrepare(ppStackThreadData *stack, ppStackOptions *options, pmConfig *config)
+bool ppStackCombinePrepare(const char *outName, const char *expName,
+                           ppStackFileList files, ppStackThreadData *stack,
+                           ppStackOptions *options, pmConfig *config)
 {
     psAssert(stack, "Require stack");
@@ -20,10 +22,10 @@
     ppStackThread *thread = stack->threads->data[0]; // Representative thread
     if (!pmReadoutStackSetOutputSize(&col0, &row0, &numCols, &numRows, thread->readouts)) {
-        psError(PS_ERR_UNKNOWN, false, "problem setting output readout size.");
+        psError(PPSTACK_ERR_ARGUMENTS, false, "problem setting output readout size.");
         return false;
     }
 
     pmFPAfileActivate(config->files, false, NULL);
-    ppStackFileActivation(config, PPSTACK_FILES_COMBINE, true);
+    ppStackFileActivation(config, files, true);
     pmFPAview *view = ppStackFilesIterateDown(config); // View to readout
     if (!view) {
@@ -31,6 +33,10 @@
     }
 
-    pmCell *outCell = pmFPAfileThisCell(config->files, view, "PPSTACK.OUTPUT"); // Output cell
-    options->outRO = pmReadoutAlloc(outCell); // Output readout
+    pmCell *cell = pmFPAfileThisCell(config->files, view, outName); // Output cell
+    options->outRO = pmReadoutAlloc(cell); // Output readout
+
+    pmCell *expCell = pmFPAfileThisCell(config->files, view, expName); // Exposure cell
+    options->expRO = pmReadoutAlloc(expCell); // Output readout
+
     psFree(view);
 
@@ -39,6 +45,12 @@
     psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits to mask for bad
     psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
+
     if (!pmReadoutStackDefineOutput(options->outRO, col0, row0, numCols, numRows, true, true, maskBad)) {
-        psError(PS_ERR_UNKNOWN, false, "Unable to prepare output.");
+        psError(PPSTACK_ERR_ARGUMENTS, false, "Unable to prepare output.");
+        return false;
+    }
+
+    if (!pmReadoutStackDefineOutput(options->expRO, col0, row0, numCols, numRows, true, true, 0)) {
+        psError(PPSTACK_ERR_ARGUMENTS, false, "Unable to prepare output.");
         return false;
     }
