Index: trunk/ippTools/doc/p0tools.sh
===================================================================
--- trunk/ippTools/doc/p0tools.sh	(revision 6022)
+++ trunk/ippTools/doc/p0tools.sh	(revision 6022)
@@ -0,0 +1,71 @@
+
+## PanTasks scripts for Phase 0
+
+# tasks: p0ready p0update p0cleanup
+#
+# queues: 
+#   p0pending: (expID) (cameraID) (state)
+#
+# globals: 
+
+# p0pending : search for images to be processed
+task	       p0pending
+  command      p0search -pending
+  host         local
+
+  # timeout shorter than exec so jobs do not build up
+  periods      -exec     5
+  periods      -poll     1
+  periods      -timeout  4
+
+  # success
+  task.exit    0
+    local i Nstdout
+    # keep only new, unique entries (URL is key)
+    queuesize stdout -var Nstdout
+    for i 0 $Nstdout
+      queuepop stdout -var line
+      queuepush p0pending -uniq -key 0 "$line new"
+    end
+  end
+end
+
+# p0update : submit an exposure to be updated
+task	       p0update
+  periods      -exec 1
+  periods      -timeout 10
+
+  task.exec
+    local Npending
+    queuesize  p0pending -var Npending
+    if ($Npending == 0) break
+
+    queuepop p0pending -var line -key 2 new
+    if ("$line" == "NULL") break
+
+    list tmp -split $line
+    $expID  = $tmp:0
+    $camera = $tmp:1
+    queuepush p0pending "$expID $camera run"
+
+    host any
+    command p0search -update $expID $camera
+  end
+
+  # success
+  task.exit    0
+    queueinit stdout
+    queuepush p0pending $taskargs:0 $taskargs:1 done
+  end
+end
+
+# p0update : search for images to be processed
+task	       p0cleanup
+  command      p0search -cleanup
+  host         local
+
+  # timeout shorter than exec so jobs do not build up
+  periods      -exec     30
+  periods      -poll     1
+  periods      -timeout  10
+end
Index: trunk/ippTools/doc/p0tools.txt
===================================================================
--- trunk/ippTools/doc/p0tools.txt	(revision 6021)
+++ trunk/ippTools/doc/p0tools.txt	(revision 6022)
@@ -2,9 +2,10 @@
 Phase 0 pipeline tools:
 
-p0search -ready :
-  * examine the new.imfiles,new.exposures tables and select exposures ready for analysi
+p0search -pending :
+  * examine the new.imfiles,new.exposures tables and select exposures ready for analysis
+  * output is: (expID) (camera)
 
-p0search -update :
-  * select a specified image in the new.imfiles/new.exposures table
+p0search -update (expID) (camera):
+  * select a the corresponding images from the new.imfiles/new.exposures table
   * extract the specified header information
   * search the summit metadata db tables
@@ -16,5 +17,5 @@
     * add an entry to the p2.pending table (single)
 
-p0search -stats :
+p0search -stats (expID) (camera):
   * select a specified image in the new.imfiles/new.exposures table
   * extract the specified header information
@@ -23,5 +24,5 @@
   [-update without output to MDDB]
 
-p0search -mkraw :
+p0search -mkraw (expID) (camera):
   * select a specified image in the new.imfiles/new.exposures table
   * extract the specified header information
@@ -33,2 +34,7 @@
   * remove completed entries from the new.imfiles,new.exposure tables
 
+** note : the division of -pending and -update allows separate processes
+   to be examining the image headers and measuring some stats.  these
+   jobs can be run via pcontrol to reduce the load on the PanTasks
+   machines
+
Index: trunk/ippTools/doc/p1tools.sh
===================================================================
--- trunk/ippTools/doc/p1tools.sh	(revision 6022)
+++ trunk/ippTools/doc/p1tools.sh	(revision 6022)
@@ -0,0 +1,72 @@
+
+## PanTasks scripts for Phase 1
+
+# tasks: p1pending p1astro p1done
+#
+# queues: 
+#   p1pending: (expID) (version) (cameraID) (state)
+#
+# globals: 
+
+# p1pending : search for images to be processed
+task	       p1pending
+  command      p1search -pending
+  host         local
+
+  # timeout shorter than exec so jobs do not build up
+  periods      -exec     5
+  periods      -poll     1
+  periods      -timeout  4
+
+  # success
+  task.exit    0
+    local i Nstdout
+    # keep only new, unique entries (URL is key)
+    queuesize stdout -var Nstdout
+    for i 0 $Nstdout
+      queuepop stdout -var line
+      queuepush p1pending -uniq -key 0 "$line new"
+    end
+  end
+end
+
+# p1update : submit an exposure to be updated
+task	       p1astro
+  periods      -exec 1
+  periods      -timeout 10
+
+  task.exec
+    local expID version camera Npending
+    queuesize  p1pending -var Npending
+    if ($Npending == 0) break
+
+    queuepop p1pending -var line -key 2 new
+    if ("$line" == "NULL") break
+
+    list tmp -split $line
+    $expID  = $tmp:0
+    $version = $tmp:1
+    $camera = $tmp:2
+    queuepush p1pending "$expID $version $camera run"
+
+    host any
+    command p1astro $expID $version $camera
+  end
+
+  # success
+  task.exit    0
+    queueinit stdout
+    queuepush p1pending $taskargs:0 $taskargs:1 $taskargs:2 done
+  end
+end
+
+# p1update : search for images to be processed
+task	       p1done
+  command      p1search -done
+  host         local
+
+  # timeout shorter than exec so jobs do not build up
+  periods      -exec     30
+  periods      -poll     1
+  periods      -timeout  10
+end
Index: trunk/ippTools/doc/p1tools.txt
===================================================================
--- trunk/ippTools/doc/p1tools.txt	(revision 6021)
+++ trunk/ippTools/doc/p1tools.txt	(revision 6022)
@@ -2,5 +2,5 @@
 Phase 1 pipeline tools:
 
