Index: trunk/ippTasks/detrend.assess.pro
===================================================================
--- trunk/ippTasks/detrend.assess.pro	(revision 8193)
+++ trunk/ippTasks/detrend.assess.pro	(revision 8691)
@@ -1,12 +1,21 @@
 
-## this file contains the tasks for running the detrend normalization stage
+## this file contains the tasks for running the detrend processing stage
 
-## these tasks use the queue DetrendRunToAssess
+# dettool -toresidexp -simple
+# 1      0    bias 850131b T
+# DET_ID ITER TYPE EXP_KEY INCLUDE         
+
+# detrend_reject_imfile.pl 1      0    850131b bias
+# detrend_reject_imfile.pl DET_ID ITER EXP_KEY TYPE
+
+## these tasks use the queue DetrendResidExp
+## the DetrendResidExp queue contains:
+## STATE DET_ID ITER TYPE EXP_KEY INCLUDE
 
 # select images ready for copy 
-# new entries are added to queue DetrendRunToAssess
+# new entries are added to queue DetrendResidExp
 # compare the new list with the ones already selected
 task	       dettool.assess.load
-  command      dettool -stacked -runs
+  command      dettool -toresidexp -simple
   host         local
 
@@ -17,6 +26,4 @@
   # success
   task.exit    0
-    # XXX is it necessary for these to be local?
-    # drop after this task macro is done?
     local i Nqueue
 
@@ -26,9 +33,15 @@
     for i 0 $Nqueue
       queuepop stdout -var line
-      queuepush DetrendRunToAssess -uniq -key 1:2:4 "NEW $line"
+      list word -split $line
+      $DET_ID   = $word:0
+      $ITER     = $word:1
+      $TYPE     = $word:2
+      $EXP_KEY  = $word:3
+      $INCLUDE  = $word:4
+      queuepush DetrendResidExp -uniq -key 1:2:4 "NEW $DET_ID $ITER $TYPE $EXP_KEY $INCLUDE"
     end
 
     # delete existing entries which are DONE
-    queuedrop DetrendRunToAssess -key 0 DONE
+    queuedrop DetrendResidExp -key 0 DONE
   end
 
@@ -50,5 +63,5 @@
 
 # copy new images, sending job to desired host
-task	       dettool.assess.process
+task	       dettool.resid.process
   periods      -poll 0.5
   periods      -exec 1.0
@@ -56,55 +69,50 @@
 
   task.exec
-    queuesize DetrendRunToAssess -var N
-   
+    queuesize DetrendResidExp -var N
     if ($N == 0) break
     if ($network == 0) break
     
-    # look for new images on the internal DetrendRunToAssess queue
+    # look for new images on the internal DetrendResidExp queue
     # caution with these 'if' statements: syntax errors 
     # will make the task fail without given a good status
-    queuepop DetrendRunToAssess -var line -key 0 NEW
+    queuepop DetrendResidExp -var line -key 0 NEW
     if ("$line" == "NULL") break
 
     strpop line state
-    queuepush DetrendRunToAssess -replace -key 0 "RUN $line"
+    queuepush DetrendResidExp -replace -key 1:2:4 "RUN $line"
+
+    ## the DetrendResidExp queue contains:
+    ## STATE DET_ID ITER TYPE EXP_KEY INCLUDE
+    ## NOTE: the queue has the STATE prepended 
+    list word -split $line
+    $DET_ID   = $word:1
+    $ITER     = $word:2
+    $TYPE     = $word:3
+    $EXP_KEY  = $word:4
+    $INCLUDE  = $word:5
 
     # specify choice of remote host:
-    # 'anyhost' specified random remote host
-    # if we needed to specify a host explicitly, use a command like
-    # one of the following.  the -required forces execution on the
-    # named host, and blocks the task until the host is available
-    # host kiawe
-    # host alala -required 
     host anyhost
-
-    # choose the default recipe appropriate to this type of file
-    $recipe = `get.recipe $type`
 
     # create example job options as a demonstration
     options "$line"
-
-    # we can put the dettool and ppMerge commands here, or wrap them in a single script
-    # $urilist = `dettool -stacked -det_id $det_id -iteration $iteration -chip"
-    # $uri_out = ???
-    # command ppNorm $uri_out $uri $uri ... -recipe PPMERGE $recipe ???
-    command ASSESS?? $uri_out -det_id $det_id -iteration $iteration -recipe PPMERGE $recipe
+    # detrend_reject_imfile.pl 1      0    850131b bias
+    # detrend_reject_imfile.pl DET_ID ITER EXP_KEY TYPE
+    command detrend_reject_imfile.pl $DET_ID $ITER $EXP_KEY $TYPE
   end
 
   # success
   task.exit 0
-    # XXX need to parse the options to identify the values below (if not part of cmdline?)
-    exec dettool -addstacked -det_id $det_id -iteration $iteration -class_id $class_id -procrecipe $recipe
-    queuepush DetrendRunToAssess -replace -key 1:2:4 "DONE $options:0"
+    queuepush DetrendResidExp -replace -key 1:2:4 "DONE $options:0"
   end
 
   # default exit status
   task.exit    default
-    queuepush DetrendRunToAssess -replace -key 0 "FAIL $options:0"
+    queuepush DetrendResidExp -replace -key 1:2:4 "FAIL $options:0"
   end
 
   # operation times out?
   task.exit    timeout
-    queuepush DetrendRunToAssess -replace -key 0 "FAIL $options:0"
+    queuepush DetrendResidExp -replace -key 1:2:4 "FAIL $options:0"
   end
 end
