Index: /trunk/dettools/doc/dettools.txt
===================================================================
--- /trunk/dettools/doc/dettools.txt	(revision 6031)
+++ /trunk/dettools/doc/dettools.txt	(revision 6032)
@@ -7,5 +7,7 @@
  0. also creates a new master detrend frame entry
  (detID.version.iteration define this frame uniquely).
- 
+ * select the input matching a given detRun.  selects the input
+ exposures and the input files.
+
 options : 
   -ID ID : a free-form string; if not specified, a unique string is constructed
@@ -22,13 +24,11 @@
   (-exptime is mandatory for dark)
 
-dettools -getinput
- * select the input matching a given detRun.  selects the input
- exposures and the input files.
- - this function could be merged with -define
- - an alternate implementation would define a detRun ID for a given
- stack of input exposures
-
 dettools -pending raw [-state state] [-outmode mode]
  * select the unprocessed input infiles
+ - output of this program is used by pantasks to schedule the ppImage
+ run on each image
+
+dettools -pending resid [-state state] [-outmode mode]
+ * select the residual images to be processed
  - output of this program is used by pantasks to schedule the ppImage
  run on each image
@@ -37,4 +37,7 @@
  * select the files to be stacked for a given detRun, if exposures are ready
  - output of this program is used by ppMerge to build a master stack
+
+dettools -pending norm
+ * select the master detrend frames & imfiles to be normalized
 
 dettools -update raw
@@ -45,10 +48,4 @@
  - for a given resid exposure, compile the results from the stacks for
  each chip and renormalize the output files as needed.
-
-dettools -pending norm
- * select the master detrend frames & imfiles to be normalized
-
-dettools -resid
- * construct the resid exposures and imfiles given 
 
 dettools -assess
Index: /trunk/ippTools/src/chiptool.h
===================================================================
--- /trunk/ippTools/src/chiptool.h	(revision 6031)
+++ /trunk/ippTools/src/chiptool.h	(revision 6032)
@@ -62,10 +62,8 @@
 typedef struct {
     char expID[32];			// free-form exposure ID string
+    psU8 P2version;
     char class;				// class of file: fpa (0), chip (1), cell (2), readout (3)?
     int Nclass;				// number of files of this class
-    int Ndone;				// number of files of this class
-    char P1version;
-    char P2version;
-    char state;
+    psU8 P1version;
 } p2PendingExposure;
 
@@ -81,5 +79,4 @@
     char log[16];			// extension for log file
     char smf[16];			// extension for object table
-    char state;				// current P2 state
 } p2PendingImfile;
 
Index: /trunk/ippTools/src/p2insertPendingFrames.c
===================================================================
--- /trunk/ippTools/src/p2insertPendingFrames.c	(revision 6031)
+++ /trunk/ippTools/src/p2insertPendingFrames.c	(revision 6032)
@@ -21,5 +21,5 @@
 	version ++;
 
-	p2PendingExposure *pendingExposure = p2PendingExposureAlloc ();
+	p2PendingExposureRow *pendingExposure = p2PendingExposureAlloc ();
 	strcpy (pendingExposure->expID, rawFrame->exposure->expID);
 	pendingExposure->class = rawFrame->exposure->class;
@@ -52,6 +52,6 @@
 	}
 	
-	p2PendingExposureInsertOneRow (config->database, pendingExposure);
-	p2PendingImageInsertRows (config->database, pendingImages);
+	p2PendingExposureInsertObject (config->database, pendingExposure);
+	p2PendingImageInsertObjects (config->database, pendingImages);
     }
     return true;
Index: /trunk/ippTools/src/p2searchPendingFrames.c
===================================================================
--- /trunk/ippTools/src/p2searchPendingFrames.c	(revision 6031)
+++ /trunk/ippTools/src/p2searchPendingFrames.c	(revision 6032)
@@ -2,14 +2,8 @@
 
 // select pending frames (exposure+images) which are done/not done
-psArray *p2searchPendingFrames (p2SearchConfig *config, bool isDone) {
+psArray *p2searchPendingFrames (p2SearchConfig *config) {
 
     // build 'where' structure
     psMetadata *where = psMetadataAlloc ();
-
-    if (isDone) {
-	psMetadataAddStr (where, PS_LIST_TAIL, "STATE", 0, "==", P2_STATE_DONE);
-    } else {
-	psMetadataAddStr (where, PS_LIST_TAIL, "STATE", 0, "==", P2_STATE_PENDING);
-    }
 
     // in order to include these restrictions, we need to define these table columns
Index: /trunk/ippTools/src/p2searchRawFrames.c
===================================================================
--- /trunk/ippTools/src/p2searchRawFrames.c	(revision 6031)
+++ /trunk/ippTools/src/p2searchRawFrames.c	(revision 6032)
@@ -8,5 +8,4 @@
 
     psMetadataAddU8  (where, PS_LIST_TAIL, "TYPE",  0, "==", P2_TYPE_OBJECT);
-    psMetadataAddStr (where, PS_LIST_TAIL, "STATE", 0, "==", P2_START_READY);
 
     if (config->camera != NULL) {
