Index: trunk/ippTasks/detrend.process.pro
===================================================================
--- trunk/ippTasks/detrend.process.pro	(revision 10455)
+++ trunk/ippTasks/detrend.process.pro	(revision 10542)
@@ -54,5 +54,6 @@
       $CLASS_ID = $word:4
       $URI      = $word:5
-      queuepush DetrendProcessImfiles -uniq -key 1:3:5 "NEW $DET_ID $DET_TYPE $EXP_TAG $CLASS $CLASS_ID $URI"
+      $CAMERA   = $word:21
+      queuepush DetrendProcessImfiles -uniq -key 1:3:5 "NEW $DET_ID $DET_TYPE $EXP_TAG $CLASS $CLASS_ID $URI $CAMERA"
     end
 
@@ -102,4 +103,5 @@
     $CLASS_ID = $word:4
     $URI      = $word:5
+    $CAMERA   = $word:6
 
     $LOG_DIR = `dirname $URI`
@@ -116,6 +118,6 @@
     # create example job options as a demonstration
     options "$line"
-    echo command detrend_process_imfile.pl --det_id $DET_ID --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --det_type $DET_TYPE --input_uri $URI
-    command detrend_process_imfile.pl --det_id $DET_ID --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --det_type $DET_TYPE --input_uri $URI
+    echo command detrend_process_imfile.pl --det_id $DET_ID --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --input_uri $URI --camera $CAMERA
+    command detrend_process_imfile.pl --det_id $DET_ID --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --det_type $DET_TYPE --input_uri $URI --camera $CAMERA
   end
 
@@ -123,5 +125,5 @@
   task.exit 0
     queuepush DetrendProcessImfiles -replace -key 1:3:5 "DONE $options:0"
-    # detrend_process_imfile.pl --force_exist --det_id $DET_ID --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --det_type $DET_TYPE --input_uri $URI
+    # detrend_process_imfile.pl --force_exist --det_id $DET_ID --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --det_type $DET_TYPE --input_uri $URI --camera $CAMERA
   end
 
@@ -169,5 +171,6 @@
       $DET_TYPE = $word:2
       $EXP_TAG  = $word:3
-      queuepush DetrendProcessExposures -uniq -key 1:2:4 "NEW $DET_ID $ITER $DET_TYPE $EXP_TAG"
+      $CAMERA   = $word:4
+      queuepush DetrendProcessExposures -uniq -key 1:2:4 "NEW $DET_ID $ITER $DET_TYPE $EXP_TAG $CAMERA"
     end
 
@@ -213,4 +216,5 @@
     $DET_TYPE = $word:2
     $EXP_TAG  = $word:3
+    $CAMERA   = $word:4
 
     # XXX need the classID in dettool -toprocessedexp -simple output
@@ -228,6 +232,6 @@
     # create example job options as a demonstration
     options "$line"
-    echo command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG
-    command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG
+    echo command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA
+    command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA
   end
 
Index: trunk/ippTasks/detrend.reject.pro
===================================================================
--- trunk/ippTasks/detrend.reject.pro	(revision 10455)
+++ trunk/ippTasks/detrend.reject.pro	(revision 10542)
@@ -48,6 +48,7 @@
       $ITER     = $word:1
       $DET_TYPE = $word:2
-      $CAMERA   = $word:3
-      queuepush DetrendRejectExposure -uniq -key 1:2 "NEW $DET_ID $ITER $DET_TYPE $CAMERA"
+      $MODE     = $word:3
+      $CAMERA   = $word:4
+      queuepush DetrendRejectExposure -uniq -key 1:2 "NEW $DET_ID $ITER $DET_TYPE $MODE $CAMERA"
     end
 
Index: trunk/ippTasks/detrend.resid.pro
===================================================================
--- trunk/ippTasks/detrend.resid.pro	(revision 10455)
+++ trunk/ippTasks/detrend.resid.pro	(revision 10542)
@@ -49,14 +49,16 @@
       queuepop stdout -var line
       list word -split $line
-      $ITER     = $word:0
-      $DET_TYPE = $word:1
-      $DET_ID   = $word:2
-      $EXP_TAG  = $word:3
-      $CLASS_ID = $word:4
-      $URI_IN   = $word:5
-      $CAMERA   = $word:13
+      $DET_ID   = $word:0
+      $ITER     = $word:1
+      $DET_TYPE = $word:2
+      $MODE     = $word:3
+      $EXP_TAG  = $word:4
+      $CLASS_ID = $word:5
+      $URI      = $word:6
+      $DET_URI  = $word:7
+      $CAMERA   = $word:8
       ## must include the detID and iter in the key (if we have two running at the same time...)
       ## Also needed to be in the output file (or path)
-      queuepush DetrendResidImfiles -uniq -key 1:3:4:5 "NEW $ITER $DET_TYPE $DET_ID $EXP_TAG $CLASS_ID $URI_IN $CAMERA"
+      queuepush DetrendResidImfiles -uniq -key 1:2:5:6 "NEW $DET_ID $ITER $DET_TYPE $MODE $EXP_TAG $CLASS_ID $URI $DET_URI $CAMERA"
     end
 
@@ -95,5 +97,5 @@
 
     strpop line state
-    queuepush DetrendResidImfiles -replace -key 1:3:4:5 "RUN $line"
+    queuepush DetrendResidImfiles -replace -key 1:2:5:6 "RUN $line"
 
     ## the DetrendResidImfiles queue contains:
