Index: /trunk/ippTools/src/p2insertPendingFrames.c
===================================================================
--- /trunk/ippTools/src/p2insertPendingFrames.c	(revision 6335)
+++ /trunk/ippTools/src/p2insertPendingFrames.c	(revision 6336)
@@ -38,9 +38,11 @@
             rawFrame->exposure->exp_id,
             rawFrame->exposure->camera,
+            rawFrame->exposure->telescope,
             rawFrame->exposure->exp_type,
+            rawFrame->exposure->class,
+            rawFrame->exposure->imfiles,
             rawFrame->exposure->filter,
-            rawFrame->exposure->class,
-            rawFrame->exposure->nclass,
             rawFrame->exposure->stats,
+            "my recipe",
             0xff,
             0xff
@@ -54,12 +56,10 @@
             p2PendingImfileRow *pendingImage = p2PendingImfileRowAlloc(
                 rawImage->exp_id,
-                rawImage->class,
                 rawImage->class_id,
+                rawImage->url,
+                "my stats",
+                "my recipe",
                 0xff, // p1
-                0xff, // p2
-                "",
-                "",
-                // XXX cleanup the url somehow
-                rawImage->url
+                0xff  // p2
             );
 
Index: /trunk/ippTools/src/p2pendingToDone.c
===================================================================
--- /trunk/ippTools/src/p2pendingToDone.c	(revision 6335)
+++ /trunk/ippTools/src/p2pendingToDone.c	(revision 6336)
@@ -16,12 +16,13 @@
             pendingFrame->exposure->exp_id,
             pendingFrame->exposure->camera,
+            pendingFrame->exposure->telescope,
             pendingFrame->exposure->exp_type,
+            pendingFrame->exposure->class,
+            pendingFrame->exposure->imfiles,
             pendingFrame->exposure->filter,
-            pendingFrame->exposure->class,
-            pendingFrame->exposure->nclass, // XXX ndone is uneeded?
-            0xFF, // ndone
+            pendingFrame->exposure->stats,
+            "my recipe",
             pendingFrame->exposure->p1_version,
             pendingFrame->exposure->p2_version
-            //doneExposure->state = P2_STATE_DONE;
         );
 
@@ -39,11 +40,10 @@
             p2DoneImfileRow *doneImage = p2DoneImfileRowAlloc(
                 pendingImage->exp_id,
-                pendingImage->class,
                 pendingImage->class_id,
+                pendingImage->url,
+                "my stats", // stats
+                "my recipe", // recipe
                 pendingImage->p1_version,
-                pendingImage->p2_version,
-                "", // recipe
-                "", // stats
-                pendingImage->url
+                pendingImage->p2_version
             );
 
@@ -73,11 +73,10 @@
         p2DoneImfileRow *doneImfile = p2DoneImfileRowAlloc(
             pendingImfile->exp_id,
-            pendingImfile->class,
             pendingImfile->class_id,
+            pendingImfile->url,
+            "my recipe", // recipe
+            "my stats", // stats
             pendingImfile->p1_version,
-            pendingImfile->p2_version,
-            "", // recipe
-            "", // stats
-            pendingImfile->url
+            pendingImfile->p2_version
         );
 
@@ -95,9 +94,11 @@
         pendingExp->exp_id,
         pendingExp->camera,
+        pendingExp->telescope,
         pendingExp->exp_type,
+        pendingExp->class,
+        pendingExp->imfiles, // XXX ndone is uneeded?
         pendingExp->filter,
-        pendingExp->class,
-        pendingExp->nclass, // XXX ndone is uneeded?
-        0xFF, // ndone
+        pendingExp->stats,
+        "my recipe",
         pendingExp->p1_version,
         pendingExp->p2_version
Index: /trunk/ippTools/src/p2rawToPending.c
===================================================================
--- /trunk/ippTools/src/p2rawToPending.c	(revision 6335)
+++ /trunk/ippTools/src/p2rawToPending.c	(revision 6336)
@@ -15,9 +15,11 @@
             rawFrame->exposure->exp_id,
             rawFrame->exposure->camera,
+            rawFrame->exposure->telescope,
             rawFrame->exposure->exp_type,
+            rawFrame->exposure->class,
+            rawFrame->exposure->imfiles,
             rawFrame->exposure->filter,
-            rawFrame->exposure->class,
-            rawFrame->exposure->nclass,
             rawFrame->exposure->stats,
+            "my recipe",
             0xff,   // p1
             0xff    // p2
@@ -30,11 +32,10 @@
             p2PendingImfileRow *pendingImage = p2PendingImfileRowAlloc(
                 rawImage->exp_id,
-                rawImage->class,
                 rawImage->class_id,
+                rawImage->url,
+                "my stats",      // stats
+                "my recipe",     // recipe
                 0xff,   // p1
-                0xff,   // p2
-                "",     // recipe
-                "",     // stats
-                rawImage->url
+                0xff    // p2
             );
 
Index: /trunk/ippTools/src/p2updatePending.c
===================================================================
--- /trunk/ippTools/src/p2updatePending.c	(revision 6335)
+++ /trunk/ippTools/src/p2updatePending.c	(revision 6336)
@@ -21,5 +21,5 @@
 	psMetadataAddS32 (where, PS_LIST_TAIL, "P2_VERSION", PS_META_REPLACE, "==", exposure->p2_version);
 	psArray *images = p2PendingImfileSelectRowObjects (config->database, where, MAX_ROWS);
