Index: trunk/ippTasks/detrend.resid.pro
===================================================================
--- trunk/ippTasks/detrend.resid.pro	(revision 9081)
+++ trunk/ippTasks/detrend.resid.pro	(revision 9104)
@@ -15,5 +15,5 @@
 
 queueinit DetrendResidImfiles
-queueinit DetrendResidExp
+queueinit DetrendResidExposures
 if ($?network == 0)
   $network = 1
@@ -65,21 +65,17 @@
 
   # locked list
-  task.exit    1
-    echo       "new.images: exec failure"
-  end
-
-  # default exit status
-  task.exit    default
-    echo       "new.images: unknown exit status: $EXIT"
-  end
-
-  # operation times out?
-  task.exit    timeout
-    echo       "new.images: timeout"
+  # default exit status
+  task.exit    default
+    echo       "detrend.resid: failure"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "detrend.resid: timeout"
   end
 end
 
 # copy new images, sending job to desired host
-task	       dettool.resid.process
+task	       dettool.resid.run
   periods      -poll 0.5
   periods      -exec 5.0
@@ -110,4 +106,5 @@
     $CLASS_ID = $word:4
     $URI_IN   = $word:5
+    $CAMERA   = $word:6
 
     stdout $EXP_KEY.detresid.$DET_ID.$ITER.$CLASS_ID.log
@@ -124,6 +121,6 @@
     options "$line"
     # detrend_create_resid.pl DET_ID ITER EXP_KEY CLASS_ID TYPE (URI-DET) (URL-IN) (EXP_KEY ???)
-    $URL_DET = isp.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.fits
-    # $URL_DET = $CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.fits
+    # $URL_DET = isp.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.fits
+    $URL_DET = $CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.fits
     echo command detrend_create_resid.pl --det_id $DET_ID --iteration $ITER --exp_id $EXP_KEY --class_id $CLASS_ID --det_type $DET_TYPE --detrend $URL_DET --input_uri $URI_IN
     command detrend_create_resid.pl --det_id $DET_ID --iteration $ITER --exp_id $EXP_KEY --class_id $CLASS_ID --det_type $DET_TYPE --detrend $URL_DET --input_uri $URI_IN
@@ -147,5 +144,5 @@
 
 # select images ready for copy 
-# new entries are added to queue DetrendResidExp
+# new entries are added to queue DetrendResidExposures
 # compare the new list with the ones already selected
 task	       dettool.residexp.load
@@ -177,29 +174,25 @@
       $EXP_KEY  = $word:3
       $INCLUDE  = $word:4
-      queuepush DetrendResidExp -uniq -key 1:2:4 "NEW $DET_ID $ITER $DET_TYPE $EXP_KEY $INCLUDE"
+      queuepush DetrendResidExposures -uniq -key 1:2:4 "NEW $DET_ID $ITER $DET_TYPE $EXP_KEY $INCLUDE"
     end
 
     # delete existing entries which are DONE
-    queuedrop DetrendResidExp -key 0 DONE
+    queuedrop DetrendResidExposures -key 0 DONE
   end
 
   # locked list
-  task.exit    1
-    echo       "new.images: exec failure"
-  end
-
-  # default exit status
-  task.exit    default
-    echo       "new.images: unknown exit status: $EXIT"
-  end
-
-  # operation times out?
-  task.exit    timeout
-    echo       "new.images: timeout"
+  # default exit status
+  task.exit    default
+    echo       "detrend.residexp: failure"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "detrend.residexp: timeout"
   end
 end
 
 # copy new images, sending job to desired host
-task	       dettool.residexp.process
+task	       dettool.residexp.run
   periods      -poll 0.5
   periods      -exec 5.0
@@ -207,18 +200,18 @@
 
   task.exec
-    queuesize DetrendResidExp -var N
+    queuesize DetrendResidExposures -var N
     if ($N == 0) break
     if ($network == 0) break
     
-    # look for new images on the internal DetrendResidExp queue
+    # look for new images on the internal DetrendResidExposures queue
     # caution with these 'if' statements: syntax errors 
     # will make the task fail without given a good status
-    queuepop DetrendResidExp -var line -key 0 NEW
+    queuepop DetrendResidExposures -var line -key 0 NEW
     if ("$line" == "NULL") break
 
     strpop line state
-    queuepush DetrendResidExp -replace -key 1:2:4 "RUN $line"
-
-    ## the DetrendResidExp queue contains:
+    queuepush DetrendResidExposures -replace -key 1:2:4 "RUN $line"
+
+    ## the DetrendResidExposures queue contains:
     ## STATE ITER TYPE DET_ID EXP_KEY CLASS_ID URI_IN
     ## NOTE: the queue has the STATE prepended 
@@ -248,15 +241,15 @@
   # success
   task.exit 0
-    queuepush DetrendResidExp -replace -key 1:2:4 "DONE $options:0"
-  end
-
-  # default exit status
-  task.exit    default
-    queuepush DetrendResidExp -replace -key 1:2:4 "FAIL $options:0"
-  end
-
-  # operation times out?
-  task.exit    timeout
-    queuepush DetrendResidExp -replace -key 1:2:4 "TIMEOUT $options:0"
-  end
-end
+    queuepush DetrendResidExposures -replace -key 1:2:4 "DONE $options:0"
+  end
+
+  # default exit status
+  task.exit    default
+    queuepush DetrendResidExposures -replace -key 1:2:4 "FAIL $options:0"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    queuepush DetrendResidExposures -replace -key 1:2:4 "TIMEOUT $options:0"
+  end
+end