-p1search -insert ? :
+p1search -define [constraints]:
   * examine the raw.exposures tables and select exposures matching the given criteria
   * add entries which are allowed (mosaic) to the p1.pending table
@@ -8,7 +8,8 @@
 p1search -pending :
   * examine the p1.pending table and select exposures waiting for p1
-  * output the list for p1.tasks
+  * output: lines consisting of:
+    (expID) (p1version) (camera)
 
-p1search -update :
+p1search -done :
   * select completed entries in the p1.pending table
   * move to the p1.done table
Index: trunk/ippTools/doc/p3tools.sh
===================================================================
--- trunk/ippTools/doc/p3tools.sh	(revision 6022)
+++ trunk/ippTools/doc/p3tools.sh	(revision 6022)
@@ -0,0 +1,72 @@
+
+## PanTasks scripts for Phase 3
+
+# tasks: p3pending p3astro p3done
+#
+# queues: 
+#   p3pending: (expID) (version) (cameraID) (state)
+#
+# globals: 
+
+# p3pending : search for images to be processed
+task	       p3pending
+  command      p3search -pending
+  host         local
+
+  # timeout shorter than exec so jobs do not build up
+  periods      -exec     5
+  periods      -poll     1
+  periods      -timeout  4
+
+  # success
+  task.exit    0
+    local i Nstdout
+    # keep only new, unique entries (URL is key)
+    queuesize stdout -var Nstdout
+    for i 0 $Nstdout
+      queuepop stdout -var line
+      queuepush p3pending -uniq -key 0 "$line new"
+    end
+  end
+end
+
+# p3update : submit an exposure to be updated
+task	       p3astro
+  periods      -exec 1
+  periods      -timeout 10
+
+  task.exec
+    local expID version camera Npending
+    queuesize  p3pending -var Npending
+    if ($Npending == 0) break
+
+    queuepop p3pending -var line -key 2 new
+    if ("$line" == "NULL") break
+
+    list tmp -split $line
+    $expID  = $tmp:0
+    $version = $tmp:1
+    $camera = $tmp:2
+    queuepush p3pending "$expID $version $camera run"
+
+    host any
+    command p3astro $expID $version $camera
+  end
+
+  # success
+  task.exit    0
+    queueinit stdout
+    queuepush p3pending $taskargs:0 $taskargs:1 $taskargs:2 done
+  end
+end
+
+# p3update : search for images to be processed
+task	       p3done
+  command      p3search -done
+  host         local
+
+  # timeout shorter than exec so jobs do not build up
+  periods      -exec     30
+  periods      -poll     1
+  periods      -timeout  10
+end
Index: trunk/ippTools/doc/p3tools.txt
===================================================================
--- trunk/ippTools/doc/p3tools.txt	(revision 6021)
+++ trunk/ippTools/doc/p3tools.txt	(revision 6022)
@@ -2,10 +2,21 @@
 Phase 3 pipeline tools:
 
-p3search -pending :
+p3search -define :
   * examine the raw.exposures tables and select exposures matching the given criteria
   * add entries which are allowed (mosaic) to the p3.pending table
 
-p3search -update :
-  * select completed entries in the p1.pending table
-  * move to the p1.done table
-  * add new entry to the p2.pending tables
+p3search -quick :
+  * examine the raw.exposures tables and select exposures matching the given criteria
+  * return list of entries for p3 processing
+  * output: lines consisting of:
+    (expID) (p3version) (camera)
+
+p3search -pending :
+  * examine the p3.pending exposures table and select exposures waiting for p3
+  * return list of entries for p3 processing
+  * output: lines consisting of:
+    (expID) (p3version) (camera)
+
+p3search -done :
+  * select completed entries in the p3.pending table
+  * move to the p3.done table