@@ -101,11 +103,13 @@
     ## NOTE: the queue has the STATE prepended 
     list word -split $line
-    $ITER     = $word:0
-    $DET_TYPE = $word:1
-    $DET_ID   = $word:2
-    $EXP_TAG  = $word:3
-    $CLASS_ID = $word:4
-    $URI_IN   = $word:5
-    $CAMERA   = $word:6
+    $DET_ID   = $word:0
+    $ITER     = $word:1
+    $DET_TYPE = $word:2
+    $MODE     = $word:3
+    $EXP_TAG  = $word:4
+    $CLASS_ID = $word:5
+    $URI      = $word:6
+    $DET_URI  = $word:7
+    $CAMERA   = $word:8
 
     $DET_DIR = `dirname $URI_IN`
@@ -127,21 +131,21 @@
     # need to parse the subdir path for the detrend URL
     $DET_URL = $DET_DIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.fits
-    echo command detrend_resid.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URL --input_uri $URI_IN
-    command detrend_resid.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URL --input_uri $URI_IN
+    echo command detrend_resid.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URL --input_uri $URI_IN --camera $CAMERA
+    command detrend_resid.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URL --input_uri $URI_IN --camera $CAMERA
   end
 
   # success
   task.exit 0
-    queuepush DetrendResidImfiles -replace -key 1:3:4:5 "DONE $options:0"
-  end
-
-  # default exit status
-  task.exit    default
-    queuepush DetrendResidImfiles -replace -key 1:3:4:5 "FAIL $options:0"
-  end
-
-  # operation times out?
-  task.exit    timeout
-    queuepush DetrendResidImfiles -replace -key 1:3:4:5 "TIMEOUT $options:0"
+    queuepush DetrendResidImfiles -replace -key 1:2:5:6 "DONE $options:0"
+  end
+
+  # default exit status
+  task.exit    default
+    queuepush DetrendResidImfiles -replace -key 1:2:5:6 "FAIL $options:0"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    queuepush DetrendResidImfiles -replace -key 1:2:6:6 "TIMEOUT $options:0"
   end
 end
@@ -176,8 +180,9 @@
       $ITER     = $word:1
       $DET_TYPE = $word:2
-      $EXP_TAG  = $word:3
-      $INCLUDE  = $word:4
-      $CAMERA   = $word:5
-      queuepush DetrendResidExposures -uniq -key 1:2:4 "NEW $DET_ID $ITER $DET_TYPE $EXP_TAG $INCLUDE $CAMERA"
+      $MODE     = $word:3
+      $EXP_TAG  = $word:4
+      $INCLUDE  = $word:5
+      $CAMERA   = $word:6
+      queuepush DetrendResidExposures -uniq -key 1:2:5 "NEW $DET_ID $ITER $DET_TYPE $MODE $EXP_TAG $INCLUDE $CAMERA"
     end
 
@@ -216,5 +221,5 @@
 
     strpop line state
-    queuepush DetrendResidExposures -replace -key 1:2:4 "RUN $line"
+    queuepush DetrendResidExposures -replace -key 1:2:5 "RUN $line"
 
     ## the DetrendResidExposures queue contains:
@@ -225,7 +230,8 @@
     $ITER     = $word:1
     $DET_TYPE = $word:2
-    $EXP_TAG  = $word:3
-    $INCLUDE  = $word:4
-    $CAMERA   = $word:5
+    $MODE     = $word:3
+    $EXP_TAG  = $word:4
+    $INCLUDE  = $word:5
+    $CAMERA   = $word:6
 
     # XXX add $WORKDIR/$LOG_DIR
@@ -240,37 +246,23 @@
     end
 
-    ### XXX artificially reject a few randomly
-    if ($ITER == 0)
-      $drop = (rnd(0) < 0.33)
-    else
-      $drop = ("$INCLUDE" == "F")
-    end
-    ### XXX no artificial rejections
-    $drop = 0
-
     # create example job options as a demonstration
     options "$line"
-    if ($drop) 
-      echo command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA --reject
-      command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA --reject
-    else 
-      echo command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA
-      command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA
-    end
+    echo command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA
+    command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA
   end
 
   # success
   task.exit 0
-    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
+    queuepush DetrendResidExposures -replace -key 1:2:5 "DONE $options:0"
+  end
+
+  # default exit status
+  task.exit    default
+    queuepush DetrendResidExposures -replace -key 1:2:5 "FAIL $options:0"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    queuepush DetrendResidExposures -replace -key 1:2:5 "TIMEOUT $options:0"
+  end
+end
Index: trunk/ippTasks/phase0.pro
===================================================================
--- trunk/ippTasks/phase0.pro	(revision 10455)
+++ trunk/ippTasks/phase0.pro	(revision 10542)
@@ -104,6 +104,6 @@
     # create the command line
     options "$line"
-    echo command phase0_imfile.pl --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --uri $URI
-    command phase0_imfile.pl --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --uri $URI
+    echo command phase0_imfile.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI
+    command phase0_imfile.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI
   end
 
@@ -159,6 +159,7 @@
       # $CAMERA    = $word:2
       # $TELESCOPE = $word:3
-      # $TYPE      = $word:4
-      # $IMFILES   = $word:5
+      # $DATEOBS   = $word:4
+      # $TYPE      = $word:5
+      # $IMFILES   = $word:6
       queuepush Phase0Exposures -uniq -key 1 "NEW $EXP_TAG"
     end
