Index: branches/eam_branch_00/ippTasks/detrend.stack.pro
===================================================================
--- branches/eam_branch_00/ippTasks/detrend.stack.pro	(revision 11019)
+++ branches/eam_branch_00/ippTasks/detrend.stack.pro	(revision 11109)
@@ -1,3 +1,4 @@
 ## this file contains the tasks for running the detrend stacking stage
+## these tasks use the book detPendingStackedImfile
 
 if ($?network == 0)
@@ -19,12 +20,12 @@
 exec mkdir -p $LOGSUBDIR
 
-book init DetrendStackClass
+book init detPendingStackedImfile
 
 macro detstack.status
-  book listbook DetrendStackClass
+  book listbook detPendingStackedImfile
 end
 
 # select images ready for detrend_stack.pl
-# new entries are added to DetrendStackClass
+# new entries are added to detPendingStackedImfile
 # compare the new list with the ones already selected
 task	       dettool.stack.load
@@ -35,5 +36,5 @@
   periods      -timeout 30
 
-  stdout $LOGSUBDIR/detstack.log
+  stdout NULL
   stderr $LOGSUBDIR/detstack.log
 
@@ -45,11 +46,11 @@
   task.exit    0
     # convert 'stdout' to book format
-    ipptool2book stdout DetrendStackClass -key det_id:iteration:class_id -uniq
+    ipptool2book stdout detPendingStackedImfile -key det_id:iteration:class_id -uniq
     if ($VERBOSE > 2)
-      book listbook DetrendStackClass
+      book listbook detPendingStackedImfile
     end
 
     # delete existing entries which are DONE
-    book delpage DetrendStackClass -key state DONE
+    book delpage detPendingStackedImfile -key state DONE
   end
 
@@ -72,18 +73,18 @@
 
   task.exec
-    book npages DetrendStackClass -var N
+    book npages detPendingStackedImfile -var N
     if ($N == 0) break
     if ($network == 0) break
     
-    # look for new images in DetrendStackClass
-    book getpage DetrendStackClass 0 -var pageName -key state NULL
+    # look for new images in detPendingStackedImfile
+    book getpage detPendingStackedImfile 0 -var pageName -key state NULL
     if ($pageName == NULL) break
 
-    book setword DetrendStackClass $pageName state RUN
-    book getword DetrendStackClass $pageName det_id    -var DET_ID
-    book getword DetrendStackClass $pageName iteration -var ITERATION
-    book getword DetrendStackClass $pageName det_type  -var DET_TYPE
-    book getword DetrendStackClass $pageName class_id  -var CLASS_ID
-    book getword DetrendStackClass $pageName camera    -var CAMERA  
+    book setword detPendingStackedImfile $pageName state RUN
+    book getword detPendingStackedImfile $pageName det_id    -var DET_ID
+    book getword detPendingStackedImfile $pageName iteration -var ITERATION
+    book getword detPendingStackedImfile $pageName det_type  -var DET_TYPE
+    book getword detPendingStackedImfile $pageName class_id  -var CLASS_ID
+    book getword detPendingStackedImfile $pageName camera    -var CAMERA  
 
     # specify choice of remote host:
@@ -95,4 +96,5 @@
 
     # XXX add $WORKDIR/$LOG_DIR
+    # XXX use ipp_filename.pl to lookup output file names
     stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.$CLASS_ID.log
     stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.$CLASS_ID.log
@@ -108,13 +110,7 @@
   end
 
-  # success
-  task.exit 0
-    book setword DetrendStackClass $options:0 state DONE
-  end
-
   # default exit status
   task.exit    default
-    showcommand failure
-    book setword DetrendStackClass $options:0 state FAIL
+    process_exit detPendingStackedImfile $options:0 $JOB_STATUS
   end
 
@@ -122,5 +118,5 @@
   task.exit    timeout
     showcommand timeout
-    book setword DetrendStackClass $options:0 state TIMEOUT
+    book setword detPendingStackedImfile $options:0 state TIMEOUT
   end
 end
