Index: trunk/ippTasks/detrend.process.pro
===================================================================
--- trunk/ippTasks/detrend.process.pro	(revision 8193)
+++ trunk/ippTasks/detrend.process.pro	(revision 8691)
@@ -1,8 +1,15 @@
+## this file contains the tasks for running the detrend processing stage
 
-## this file contains the tasks for running the detrend processing stage
+# query for pending imfiles to process:
+# dettool -raw -simple
+# 1 bias 850131b fpa mc 850131b.fits BIAS r.MP9601 1.656000 5.496118 0.349071 0.000000 1155.934692 107.037283 46.214947 37.160000 105.480000 -133.067001 0.000000
+# this returns many columns for manual operations. we strip all but the first few:
+
+# process a single imfile
+# detrend_process.pl 1 850131b mc bias 850131b.fits 850131b
 
 ## these tasks use the queue DetrendImfilesToProcess
 ## the DetrendImfilesToProcess queue contains:
-## STATE .....
+## STATE DET_ID TYPE EXP_KEY CLASS CLASS_ID URI 
 
 # select images ready for copy 
@@ -10,5 +17,5 @@
 # compare the new list with the ones already selected
 task	       dettool.raw.load
-  command      dettool -raw
+  command      dettool -raw -simple
   host         local
 
@@ -29,5 +36,12 @@
     for i 0 $Nqueue
       queuepop stdout -var line
-      queuepush DetrendImfilesToProcess -uniq -key 1:2:4 "NEW $line"
+      list word -split $line
+      $DET_ID   = $word:0
+      $TYPE     = $word:1
+      $EXP_KEY  = $word:2
+      $CLASS    = $word:3
+      $CLASS_ID = $word:4
+      $URI      = $word:5
+      queuepush DetrendImfilesToProcess -uniq -key 1:3:5 "NEW $DET_ID $TYPE $EXP_KEY $CLASS $CLASS_ID $URI"
     end
 
@@ -70,38 +84,39 @@
 
     strpop line state
-    queuepush DetrendImfilesToProcess -replace -key 0 "RUN $line"
+    queuepush DetrendImfilesToProcess -replace -key 1:3:5 "RUN $line"
+
+    ## the DetrendImfilesToProcess queue contains:
+    # STATE DET_ID TYPE EXP_KEY CLASS CLASS_ID URI 
+    ## NOTE: the queue has the STATE prepended 
+    list word -split $line
+    $DET_ID   = $word:1
+    $TYPE     = $word:2
+    $EXP_KEY  = $word:3
+    $CLASS    = $word:4
+    $CLASS_ID = $word:5
+    $URI      = $word:6
 
     # 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"
-    command ppImage -file $uri $uri_out -recipe PPIMAGE $recipe
+    # ~/ipp/helpers/detrend_process.pl 1 850131b mc bias 850131b.fits 850131b
+    command detrend_process.pl $DET_ID $EXP_KEY $CLASS_ID $TYPE $URI $EXP_KEY
   end
 
   # success
   task.exit 0
-    # XXX need to parse the options to identify the values below (if not part of cmdline?)
-    exec dettool -addprocessed -det_id $det_id -exp_id $exp_id -class_id $class_id -uri $output_uri -procrecipe $recipe
-    queuepush DetrendImfilesToProcess -replace -key 1:2:4 "DONE $options:0"
+    queuepush DetrendImfilesToProcess -replace -key 1:3:5 "DONE $options:0"
   end
 
   # default exit status
   task.exit    default
-    queuepush DetrendImfilesToProcess -replace -key 0 "FAIL $options:0"
+    queuepush DetrendImfilesToProcess -replace -key 1:3:5 "FAIL $options:0"
   end
 
   # operation times out?
   task.exit    timeout
-    queuepush DetrendImfilesToProcess -replace -key 0 "FAIL $options:0"
+    queuepush DetrendImfilesToProcess -replace -key 1:3:5 "FAIL $options:0"
   end
 end
