Index: /branches/eam_branch_00/ippTasks/notes.txt
===================================================================
--- /branches/eam_branch_00/ippTasks/notes.txt	(revision 11058)
+++ /branches/eam_branch_00/ippTasks/notes.txt	(revision 11059)
@@ -1,2 +1,24 @@
+
+2007.01.08
+
+  I have updated pantasks to used named tags in named groups to make
+  life much easier when changing the schema of the db tables.  The
+  function ipptool2book convernts the output from an ippTool query in
+  the form of a set of metadata structures (saved in stdout) into a
+  book format.
+
+  dettool -tonormalizedstat     DetrendNormStat
+  dettool -tonormalize          DetrendNorm
+  dettool -tonormalizedexp      DetrendNormExp
+  dettool -toprocessedimfile    DetrendProcessImfiles
+  dettool -toprocessedexp       DetrendProcessExposures
+  dettool -residdetrun          DetrendRejectExp
+  dettool -toresidimfile        DetrendResidImfiles
+  dettool -toresidexp           DetrendResidExposures
+  dettool -tostacked            DetrendStackClass
+  p0tool -pendingimfile         Phase0Imfiles
+  p0tool -pendingexp            Phase0Exposures
+  p2tool -pendingimfile         Phase2Imfiles
+  p3tool -pendingexp            Phase3Exposures
 
 2006.08.28
Index: /branches/eam_branch_00/ippTasks/pantasks.pro
===================================================================
--- /branches/eam_branch_00/ippTasks/pantasks.pro	(revision 11058)
+++ /branches/eam_branch_00/ippTasks/pantasks.pro	(revision 11059)
@@ -17,4 +17,11 @@
 $runpoll = 0.5
 $runexec = 1
+
+$EXIT_SUCCESS     = 0
+$EXIT_UNKNOWN_ERR = 1
+$EXIT_SYS_ERR     = 2
+$EXIT_CONFIG_ERR  = 3
+$EXIT_PROG_ERR    = 4
+$EXIT_DATA_ERR    = 5
 
 macro init.simtest
@@ -86,4 +93,6 @@
     if ($0 == 2)
       echo "$1 for: $command"
+      echo "job exit status: $JOB_STATUS"
+      echo "job dtime: $JOB_DTIME"
     else
       echo "command: $command"
Index: /branches/eam_branch_00/ippTasks/phase0.pro
===================================================================
--- /branches/eam_branch_00/ippTasks/phase0.pro	(revision 11058)
+++ /branches/eam_branch_00/ippTasks/phase0.pro	(revision 11059)
@@ -38,5 +38,6 @@
   periods      -timeout 30
 
-  stdout $LOGSUBDIR/phase0.imfile.log
+  # XXX provide a special word (ie NULL) that silently drops stdout, stderr?
+  stdout NULL
   stderr $LOGSUBDIR/phase0.imfile.log
 
@@ -46,5 +47,5 @@
 
   # success
-  task.exit    0
+  task.exit    $EXIT_SUCCESS
     # convert 'stdout' to book format
     ipptool2book stdout Phase0Imfiles -key exp_tag -uniq
@@ -55,4 +56,5 @@
     # delete existing entries which are DONE
     book delpage Phase0Imfiles -key state DONE
+    echo "p0tool -pendingimfile dtime: $JOB_DTIME"
   end
 
@@ -84,5 +86,8 @@
 
     book setword Phase0Imfiles $pageName state RUN
+    # Phase0Imfiles->pageName->state = RUN
+
     book getword Phase0Imfiles $pageName exp_tag -var EXP_TAG
+    # $EXP_TAG = Phase0Imfiles->pageName->exp_tag
     book getword Phase0Imfiles $pageName class -var CLASS
     book getword Phase0Imfiles $pageName class_id -var CLASS_ID
@@ -118,4 +123,5 @@
     # phase0_imfile.pl updates DB tables, here we just update the page
     book setword Phase0Imfiles $options:0 state DONE
+    # equiv to: Phase0Imfiles->pageName->state = DONE
   end
 