-	if (images->n != exposure->nclass) {
+	if (images->n != exposure->imfiles) {
 	    // free things
 	    continue;
Index: /trunk/ippTools/src/pxframes.c
===================================================================
--- /trunk/ippTools/src/pxframes.c	(revision 6335)
+++ /trunk/ippTools/src/pxframes.c	(revision 6336)
@@ -53,6 +53,6 @@
         for (int j = 0; j < frame->images->n; j++) { \
             imfiletype##Row *image = frame->images->data[j]; \
-            fprintf (stream, "%s %s %s %s\n", \
-                image->exp_id, image->class, image->class_id, image->url); \
+            fprintf (stream, "%s %s %s\n", \
+                image->exp_id, image->class_id, image->url); \
             psMetadata *md = imfiletype##MetadataFromObject(image); \
             psMetadataAddMetadata(output, PS_LIST_TAIL, #imfiletype,  PS_META_DUPLICATE_OK, NULL, md); \
@@ -120,17 +120,16 @@
 rawScienceFrame *newToRawScienceFrame(newFrame *newFrame) 
 {
-    newExpRow       *newExp = NULL;
-
     PS_ASSERT_PTR_NON_NULL(newFrame, NULL);
 
-    newExp = newFrame->exposure;
+    newExpRow *newExp = newFrame->exposure;
     rawScienceExpRow *rawScienceExp = rawScienceExpRowAlloc(
         newExp->exp_id,
         newExp->camera,
+        newExp->telescope,
         newExp->exp_type,
-        newExp->filter,
         newExp->class,
-        newExp->nclass,
-        newExp->stats
+        newExp->imfiles,
+        "my filter",
+        "my stats"
     );
 
@@ -142,8 +141,7 @@
         psArrayAdd(rawImages, 0, rawImfileRowAlloc(
                 newImfile->exp_id,
-                newImfile->class,
                 newImfile->class_id,
-                newImfile->stats,
-                newImfile->url
+                newImfile->url,
+                "my stats"
             )
         );
@@ -187,9 +185,10 @@
         newExp->exp_id,
         newExp->camera,
+        newExp->telescope,
         newExp->exp_type,
-        newExp->filter,
         newExp->class,
-        newExp->nclass,
-        newExp->stats
+        newExp->imfiles,
+        "my filter",
+        "my stats"
     );
 
@@ -201,8 +200,7 @@
         psArrayAdd(rawImages, 0, rawImfileRowAlloc(
                 newImfile->exp_id,
-                newImfile->class,
                 newImfile->class_id,
-                newImfile->stats,
-                newImfile->url
+                newImfile->url,
+                "my stats"
             )
         );
Index: /trunk/ippTools/src/pxtables.c
===================================================================
--- /trunk/ippTools/src/pxtables.c	(revision 6335)
+++ /trunk/ippTools/src/pxtables.c	(revision 6336)
@@ -23,8 +23,4 @@
     }
     if (!rawDetrendExpCreateTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
-        status = false;
-    }
-    if (!p0CameraConfigCreateTable(config->database)) {
         psError(PS_ERR_UNKNOWN, false, "database access failed");
         status = false;
@@ -112,8 +108,4 @@
         status = false;
     }
-    if (!p0CameraConfigDropTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
-        status = false;
-    }
     if (!p1PendingExpDropTable(config->database)) {
         psError(PS_ERR_UNKNOWN, false, "database access failed");
Index: /trunk/ippTools/src/regtool.c
===================================================================
--- /trunk/ippTools/src/regtool.c	(revision 6335)
+++ /trunk/ippTools/src/regtool.c	(revision 6336)
@@ -80,4 +80,5 @@
             }
             
+            /*
             // lookup camera name in p0CameraConfig
             psMetadata *where = psMetadataAlloc();
@@ -127,4 +128,5 @@
 
             psFree(configs);
+            */
         }
         psFree(new);
@@ -203,10 +205,12 @@
         newExp->exp_id,
         newExp->camera,
+        newExp->telescope,
         newExp->exp_type,
-        newExp->filter,
         newExp->class,
-        newExp->nclass,
-        newExp->stats,
-        0 // XXX calc version number
+        newExp->imfiles,
+        "my filter",
+        "my stats",
+        "my recipe",
+        0xff // XXX calc version number
     );
 }
@@ -217,11 +221,13 @@
         newExp->exp_id,
         newExp->camera,
+        newExp->telescope,
         newExp->exp_type,
-        newExp->filter,
         newExp->class,
-        newExp->nclass,
-        newExp->stats,
-        0, // XXX calc version number
-        0 // XXX calc version number
+        newExp->imfiles,
+        "my filter", 
+        "my stats",
+        "my recipe",
+        0xff, // XXX calc version number
+        0xff // XXX calc version number
     );
 }
Index: /trunk/ippTools/src/regtoolConfig.c
===================================================================
--- /trunk/ippTools/src/regtoolConfig.c	(revision 6335)
+++ /trunk/ippTools/src/regtoolConfig.c	(revision 6336)
@@ -46,10 +46,18 @@
     psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-update",  0, "update pending image table", "");
 
+
+    // -pending search
+    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-exp_id",  0, "define exposure ID", "");
     psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-inst",  0, "define camera of interest", "");
+    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-telescope",  0, "define camera of interest", "");
+    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-exp_type",  0, "define class", "");
+    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-class",  0, "define class", "");
+
+    // -update inputs
+//    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-exp_id",  0, "define class", "");
     psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-filter",  0, "define filter of interest", "");
-    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-exp_id",  0, "define exposure ID", "");
-    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-class",  0, "define class", "");
-    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-class_id",  0, "define class ID", "");
-    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-url",  0, "define URL", "");
+    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-stat",  0, "define URL", "");
+    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-recipe",  0, "define URL", "");
+    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-mosiac",  0, "define URL", "");
 
     if (config->mode == PX_MODE_NONE) {