@@ -158,4 +164,5 @@
     # delete existing entries which are DONE
     book delpage Phase0Exposures -key state DONE
+    echo "p0tool -pendingexp dtime: $JOB_DTIME"
   end
 
@@ -222,5 +229,5 @@
   # default exit status
   task.exit    default
-    showcommand
+    showcommand failure
     book setword Phase0Exposures $options:0 state FAIL
   end
@@ -228,5 +235,5 @@
   # operation times out?
   task.exit    timeout
-    showcommand
+    showcommand timeout
     book setword Phase0Exposures $options:0 state TIMEOUT
   end
Index: /branches/eam_branch_00/ippTasks/phase2.pro
===================================================================
--- /branches/eam_branch_00/ippTasks/phase2.pro	(revision 11058)
+++ /branches/eam_branch_00/ippTasks/phase2.pro	(revision 11059)
@@ -1,4 +1,4 @@
 ## this file contains the tasks for running the phase 0 stage
-## these tasks use the book p2PendingImfile
+## these tasks use the book Phase2Imfiles
 
 if ($?network == 0)
@@ -20,12 +20,12 @@
 exec mkdir -p $LOGSUBDIR
 
-book init p2PendingImfile
+book init Phase2Imfiles
 
 macro phase2.status
-  book listbook p2PendingImfile
+  book listbook Phase2Imfiles
 end
 
 # select images ready for phase2 analysis
-# new entries are added to p2PendingImfile
+# new entries are added to Phase2Imfiles
 # skip already-present entries
 task	       phase2.imfile.load
@@ -46,11 +46,11 @@
   task.exit    0
     # convert 'stdout' to book format
-    ipptool2book stdout p2PendingImfile -key exp_tag:class_id -uniq
+    ipptool2book stdout Phase2Imfiles -key exp_tag:class_id -uniq
     if ($VERBOSE > 2)
-      book listbook p2PendingImfile
+      book listbook Phase2Imfiles
     end
 
     # delete existing entries which are DONE
-    book delpage p2PendingImfile -key state DONE
+    book delpage Phase2Imfiles -key state DONE
   end
 
@@ -73,17 +73,17 @@
 
   task.exec
-    book npages p2PendingImfile -var N
+    book npages Phase2Imfiles -var N
     if ($N == 0) break
     if ($network == 0) break
     
-    # look for new images in p2PendingImfile (state == NULL)
-    book getpage p2PendingImfile 0 -var pageName -key state NULL
+    # look for new images in Phase2Imfiles (state == NULL)
+    book getpage Phase2Imfiles 0 -var pageName -key state NULL
     if ($pageName == NULL) break
 
-    book setword p2PendingImfile $pageName state RUN
-    book getword p2PendingImfile $pageName camera -var CAMERA
-    book getword p2PendingImfile $pageName exp_tag -var EXP_TAG
-    book getword p2PendingImfile $pageName class_id -var CLASS_ID
-    book getword p2PendingImfile $pageName uri -var URI
+    book setword Phase2Imfiles $pageName state RUN
+    book getword Phase2Imfiles $pageName camera -var CAMERA
+    book getword Phase2Imfiles $pageName exp_tag -var EXP_TAG
+    book getword Phase2Imfiles $pageName class_id -var CLASS_ID
+    book getword Phase2Imfiles $pageName uri -var URI
 
     # specify choice of remote host
@@ -118,5 +118,5 @@
   task.exit 0
     # phase2.pl updates DB tables, here we just update the page
-    book setword p2PendingImfile $options:0 state DONE
+    book setword Phase2Imfiles $options:0 state DONE
   end
 
@@ -124,5 +124,5 @@
   task.exit    default
     showcommand failure
-    book setword p2PendingImfile $options:0 state FAIL
+    book setword Phase2Imfiles $options:0 state FAIL
   end
 
@@ -130,5 +130,5 @@
   task.exit    timeout
     showcommand timeout
-    book setword p2PendingImfile $options:0 state TIMEOUT
+    book setword Phase2Imfiles $options:0 state TIMEOUT
   end
 end
