Index: /trunk/dbconfig/chip.md
===================================================================
--- /trunk/dbconfig/chip.md	(revision 14022)
+++ /trunk/dbconfig/chip.md	(revision 14023)
@@ -1,4 +1,4 @@
 #
-#  We are dependant on the assumption that there is only ever one exp_tag in a
+#  We are dependant on the assumption that there is only ever one exp_id in a
 #  chipRun although the database does not enforce this.
 #
@@ -17,11 +17,11 @@
 chipInputImfile METADATA
     chip_id     S64         0       # Primary Key fkey (chip_id) ref chipRun(chip_id)
-    exp_tag     STR         64      # Primary Key fkey (exp_tag, class_id) ref rawImfile (exp_tag, class_id)
+    exp_id      S64         64      # Primary Key fkey (exp_id, class_id) ref rawImfile (exp_id, class_id)
     class_id    STR         64      # Primary Key
 END
 
 chipProcessedImfile METADATA
-    chip_id     S64         0       # Primary Key fkey (chip_id, exp_tag, class_id) ref chipPendingImfile(chip_id, exp_tag, class_id)
-    exp_tag     STR         64      # Primary Key
+    chip_id     S64         0       # Primary Key fkey (chip_id, exp_id, class_id) ref chipInputImfile(chip_id, exp_id, class_id)
+    exp_id     S64         64      # Primary Key
     class_id        STR     64      # Primary Key
     uri             STR     255
Index: /trunk/dbconfig/det.md
===================================================================
--- /trunk/dbconfig/det.md	(revision 14022)
+++ /trunk/dbconfig/det.md	(revision 14023)
@@ -34,5 +34,5 @@
     det_id      S64         0       # Primary Key
     iteration   S32         0       # Primary Key
-    exp_tag     STR         64      # Primary Key
+    exp_id     S64         64      # Primary Key
     include     BOOL        f
 END
@@ -40,5 +40,5 @@
 detProcessedImfile METADATA
     det_id      S64         0      # Primary Key
-    exp_tag     STR         64     # Primary Key
+    exp_id     S64         64     # Primary Key
     class_id    STR         64     # Primary Key
     uri         STR         255
@@ -61,5 +61,5 @@
 detProcessedExp METADATA
     det_id      S64         0      # Primary Key
-    exp_tag     STR         64     # Primary Key
+    exp_id     S64         64     # Primary Key
     recipe      STR         64
     bg          F64         0.0
@@ -153,5 +153,5 @@
     det_id      S64         0       # Primary Key
     iteration   S32         0       # Primary Key
-    exp_tag     STR         64      # Primary Key
+    exp_id     S64         64      # Primary Key
     class_id    STR         64      # Primary Key
     uri         STR         255
@@ -176,5 +176,5 @@
     det_id      S64         0       # Primary Key
     iteration   S32         0       # Primary Key
-    exp_tag     STR         64      # Primary Key
+    exp_id     S64         64      # Primary Key
     recipe      STR         64
     bg          F64         0.0
Index: /trunk/dbconfig/guide.md
===================================================================
--- /trunk/dbconfig/guide.md	(revision 14022)
+++ /trunk/dbconfig/guide.md	(revision 14023)
@@ -1,5 +1,5 @@
 guidePendingExp METADATA
     guide_id    S64         0       # Primary Key AUTO_INCREMENT
-    exp_tag     STR         64      # Key
+    exp_id     S64         64      # Key
     recipe      STR         64
 END
Index: /trunk/dbconfig/magic.md
===================================================================
--- /trunk/dbconfig/magic.md	(revision 14022)
+++ /trunk/dbconfig/magic.md	(revision 14023)
@@ -1,3 +1,3 @@
-# $Id: magic.md,v 1.1 2007-02-15 02:12:42 jhoblitt Exp $
+# $Id: magic.md,v 1.2 2007-07-06 01:16:08 jhoblitt Exp $
 
 #
@@ -10,5 +10,5 @@
 p4MagicMaskImfile METADATA
     p4_id       S32         0       # Primary Key
-    exp_tag     STR         64      # Primary Key
+    exp_id     S64         64      # Primary Key
     p3_version  S32         0       # Primary Key
 # class is not yet consistently carried through pXtools
@@ -21,5 +21,5 @@
 # p4MagicMaskImfile METADATA
 #     p4_id       S32         0       # Primary Key
-#     exp_tag     STR         64      # Primary Key
+#     exp_id     S64         64      # Primary Key
 #     p3_version  S32         0       # Primary Key
 # # class is not yet consistently carried through pXtools
@@ -34,5 +34,5 @@
 #     skycell_id  STR         64      # Primary Key
 #     tess_id     STR         64      # Primary Key
-#     exp_tag     STR         64      # Primary Key
+#     exp_id     S64         64      # Primary Key
 #     p3_version  S32         0       # Primary Key
 # # class is not yet consistently carried through pXtools
@@ -50,5 +50,5 @@
 #     skycell_id  STR         64      # Primary Key
 #     tess_id     STR         64      # Primary Key
-#     exp_tag     STR         64      # Primary Key
+#     exp_id     S64         64      # Primary Key
 #     p3_version  S32         0       # Primary Key
 # # class is not yet consistently carried through pXtools
@@ -64,5 +64,5 @@
 #     skycell_id  STR         64      # Primary Key
 #     tess_id     STR         64      # Primary Key
-#     exp_tag     STR         64      # Primary Key
+#     exp_id     S64         64      # Primary Key
 #     p3_version  S32         0       # Primary Key
 # # class is not yet consistently carried through pXtools
@@ -77,5 +77,5 @@
 # p4MagicMaskImfile METADATA
 #     p4_id       S32         0       # Primary Key
-#     exp_tag     STR         64      # Primary Key
+#     exp_id     S64         64      # Primary Key
 #     p3_version  S32         0       # Primary Key
 # # class is not yet consistently carried through pXtools
Index: /trunk/dbconfig/skycell.md
===================================================================
--- /trunk/dbconfig/skycell.md	(revision 14022)
+++ /trunk/dbconfig/skycell.md	(revision 14023)
@@ -1,3 +1,3 @@
-# $Id: skycell.md,v 1.3 2007-02-13 22:33:30 jhoblitt Exp $
+# $Id: skycell.md,v 1.4 2007-07-06 01:16:08 jhoblitt Exp $
 
 skyCell METADATA
@@ -17,5 +17,5 @@
     skycell_id  STR         64      # Primary Key
     tess_id     STR         64      # Primary Key
-    exp_tag     STR         64      # Primary Key
+    exp_id     S64         64      # Primary Key
     p3_version  S32         0       # Primary Key
 # class is not yet consistently carried through pXtools
Index: /trunk/dbconfig/tasks.md
===================================================================
--- /trunk/dbconfig/tasks.md	(revision 14022)
+++ /trunk/dbconfig/tasks.md	(revision 14023)
@@ -1,6 +1,6 @@
-# $Id: tasks.md,v 1.135 2007-07-05 20:13:45 jhoblitt Exp $
+# $Id: tasks.md,v 1.136 2007-07-06 01:16:08 jhoblitt Exp $
 
 # this table records all exposure ID ever seen from the summit
-# exp_id == fileset
+# exp_name == fileset
 
 # note that dec is a MySQL reserved word
@@ -8,15 +8,15 @@
 # note that exp is a MySQL reserved word
 
-# for use with this stored procedure to generate exp_tags under Mysql 5+
+# for use with this stored procedure to generate exp_ids under Mysql 5+
 #
-#CREATE FUNCTION genTag (exp_id varchar(64)) RETURNS VARCHAR(64)
+#CREATE FUNCTION genTag (exp_name varchar(64)) RETURNS VARCHAR(64)
 #BEGIN
 #    UPDATE expTagCounter SET counter = LAST_INSERT_ID(counter + 1);
-#    RETURN CONCAT(exp_id, '.', LAST_INSERT_ID());
+#    RETURN CONCAT(exp_name, '.', LAST_INSERT_ID());
 #END
 #
-expTagCounter METADATA
-   counter     U64         0 
-END
+#expTagCounter METADATA
+#   counter     U64         0 
+#END
 
 # list of source exposures -- updated as exposures are seen
@@ -24,5 +24,5 @@
 # -1 as NULL or 0 might be a valid value (empty fileset)
 summitExp METADATA
-    exp_id      STR         64      # Primary Key
+    exp_name      STR         64      # Primary Key
     camera      STR         64      # Primary Key
     telescope   STR         64      # Primary Key
@@ -37,5 +37,5 @@
 # list of source images -- updated as exposures/filesets are queried
 summitImfile METADATA
-    exp_id      STR         64      # Primary Key
+    exp_name      STR         64      # Primary Key
     camera      STR         64      # Primary Key
     telescope   STR         64      # Primary Key
@@ -51,5 +51,5 @@
 # downloaded) 
 pzPendingExp METADATA
-    exp_id      STR         64      # Primary Key
+    exp_name      STR         64      # Primary Key
     camera      STR         64      # Primary Key
     telescope   STR         64      # Primary Key
@@ -57,15 +57,15 @@
 
 pzPendingImfile METADATA
-    exp_id      STR         64      # Primary Key
+    exp_name    STR         64      # Primary Key
     camera      STR         64      # Primary Key
     telescope   STR         64      # Primary Key
     class       STR         64      # Primary Key
     class_id    STR         64      # Primary Key
-    exp_tag     STR         64      # Unique Key
+    exp_id      S64         64      # Unique Key
 END
 
 # list of exposures that have had all of their imfiles downloaded
 pzDoneExp METADATA
-    exp_id      STR         64      # Primary Key
+    exp_name    STR         64      # Primary Key
     camera      STR         64      # Primary Key
     telescope   STR         64      # Primary Key
@@ -73,19 +73,19 @@
 
 pzDoneImfile METADATA
-    exp_id      STR         64      # Primary Key
+    exp_name    STR         64      # Primary Key
     camera      STR         64      # Primary Key
     telescope   STR         64      # Primary Key
     class       STR         64      # Primary Key
     class_id    STR         64      # Primary Key
-    exp_tag     STR         64      # Unique Key
+    exp_id      S64         64      # Unique Key
     uri         STR         255
 END
 
 newExp METADATA
-    exp_tag     STR         64      # Primary Key
-    exp_id      STR         64      # Key
+    exp_id      S64         0       # Primary Key AUTO_INCREMENT
+    tmp_exp_name STR        64      # Key
+    tmp_camera    STR         64      # Key
+    tmp_telescope STR         64      # Key
     state       STR         64      # Key
-    camera      STR         64      # Key
-    telescope   STR         64      # Key
     imfiles     S32         0
     workdir     STR         255     # destination for output files
@@ -96,6 +96,6 @@
 # from there
 newImfile METADATA
-    exp_tag     STR         64      # Primary Key fkey(exp_tag) ref newExp(exp_tag)
-    class_id    STR         64      # Primary Key
+    exp_id      S64         64      # Primary Key fkey(exp_id) ref newExp(exp_id)
+    tmp_class_id STR        64      # Primary Key
     uri         STR         255
 END
@@ -103,9 +103,10 @@
 # paired with rawImfile
 rawExp METADATA
-    exp_tag     STR         64      # Primary Key fkey(exp_tag) ref newExp(exp_tag)
-    exp_id      STR         64      # Key
+    exp_id      S64         64      # Primary Key fkey(exp_id) ref newExp(exp_id)
+    exp_name    STR         64
     camera      STR         64
     telescope   STR         64
     dateobs     UTC         0001-01-01T00:00:00Z
+    exp_tag     STR         255
     exp_type    STR         64
     imfiles     S32         0
@@ -136,5 +137,10 @@
 
 rawImfile METADATA
-    exp_tag     STR         64      # Primary Key fkey(exp_tag, class_id) ref newImfile(exp_tag, class_id)
+    exp_id      S64         64      # Primary Key fkey(exp_id, tmp_class_id) ref newImfile(exp_id, tmp_class_id)
+    exp_name    STR         64
+    camera      STR         64
+    telescope   STR         64
+    dateobs     UTC         0001-01-01T00:00:00Z
+    tmp_class_id    STR     64      # Key
     class_id    STR         64      # Primary Key
     uri         STR         255
@@ -163,9 +169,4 @@
     user_5      F64         0.0
     object      STR         64
-    dateobs     UTC         0001-01-01T00:00:00Z
     fault       S16         0       # Key NOT NULL
 END
-
-#
-# XXX - temporarily (???) stop carrying around class in imfiles after rawImfile
-#
Index: /trunk/dbconfig/warp.md
===================================================================
--- /trunk/dbconfig/warp.md	(revision 14022)
+++ /trunk/dbconfig/warp.md	(revision 14023)
@@ -1,3 +1,3 @@
-# $Id: warp.md,v 1.3 2007-06-07 01:10:31 price Exp $
+# $Id: warp.md,v 1.4 2007-07-06 01:16:08 jhoblitt Exp $
 
 #
@@ -23,9 +23,9 @@
 
 # the list of imfiles in our skycell keyed against phase 3
-# only allow one cam_version of an exp_tag per warpRun
+# only allow one cam_version of an exp_id per warpRun
 warpInputExp METADATA
     warp_id     S64         0       # Primary Key fkey(warp_id) ref warpRun(warp_id)
     cam_id      S64         0       # Primary Key fkey(cam_id) ref camProcessedExp(cam_id)
-# if magic is T then look for the exp_tag in the magic output tables
+# if magic is T then look for the exp_id in the magic output tables
     magiced     BOOL        f       # Key
 END
Index: /trunk/ippTools/scripts/regtest.sh
===================================================================
--- /trunk/ippTools/scripts/regtest.sh	(revision 14022)
+++ /trunk/ippTools/scripts/regtest.sh	(revision 14023)
@@ -8,37 +8,37 @@
 echo -e "YES\nipp\n\n" | pxadmin -recreate || exit 1
 
-exp_tag1=`$inject -newExp -exp_id t10 -inst gpc -telescope ps1 -imfiles 4 -workdir file::///some/path -simple` || exit 1
+exp_id1=`$inject -newExp -tmp_exp_name t10 -tmp_inst gpc -tmp_telescope ps1 -imfiles 4 -workdir file::///some/path -simple` || exit 1
 
 for ID in `seq 0 3`; do
-    $inject -newImfile -exp_tag $exp_tag1 -class_id $ID -uri file://$ID || exit 1
+    $inject -newImfile -exp_id $exp_id1 -tmp_class_id tmp.$ID -uri file://$ID || exit 1
 done;
 
-$inject -updatenewExp -exp_tag $exp_tag1 -state run
+$inject -updatenewExp -exp_id $exp_id1 -state run
 
-exp_tag2=`$inject -newExp -exp_id t11 -inst gpc -telescope ps1 -imfiles 4 -workdir file::///some/path -simple` || exit 1
+exp_id2=`$inject -newExp -tmp_exp_name t11 -tmp_inst gpc -tmp_telescope ps1 -imfiles 4 -workdir file::///some/path -simple` || exit 1
 
 for ID in `seq 0 3`; do
-    $inject -newImfile -exp_tag $exp_tag2 -class_id $ID -uri file://$ID || exit 1
+    $inject -newImfile -exp_id $exp_id2 -tmp_class_id tmp.$ID -uri file://$ID || exit 1
 done;
 
-$inject -updatenewExp -exp_tag $exp_tag2 -state run
+$inject -updatenewExp -exp_id $exp_id2 -state run
 
 $regtool -pendingimfile || exit 1
 
 for ID in `seq 0 3`; do
-    $regtool -addprocessedimfile -exp_tag $exp_tag1 -class_id $ID -filter r -airmass 10 -ra 1 -decl 2 -exp_time 0 -bg 1 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 10 -posang 10 -object dog -dateobs 2006-10-20T10:10:10Z || exit 1
+    $regtool -addprocessedimfile -exp_id $exp_id1 -exp_name t10 -inst gpc -telescope ps1 -tmp_class_id tmp.$ID -class_id $ID -filter r -airmass 10 -ra 1 -decl 2 -exp_time 0 -bg 1 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 10 -posang 10 -object dog -dateobs 2006-10-20T10:10:10Z || exit 1
 done;
 
 $regtool -pendingexp|| exit 1
 
-$regtool -addprocessedexp -exp_tag $exp_tag1 -filelevel OTA -filter r -airmass 10 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 10 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 45 -posang 10 -object dog -dateobs "2006-10-20T10:10:10Z" -label foobar $* || exit 1
+$regtool -addprocessedexp -exp_id $exp_id1 -exp_name t10 -imfiles 4 -inst gpc -telescope ps1 -exp_tag batman.t10 -filelevel OTA -filter r -airmass 10 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 10 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 45 -posang 10 -object dog -dateobs "2006-10-20T10:10:10Z" -label foobar $* || exit 1
 
 $regtool -pendingimfile || exit 1
 
 for ID in `seq 0 3`; do
-    $regtool -addprocessedimfile -exp_tag $exp_tag2 -exp_type object -class_id $ID -filter r -airmass 10 -ra 1 -decl 2 -exp_time 0 -bg 1 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 10 -posang 10 -object dog -dateobs 2006-10-20T10:10:10Z || exit 1
+    $regtool -addprocessedimfile -exp_id $exp_id2 -exp_name t11 -inst gpc -telescope ps1  -tmp_class_id tmp.$ID -class_id $ID -filter r -airmass 10 -ra 1 -decl 2 -exp_time 0 -bg 1 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 10 -posang 10 -object dog -dateobs 2006-10-20T10:10:10Z || exit 1
 done;
 
 $regtool -pendingexp|| exit 1
 
-$regtool -addprocessedexp -exp_tag $exp_tag2 -filelevel OTA -filter r -airmass 11 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 11 -bg_stdev 1 -bg_mean_stdev 11 -alt 11 -az 11 -ccd_temp 45 -posang 11 -object dog -dateobs 2006-10-20T10:10:10Z -label foobar $* || exit 1
+$regtool -addprocessedexp -exp_id $exp_id2 -exp_name t11 -imfiles 4 -inst gpc -telescope ps1 -exp_tag batman.t11 -filelevel OTA -filter r -airmass 11 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 11 -bg_stdev 1 -bg_mean_stdev 11 -alt 11 -az 11 -ccd_temp 45 -posang 11 -object dog -dateobs 2006-10-20T10:10:10Z -label foobar $* || exit 1
Index: /trunk/ippTools/share/Makefile.am
===================================================================
--- /trunk/ippTools/share/Makefile.am	(revision 14022)
+++ /trunk/ippTools/share/Makefile.am	(revision 14023)
@@ -9,5 +9,4 @@
 	chiptool_pendingimfile.sql \
 	chiptool_processedimfile.sql \
-	chiptool_queuerawexp.sql \
 	chiptool_queuerawimfile.sql \
 	detselect_search.sql \
Index: /trunk/ippTools/share/camtool_find_pendingexp.sql
===================================================================
--- /trunk/ippTools/share/camtool_find_pendingexp.sql	(revision 14022)
+++ /trunk/ippTools/share/camtool_find_pendingexp.sql	(revision 14023)
@@ -4,6 +4,6 @@
 SELECT
     camRun.*,
-    rawExp.exp_tag,
     rawExp.exp_id,
+    rawExp.exp_name,
     rawExp.camera,
     rawExp.telescope,
@@ -15,5 +15,5 @@
     USING(chip_id)
 JOIN rawExp
-    ON chipProcessedImfile.exp_tag = rawExp.exp_tag
+    ON chipProcessedImfile.exp_id = rawExp.exp_id
 LEFT JOIN camProcessedExp
     ON camRun.cam_id = camProcessedExp.cam_id
Index: /trunk/ippTools/share/camtool_find_pendingimfile.sql
===================================================================
--- /trunk/ippTools/share/camtool_find_pendingimfile.sql	(revision 14022)
+++ /trunk/ippTools/share/camtool_find_pendingimfile.sql	(revision 14023)
@@ -4,5 +4,5 @@
     (SELECT
         camPendingExp.*,
-        chipProcessedExp.exp_tag,
+        chipProcessedExp.exp_id,
         chipProcessedExp.guide_id,
         chipProcessedImfile.class_id,
@@ -12,5 +12,5 @@
         chipProcessedImfile.bg_mean_stdev,
         chipProcessedImfile.path_base,
-        rawExp.exp_id,
+        rawExp.exp_name,
         rawExp.camera,
         rawExp.telescope,
@@ -22,5 +22,5 @@
         USING(chip_id)
     JOIN rawExp
-        ON chipProcessedExp.exp_tag = rawExp.exp_tag
+        ON chipProcessedExp.exp_id = rawExp.exp_id
     LEFT JOIN camProcessedExp
         ON camPendingExp.cam_id = camProcessedExp.cam_id
Index: /trunk/ippTools/share/camtool_find_processedexp.sql
===================================================================
--- /trunk/ippTools/share/camtool_find_processedexp.sql	(revision 14022)
+++ /trunk/ippTools/share/camtool_find_processedexp.sql	(revision 14023)
@@ -1,5 +1,5 @@
 SELECT
     camProcessedExp.*,
-    rawExp.exp_id,
+    rawExp.exp_name,
     rawExp.camera,
     rawExp.telescope,
@@ -9,5 +9,5 @@
     USING(chip_id)
 JOIN rawExp
-    ON chipProcessedExp.exp_tag = rawExp.exp_tag
+    ON chipProcessedExp.exp_id = rawExp.exp_id
 WHERE -- bogus condition so there is a pre-existing where to append to
     camProcessedExp.cam_id IS NOT NULL
Index: /trunk/ippTools/share/chiptool_completely_processed_exp.sql
===================================================================
--- /trunk/ippTools/share/chiptool_completely_processed_exp.sql	(revision 14022)
+++ /trunk/ippTools/share/chiptool_completely_processed_exp.sql	(revision 14023)
@@ -18,8 +18,8 @@
         USING(chip_id)
     JOIN rawExp
-        ON chipInputImfile.exp_tag = rawExp.exp_tag
+        ON chipInputImfile.exp_id = rawExp.exp_id
     JOIN chipProcessedImfile
         ON chipInputImfile.chip_id = chipProcessedImfile.chip_id
-        AND chipInputImfile.exp_tag = chipProcessedImfile.exp_tag
+        AND chipInputImfile.exp_id = chipProcessedImfile.exp_id
         AND chipInputImfile.class_id = chipProcessedImfile.class_id
     WHERE
@@ -28,4 +28,4 @@
     GROUP BY
         chipInputImfile.chip_id,
-        chipInputImfile.exp_tag
+        chipInputImfile.exp_id
     HAVING rawExp.imfiles = COUNT(chipProcessedImfile.class_id)) as Foo
Index: /trunk/ippTools/share/chiptool_find_rawexp.sql
===================================================================
--- /trunk/ippTools/share/chiptool_find_rawexp.sql	(revision 14022)
+++ /trunk/ippTools/share/chiptool_find_rawexp.sql	(revision 14023)
@@ -2,5 +2,5 @@
 -- processeing
 SELECT
-    exp_tag
+    exp_id
 FROM rawExp
 WHERE
Index: /trunk/ippTools/share/chiptool_pendingimfile.sql
===================================================================
--- /trunk/ippTools/share/chiptool_pendingimfile.sql	(revision 14022)
+++ /trunk/ippTools/share/chiptool_pendingimfile.sql	(revision 14023)
@@ -1,8 +1,8 @@
 SELECT
     chipRun.*,
-    chipInputImfile.exp_tag,
+    chipInputImfile.exp_id,
     chipInputImfile.class_id,
     rawImfile.uri,
-    rawExp.exp_id,
+    rawExp.exp_name,
     rawExp.camera,
     rawExp.telescope,
@@ -13,11 +13,11 @@
 LEFT JOIN chipProcessedImfile
     ON chipInputImfile.chip_id = chipProcessedImfile.chip_id
-    AND chipInputImfile.exp_tag = chipProcessedImfile.exp_tag
+    AND chipInputImfile.exp_id = chipProcessedImfile.exp_id
     AND chipInputImfile.class_id = chipProcessedImfile.class_id
 JOIN rawImfile
-    ON chipInputImfile.exp_tag = rawImfile.exp_tag
+    ON chipInputImfile.exp_id = rawImfile.exp_id
     AND chipInputImfile.class_id = rawImfile.class_id
 JOIN rawExp
-    ON rawImfile.exp_tag = rawExp.exp_tag
+    ON rawImfile.exp_id = rawExp.exp_id
 LEFT JOIN chipMask
     ON chipRun.label = chipMask.label
@@ -25,5 +25,5 @@
     chipRun.state = 'run'
     AND chipProcessedImfile.chip_id IS NULL
-    AND chipProcessedImfile.exp_tag IS NULL
+    AND chipProcessedImfile.exp_id IS NULL
     AND chipProcessedImfile.class_id IS NULL
     AND chipMask.label IS NULL
Index: /trunk/ippTools/share/chiptool_processedimfile.sql
===================================================================
--- /trunk/ippTools/share/chiptool_processedimfile.sql	(revision 14022)
+++ /trunk/ippTools/share/chiptool_processedimfile.sql	(revision 14023)
@@ -7,5 +7,5 @@
     chipProcessedImfile.bg_mean_stdev,
     chipProcessedImfile.path_base,
-    rawExp.exp_id,
+    rawExp.exp_name,
     rawExp.camera,
     rawExp.telescope,
@@ -15,7 +15,7 @@
     USING(chip_id)
 JOIN rawExp
-    ON chipProcessedExp.exp_tag = rawExp.exp_tag
+    ON chipProcessedExp.exp_id = rawExp.exp_id
 WHERE
 -- bogus test; just here so there there is a 'WHERE' stmt to append conditionals too
-    chipProcessedImfile.exp_tag is NOT NULL
+    chipProcessedImfile.exp_id is NOT NULL
 
Index: /trunk/ippTools/share/chiptool_queuerawimfile.sql
===================================================================
--- /trunk/ippTools/share/chiptool_queuerawimfile.sql	(revision 14022)
+++ /trunk/ippTools/share/chiptool_queuerawimfile.sql	(revision 14023)
@@ -2,12 +2,12 @@
     SELECT
         LAST_INSERT_ID(),
-        rawImfile.exp_tag,
+        rawImfile.exp_id,
         rawImfile.class_id
     FROM rawImfile
     JOIN newExp
-        USING(exp_tag)
+        USING(exp_id)
     WHERE
         rawImfile.fault = 0
         AND newExp.state = 'stop'
-        AND rawImfile.exp_tag = '%s'
+        AND rawImfile.exp_id = '%s'
 
Index: /trunk/ippTools/share/dettool_find_completed_runs.sql
===================================================================
--- /trunk/ippTools/share/dettool_find_completed_runs.sql	(revision 14022)
+++ /trunk/ippTools/share/dettool_find_completed_runs.sql	(revision 14023)
@@ -6,5 +6,5 @@
         detRun.det_id,
         detRun.iteration,
-        detInputExp.exp_tag
+        detInputExp.exp_id
     FROM detRun
         LEFT JOIN detInputExp
@@ -12,9 +12,9 @@
         AND detRun.iteration = detInputExp.iteration
     LEFT JOIN rawExp
-        ON detInputExp.exp_tag = rawExp.exp_tag
+        ON detInputExp.exp_id = rawExp.exp_id
     LEFT JOIN detResidExp
         ON detRun.det_id = detResidExp.det_id
         AND detRun.iteration = detResidExp.iteration
-        AND detInputExp.exp_tag = detResidExp.exp_tag
+        AND detInputExp.exp_id = detResidExp.exp_id
    WHERE
         detRun.state = 'run'
@@ -23,4 +23,4 @@
         detRun.iteration
     HAVING
-        COUNT(detResidExp.exp_tag) = COUNT(detInputExp.exp_tag)
+        COUNT(detResidExp.exp_id) = COUNT(detInputExp.exp_id)
     ) AS residdetrun
Index: /trunk/ippTools/share/difftool_inputskyfile.sql
===================================================================
--- /trunk/ippTools/share/difftool_inputskyfile.sql	(revision 14022)
+++ /trunk/ippTools/share/difftool_inputskyfile.sql	(revision 14023)
@@ -17,5 +17,5 @@
     ON camProcessedExp.chip_id = chipProcessedExp.chip_id
 JOIN rawExp
-    ON chipProcessedExp.exp_tag = rawExp.exp_tag
+    ON chipProcessedExp.exp_id = rawExp.exp_id
 WHERE
     diffRun.state = 'run'
Index: /trunk/ippTools/share/regtool_find_unprocessed_exp.sql
===================================================================
--- /trunk/ippTools/share/regtool_find_unprocessed_exp.sql	(revision 14022)
+++ /trunk/ippTools/share/regtool_find_unprocessed_exp.sql	(revision 14023)
@@ -4,13 +4,13 @@
     FROM newExp
     JOIN newImfile
-       USING(exp_tag)
+       USING(exp_id)
     LEFT JOIN rawExp
-       USING(exp_tag)
+       USING(exp_id)
     WHERE
         newExp.state = 'run'
-        AND rawExp.exp_tag IS NULL
+        AND rawExp.exp_id IS NULL
         AND newExp.imfiles =
-        (SELECT COUNT(exp_tag) FROM rawImfile
-            WHERE rawImfile.exp_tag = newExp.exp_tag)) as Foo
+        (SELECT COUNT(exp_id) FROM rawImfile
+            WHERE rawImfile.exp_id = newExp.exp_id)) as Foo
 WHERE
-    exp_tag = '%s'
+    exp_id = '%s'
Index: unk/ippTools/share/regtool_find_unprocessed_imfile.sql
===================================================================
--- /trunk/ippTools/share/regtool_find_unprocessed_imfile.sql	(revision 14022)
+++ 	(revision )
@@ -1,11 +1,0 @@
-SELECT DISTINCT * FROM
-    (SELECT
-        newImfile.*
-    FROM newImfile
-    JOIN newExp
-        USING(exp_tag)
-    LEFT JOIN rawExp
-        USING(exp_tag)
-    WHERE
-        newExp.state = 'run'
-        AND rawExp.exp_tag IS NULL) as Foo
Index: /trunk/ippTools/share/regtool_pendingexp.sql
===================================================================
--- /trunk/ippTools/share/regtool_pendingexp.sql	(revision 14022)
+++ /trunk/ippTools/share/regtool_pendingexp.sql	(revision 14023)
@@ -3,13 +3,13 @@
 FROM newExp
 JOIN newImfile
-    USING(exp_tag)
+    USING(exp_id)
 LEFT JOIN rawExp
-    USING(exp_tag)
+    USING(exp_id)
 WHERE
     newExp.state = 'run'
-    AND rawExp.exp_tag IS NULL
+    AND rawExp.exp_id IS NULL
     AND newExp.imfiles =
-    (SELECT COUNT(exp_tag) FROM rawImfile
+    (SELECT COUNT(exp_id) FROM rawImfile
         WHERE
-            rawImfile.exp_tag = newExp.exp_tag
+            rawImfile.exp_id = newExp.exp_id
             AND rawImfile.fault = 0)
Index: /trunk/ippTools/share/regtool_pendingimfile.sql
===================================================================
--- /trunk/ippTools/share/regtool_pendingimfile.sql	(revision 14022)
+++ /trunk/ippTools/share/regtool_pendingimfile.sql	(revision 14023)
@@ -1,11 +1,18 @@
-SELECT
-   newImfile.*,
-   newExp.workdir
-FROM newImfile
-LEFT JOIN newExp
-    USING(exp_tag)
-LEFT JOIN rawExp
-    USING(exp_tag)
-WHERE
-    newExp.exp_tag is NOT NULL
-    AND rawExp.exp_tag IS NULL
+SELECT DISTINCT * FROM
+    (SELECT
+        newExp.exp_id,
+        newExp.tmp_exp_name,
+        newExp.tmp_camera,
+        newExp.tmp_telescope,
+        newExp.workdir,
+        newImfile.tmp_class_id,
+        newImfile.uri
+    FROM newImfile
+    JOIN newExp
+        USING(exp_id)
+    LEFT JOIN rawImfile
+        ON newExp.exp_id = rawImfile.exp_id
+        AND newImfile.tmp_class_id = rawImfile.tmp_class_id
+    WHERE
+        newExp.state = 'run'
+        AND rawImfile.tmp_class_id IS NULL) as Foo
Index: /trunk/ippTools/share/regtool_processedimfile.sql
===================================================================
--- /trunk/ippTools/share/regtool_processedimfile.sql	(revision 14022)
+++ /trunk/ippTools/share/regtool_processedimfile.sql	(revision 14023)
@@ -1,10 +1,10 @@
 SELECT
     rawImfile.*,
-    newExp.exp_id,
+    newExp.exp_name,
     newExp.camera,
     newExp.telescope
 FROM rawImfile
 JOIN newExp
-    USING(exp_tag)
+    USING(exp_id)
 -- bogus conditional so there is a where clause to append to
-WHERE rawImfile.exp_tag is NOT NULL
+WHERE rawImfile.exp_id is NOT NULL
Index: /trunk/ippTools/share/stacktool_inputskyfile.sql
===================================================================
--- /trunk/ippTools/share/stacktool_inputskyfile.sql	(revision 14022)
+++ /trunk/ippTools/share/stacktool_inputskyfile.sql	(revision 14023)
@@ -16,5 +16,5 @@
     ON camProcessedExp.chip_id = chipProcessedExp.chip_id
 JOIN rawExp
-    ON chipProcessedExp.exp_tag = rawExp.exp_tag
+    ON chipProcessedExp.exp_id = rawExp.exp_id
 WHERE
     stackRun.state = 'run'
Index: /trunk/ippTools/share/warptool_imfile.sql
===================================================================
--- /trunk/ippTools/share/warptool_imfile.sql	(revision 14022)
+++ /trunk/ippTools/share/warptool_imfile.sql	(revision 14023)
@@ -14,5 +14,5 @@
     ON camProcessedExp.chip_id = chipProcessedImfile.chip_id
 JOIN rawImfile -- is there any reason not to refer back to rawimfiles?
-    ON chipProcessedExp.exp_tag = rawImfile.exp_tag
+    ON chipProcessedExp.exp_id = rawImfile.exp_id
 WHERE
     warpRun.state = 'run'
Index: /trunk/ippTools/share/warptool_tooverlap.sql
===================================================================
--- /trunk/ippTools/share/warptool_tooverlap.sql	(revision 14022)
+++ /trunk/ippTools/share/warptool_tooverlap.sql	(revision 14023)
@@ -12,5 +12,5 @@
     ON camProcessedExp.chip_id = chipProcessedExp.chip_id
 JOIN rawExp
-    ON chipProcessedExp.exp_tag = rawExp.exp_tag
+    ON chipProcessedExp.exp_id = rawExp.exp_id
 LEFT JOIN warpSkyCellMap
     ON warpInputExp.warp_id = warpSkyCellMap.warp_id
Index: /trunk/ippTools/share/warptool_towarped.sql
===================================================================
--- /trunk/ippTools/share/warptool_towarped.sql	(revision 14022)
+++ /trunk/ippTools/share/warptool_towarped.sql	(revision 14023)
@@ -14,5 +14,5 @@
     ON camProcessedExp.chip_id = chipProcessedExp.chip_id
 JOIN rawExp
-    ON chipProcessedExp.exp_tag = rawExp.exp_tag
+    ON chipProcessedExp.exp_id = rawExp.exp_id
 LEFT JOIN warpSkyfile
     ON warpRun.warp_id = warpSkyfile.warp_id
Index: /trunk/ippTools/src/camtool.c
===================================================================
--- /trunk/ippTools/src/camtool.c	(revision 14022)
+++ /trunk/ippTools/src/camtool.c	(revision 14023)
@@ -144,6 +144,6 @@
 }
 
-    ADDPARAMSTR(config->args, where, "exp_tag");
     ADDPARAMSTR(config->args, where, "exp_id");
+    ADDPARAMSTR(config->args, where, "exp_name");
     ADDPARAMSTR(config->args, where, "inst");
     ADDPARAMSTR(config->args, where, "telescope");
Index: /trunk/ippTools/src/camtoolConfig.c
===================================================================
--- /trunk/ippTools/src/camtoolConfig.c	(revision 14022)
+++ /trunk/ippTools/src/camtoolConfig.c	(revision 14023)
@@ -50,8 +50,8 @@
     psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-chip_id",  0,
             "search by chip_id", NULL);
-    psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_tag",  0,
-            "search by exp_tag", NULL);
     psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_id",  0,
             "search by exp_id", NULL);
+    psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_name",  0,
+            "search by exp_name", NULL);
     psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-inst",  0,
             "search by camera", NULL);
Index: /trunk/ippTools/src/chiptool.c
===================================================================
--- /trunk/ippTools/src/chiptool.c	(revision 14022)
+++ /trunk/ippTools/src/chiptool.c	(revision 14023)
@@ -132,6 +132,6 @@
 
     psMetadata *where = psMetadataAlloc();
-    ADDPARAMSTR(config->args, where, "exp_tag");
     ADDPARAMSTR(config->args, where, "exp_id");
+    ADDPARAMSTR(config->args, where, "exp_name");
     ADDRENAMEPARAMSTR(config->args, where, "inst", "camera");
     ADDPARAMSTR(config->args, where, "telescope");
@@ -190,5 +190,5 @@
     }
 
-    // find the exp_tag of all the exposures that we want to queue up.
+    // find the exp_id of all the exposures that we want to queue up.
     psString query = pxDataGet("chiptool_find_rawexp.sql");
     if (!query) {
@@ -230,11 +230,11 @@
     }
 
-    // loop over our list of exp_tags
+    // loop over our list of exp_ids
     for (long i = 0; i < psArrayLength(output); i++) {
         psMetadata *md = output->data[i];
 
-        psString exp_tag = psMetadataLookupStr(&status, md, "exp_tag");
+        psString exp_id = psMetadataLookupStr(&status, md, "exp_id");
         if (!status) {
-            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_tag");
+            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_id");
             psFree(output);
             return false;
@@ -242,10 +242,10 @@
 
         // queue the exp
-        if (!pxchipQueueByExpTag(config, exp_tag, workdir, label, reduction, expgroup, dvodb)) {
+        if (!pxchipQueueByExpTag(config, exp_id, workdir, label, reduction, expgroup, dvodb)) {
             if (!psDBRollback(config->dbh)) {
                 psError(PS_ERR_UNKNOWN, false, "database error");
             }
             psError(PS_ERR_UNKNOWN, false,
-                    "failed to trying to queue exp_tag: %s", exp_tag);
+                    "failed to trying to queue exp_id: %s", exp_id);
             psFree(output);
             return false;
@@ -357,11 +357,11 @@
     }
 
-    psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
-        return false;
-    }
-    if (!exp_tag) {
-        psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
+    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
+        return false;
+    }
+    if (!exp_id) {
+        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
         return false;
     }
@@ -511,6 +511,6 @@
 
     chipProcessedImfileRow *imfile = chipProcessedImfileRowAlloc(
-        (psU64)atoll(chip_id),
-        exp_tag,
+        (psS64)atoll(chip_id),
+        (psS64)atoll(exp_id),
         class_id,
         uri,
Index: /trunk/ippTools/src/chiptoolConfig.c
===================================================================
--- /trunk/ippTools/src/chiptoolConfig.c	(revision 14022)
+++ /trunk/ippTools/src/chiptoolConfig.c	(revision 14023)
@@ -46,8 +46,8 @@
     // -queue
     psMetadata *queueArgs = psMetadataAlloc();
-    psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_tag",  0,
-            "search by exp_tag", NULL);
     psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_id",  0,
             "search by exp_id", NULL);
+    psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_name",  0,
+            "search by exp_name", NULL);
     psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-inst",  0,
             "search by camera", NULL);
@@ -106,5 +106,5 @@
     psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-chip_id",  0,
             "search by chip ID", NULL);
-    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
             "search by exposure ID", NULL);
     psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class",  0,
@@ -127,5 +127,5 @@
     psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-chip_id",  0,
             "define chip ID (required)", NULL);
-    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
             "define exposure ID", NULL);
     psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
@@ -181,5 +181,5 @@
     psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-chip_id",  0,
             "define chip ID", NULL);
-    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
             "define exposure ID", NULL);
     psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-class",  0,
@@ -204,5 +204,5 @@
     psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-chip_id",  0,
             "define chip ID", NULL);
-    psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
             "search by exposure ID", NULL);
     psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-class",  0,
@@ -217,5 +217,5 @@
     psMetadataAddStr(retryprocessedimfileArgs, PS_LIST_TAIL, "-chip_id",  0,
             "define chip ID (required)", NULL);
-    psMetadataAddStr(retryprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(retryprocessedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
             "search by exposure ID", NULL);
     psMetadataAddStr(retryprocessedimfileArgs, PS_LIST_TAIL, "-class",  0,
@@ -294,5 +294,5 @@
 }
 
-    addWhereStr(exp_tag);
+    addWhereStr(exp_id);
     // convert '-inst' to 'camera'
     {
Index: /trunk/ippTools/src/detselectConfig.c
===================================================================
--- /trunk/ippTools/src/detselectConfig.c	(revision 14022)
+++ /trunk/ippTools/src/detselectConfig.c	(revision 14023)
@@ -183,5 +183,5 @@
     addWhereStr(det_id);
     addWhereS32(iteration);
-    addWhereStr(exp_tag);
+    addWhereStr(exp_id);
     // convert '-inst' to 'camera'
     {
Index: /trunk/ippTools/src/dettool.c
===================================================================
--- /trunk/ippTools/src/dettool.c	(revision 14022)
+++ /trunk/ippTools/src/dettool.c	(revision 14023)
@@ -173,7 +173,7 @@
         " FROM rawExp"
         " LEFT JOIN detInputExp"
-        "   ON rawExp.exp_tag = detInputExp.exp_tag"
+        "   ON rawExp.exp_id = detInputExp.exp_id"
         " WHERE"
-        "    detInputExp.exp_tag IS NULL"
+        "    detInputExp.exp_id IS NULL"
         "    AND rawExp.obstype != 'object'"
     );
@@ -461,14 +461,14 @@
     }
 
-    // we have to support multipe exp_tags
-    psMetadataItem *item = psMetadataLookup(config->args, "-exp_tag");
+    // we have to support multipe exp_ids
+    psMetadataItem *item = psMetadataLookup(config->args, "-exp_id");
     if (!item) {
         // this shouldn't actually happen when using psArgs
-        psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
+        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
         return false;
     }
     psMetadata *where = psMetadataAlloc();
 
-    // make sure that -exp_tag was parsed correctly
+    // make sure that -exp_id was parsed correctly
     // XXX this can be removed someday
     if (item->type == PS_DATA_METADATA_MULTI) {
@@ -476,17 +476,17 @@
         psMetadataItem *mItem = NULL;
         while ((mItem = psListGetAndIncrement(iter))) {
-            psString exp_tag = mItem->data.V;
-            // if exp_tag is NULL then it means that -exp_tag has not been
+            psString exp_id = mItem->data.V;
+            // if exp_id is NULL then it means that -exp_id has not been
             // specified
-            if (!exp_tag) {
+            if (!exp_id) {
                 psError(PS_ERR_UNKNOWN, true,
-                        "at least one -exp_tag is required");
+                        "at least one -exp_id is required");
                 psFree(where);
                 return false;
             }
 
-            if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_tag",
-                 PS_META_DUPLICATE_OK, "==", exp_tag)) {
-                psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
+            if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id",
+                 PS_META_DUPLICATE_OK, "==", exp_id)) {
+                psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
                 psFree(iter);
                 psFree(where);
@@ -496,5 +496,5 @@
         psFree(iter);
     } else {
-        psAbort(                "-exp_tag was not parsed correctly (this should not happen");
+        psAbort(                "-exp_id was not parsed correctly (this should not happen");
     }
 
@@ -504,5 +504,5 @@
     }
 
-    // check that the specified exp_tags actually exist
+    // check that the specified exp_ids actually exist
     psArray *detrendExps = rawExpSelectRowObjects(config->dbh, where, 0);
     psFree(where);
@@ -512,7 +512,7 @@
     }
 
-    // we should have one rawExp row per exp_tag specified
+    // we should have one rawExp row per exp_id specified
     if (psListLength(item->data.list) != psArrayLength(detrendExps)) {
-        psAbort(    "an -exp_tag matched more then one rawExp (this should not happen");
+        psAbort(    "an -exp_id matched more then one rawExp (this should not happen");
 
     }
@@ -1768,9 +1768,9 @@
         "       %d,"
         "       0,"
-        "       detResidExp.exp_tag,"
+        "       detResidExp.exp_id,"
         "       detResidExp.accept"
         "   FROM detResidExp"
         "   JOIN rawExp"
-        "       USING(exp_tag)"
+        "       USING(exp_id)"
         "   WHERE det_id = %d"
     );
@@ -1979,5 +1979,5 @@
         det_id,
         iteration,
-        rawExp->exp_tag,
+        rawExp->exp_id,
         true            // use
     );
@@ -1991,5 +1991,5 @@
     // select rawExp.*
     // by:
-    // exp_tag
+    // exp_id
 
     psString query = psStringCopy(
@@ -1997,5 +1997,5 @@
         " FROM detInputExp"
         " JOIN rawExp"
-        " USING(exp_tag)"
+        " USING(exp_id)"
         );
 
@@ -2058,7 +2058,7 @@
             " FROM rawImfile"
             " JOIN detInputExp"
-            "   USING(exp_tag) "
+            "   USING(exp_id) "
             " JOIN rawExp"
-            "   USING(exp_tag) "
+            "   USING(exp_id) "
             " JOIN detRun"
             "   ON detInputExp.det_id = detRun.det_id"
@@ -2130,7 +2130,7 @@
     //
     // det_id is in detInputExp
-    // exp_tag is in detInputExp
+    // exp_id is in detInputExp
     // det_id is not in detProccessedImfile
-    // exp_tag is not in detProccessedImfile
+    // exp_id is not in detProccessedImfile
     // class_is is not in detProccessedImfile
     psString query = psStringCopy(
@@ -2146,10 +2146,10 @@
             "    USING(det_id, iteration)"
             " JOIN rawExp"
-            "    ON detInputExp.exp_tag = rawExp.exp_tag"
+            "    ON detInputExp.exp_id = rawExp.exp_id"
             " JOIN rawImfile"
-            "    ON detInputExp.exp_tag = rawImfile.exp_tag"
+            "    ON detInputExp.exp_id = rawImfile.exp_id"
             " LEFT JOIN detProcessedImfile"
             "   ON detInputExp.det_id = detProcessedImfile.det_id"
-            "   AND rawImfile.exp_tag = detProcessedImfile.exp_tag"
+            "   AND rawImfile.exp_id = detProcessedImfile.exp_id"
             "   AND rawImfile.class_id = detProcessedImfile.class_id"
             " WHERE"
@@ -2157,5 +2157,5 @@
             "   AND detRun.mode = 'master'"
             "   AND detProcessedImfile.det_id IS NULL"
-            "   AND detProcessedImfile.exp_tag IS NULL"
+            "   AND detProcessedImfile.exp_id IS NULL"
             "   AND detProcessedImfile.class_id IS NULL"
         );
@@ -2223,5 +2223,5 @@
     }
 
-    // select exp_tags from detInputExp matching det_idp
+    // select exp_ids from detInputExp matching det_idp
     // where query should be pre-generated
     psArray *detInputExp =
@@ -2232,14 +2232,14 @@
     }
 
-    // generate where query with just the exp_tags
-    psMetadata *where_exp_tags = psMetadataAlloc();
+    // generate where query with just the exp_ids
+    psMetadata *where_exp_ids = psMetadataAlloc();
     for (long i = 0; i < psArrayLength(detInputExp); i++) {
         detInputExpRow *row = detInputExp->data[i];
-        if (!psMetadataAddStr(where_exp_tags, PS_LIST_TAIL, "exp_tag",
-                PS_META_DUPLICATE_OK, "==", row->exp_tag)
+        if (!psMetadataAddS64(where_exp_ids, PS_LIST_TAIL, "exp_id",
+                PS_META_DUPLICATE_OK, "==", row->exp_id)
         ) {
-            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
+            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
             psFree(detInputExp);
-            psFree(where_exp_tags);
+            psFree(where_exp_ids);
             return NULL;
         }
@@ -2247,8 +2247,8 @@
     psFree(detInputExp);
 
-    // select rawImfiles with matching exp_tags
+    // select rawImfiles with matching exp_ids
     psArray *rawImfiles =
-        rawImfileSelectRowObjects(config->dbh, where_exp_tags, 0);
-    psFree(where_exp_tags);
+        rawImfileSelectRowObjects(config->dbh, where_exp_ids, 0);
+    psFree(where_exp_ids);
     if (!rawImfiles) {
         psError(PS_ERR_UNKNOWN, false, "no rawImfile rows found");
@@ -2263,5 +2263,5 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
-    // det_id, exp_tag, class_id, uri, recipe, -bg, -bg_stdev
+    // det_id, exp_id, class_id, uri, recipe, -bg, -bg_stdev
     // are required
     bool status = false;
@@ -2275,11 +2275,11 @@
         return false;
     }
-    psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
-        return false;
-    }
-    if (!exp_tag) {
-        psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
+    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
+        return false;
+    }
+    if (!exp_id) {
+        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
         return false;
     }
@@ -2384,8 +2384,8 @@
     }
 
-    // find the matching rawImfile by exp_tag/class_id
+    // find the matching rawImfile by exp_id/class_id
     psMetadata *where = psMetadataAlloc();
-    if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_tag", 0, "==", exp_tag)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
+    if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
         psFree(where);
         return false;
@@ -2415,5 +2415,5 @@
     detProcessedImfileRow *detRow = detProcessedImfileRowAlloc(
         (psS32)atol(det_id),
-        exp_tag,
+        (psS64)atoll(exp_id),
         class_id,
         uri,
@@ -2461,10 +2461,10 @@
     // select detRun.iteration
     // select detRun.det_type
-    // select detProcessedImfile.exp_tag
+    // select detProcessedImfile.exp_id
     // by:
     // find the current iteration bassed on det_id
-    // find all exp_tags in the current det_id/iteration from detInputExp
-    // find all rawImfiles in the current exp_tags
-    // compare to detProcessedImfiles by det_id/exp_tag
+    // find all exp_ids in the current det_id/iteration from detInputExp
+    // find all rawImfiles in the current exp_ids
+    // compare to detProcessedImfiles by det_id/exp_id
     // found how many imfile there are in each class_id
     // and:
@@ -2477,5 +2477,5 @@
         "    iteration,"
         "    det_type,"
-        "    exp_tag,"
+        "    exp_id,"
         "    camera,"
         "    workdir"
@@ -2486,5 +2486,5 @@
         "    detRun.det_type,"
         "    detRun.workdir,"
-        "    detProcessedImfile.exp_tag,"
+        "    detProcessedImfile.exp_id,"
         "    rawExp.camera,"
         "    detProcessedImfile.class_id,"
@@ -2494,14 +2494,14 @@
         "   USING(det_id, iteration)"
         " JOIN rawExp"
-        "   ON detInputExp.exp_tag = rawExp.exp_tag"
+        "   ON detInputExp.exp_id = rawExp.exp_id"
         " JOIN rawImfile"
-        "   ON rawExp.exp_tag = rawImfile.exp_tag"
+        "   ON rawExp.exp_id = rawImfile.exp_id"
         " LEFT JOIN detProcessedImfile"
         "   ON detRun.det_id = detProcessedImfile.det_id"
-        "   AND detInputExp.exp_tag = detProcessedImfile.exp_tag"
+        "   AND detInputExp.exp_id = detProcessedImfile.exp_id"
         "   AND rawImfile.class_id = detProcessedImfile.class_id"
         " LEFT JOIN detProcessedExp"
         "   ON detProcessedImfile.det_id = detProcessedExp.det_id"
-        "   AND detProcessedImfile.exp_tag = detProcessedExp.exp_tag"
+        "   AND detProcessedImfile.exp_id = detProcessedExp.exp_id"
         " WHERE"
         "   detRun.state = 'run'"
@@ -2509,8 +2509,8 @@
         "   AND detProcessedImfile.fault = 0"
         "   AND detProcessedExp.det_id IS NULL"
-        "   AND detProcessedExp.exp_tag IS NULL"
+        "   AND detProcessedExp.exp_id IS NULL"
         "   AND detInputExp.include = 1"
         " GROUP BY"
-        "    rawExp.exp_tag,"
+        "    rawExp.exp_id,"
         "    detRun.det_id"
         " HAVING"
@@ -2579,5 +2579,5 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
-    // det_id, exp_tag, recip, -bg, -bg_stdev
+    // det_id, exp_id, recip, -bg, -bg_stdev
     // are required
     bool status = false;
@@ -2591,11 +2591,11 @@
         return false;
     }
-    psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
-        return false;
-    }
-    if (!exp_tag) {
-        psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
+    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
+        return false;
+    }
+    if (!exp_id) {
+        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
         return false;
     }
@@ -2693,5 +2693,5 @@
         "    detRun.iteration,"
         "    detRun.det_type,"
-        "    detProcessedImfile.exp_tag"
+        "    detProcessedImfile.exp_id"
         " FROM detRun"
         " JOIN detInputExp"
@@ -2699,13 +2699,13 @@
         "    AND detRun.iteration = detInputExp.iteration"
         " JOIN rawExp"
-        "    ON detInputExp.exp_tag = rawExp.exp_tag"
+        "    ON detInputExp.exp_id = rawExp.exp_id"
         " JOIN detProcessedImfile"
         "    ON detInputExp.det_id = detProcessedImfile.det_id"
-        "    AND detInputExp.exp_tag = detProcessedImfile.exp_tag"
+        "    AND detInputExp.exp_id = detProcessedImfile.exp_id"
         " LEFT JOIN detProcessedExp"
         "    ON detInputExp.det_id = detProcessedExp.det_id"
-        "    AND detProcessedImfile.exp_tag= detProcessedExp.exp_tag"
+        "    AND detProcessedImfile.exp_id= detProcessedExp.exp_id"
         " LEFT JOIN rawImfile"
-        "    ON detInputExp.exp_tag = rawImfile.exp_tag"
+        "    ON detInputExp.exp_id = rawImfile.exp_id"
         "    AND detProcessedImfile.class_id = rawImfile.class_id"
         " WHERE"
@@ -2713,8 +2713,8 @@
         "   AND detRun.mode = 'master'"
         "   AND detProcessedExp.det_id IS NULL"
-        "   AND detProcessedExp.exp_tag IS NULL"
+        "   AND detProcessedExp.exp_id IS NULL"
         "   AND detInputExp.include = 1"
         "   AND detRun.det_id = %s"
-        "   AND detProcessedImfile.exp_tag = '%s'"
+        "   AND detProcessedImfile.exp_id = '%s'"
         " GROUP BY"
         "    detProcessedImfile.class_id,"
@@ -2725,5 +2725,5 @@
         );
 
-    if (!p_psDBRunQuery(config->dbh, query, det_id, exp_tag)) {
+    if (!p_psDBRunQuery(config->dbh, query, det_id, exp_id)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
         psFree(query);
@@ -2747,5 +2747,5 @@
     detProcessedExpRow *detRow = detProcessedExpRowAlloc(
         (psS32)atol(det_id),
-        exp_tag,
+        (psS64)atoll(exp_id),
         recipe,
         bg,
@@ -2872,7 +2872,7 @@
     // by:
     // find the current iteration bassed on det_id
-    // find all exp_tags in the current det_id/iteration from detInputExp
-    // find all rawImfiles in the current exp_tags
-    // compare to detProcessedImfiles by det_id/exp_tag
+    // find all exp_ids in the current det_id/iteration from detInputExp
+    // find all rawImfiles in the current exp_ids
+    // compare to detProcessedImfiles by det_id/exp_id
     // found how many imfile there are in each class_id
     // and:
@@ -2895,10 +2895,10 @@
         "    AND detRun.iteration = detInputExp.iteration\n"
         " JOIN rawExp\n"
-        "    ON detInputExp.exp_tag = rawExp.exp_tag\n"
+        "    ON detInputExp.exp_id = rawExp.exp_id\n"
         " JOIN rawImfile\n"
-        "    ON detInputExp.exp_tag = rawImfile.exp_tag\n"
+        "    ON detInputExp.exp_id = rawImfile.exp_id\n"
         " LEFT JOIN detProcessedImfile\n"
         "    ON detInputExp.det_id = detProcessedImfile.det_id\n"
-        "    AND detInputExp.exp_tag = detProcessedImfile.exp_tag\n"
+        "    AND detInputExp.exp_id = detProcessedImfile.exp_id\n"
         "    AND rawImfile.class_id = detProcessedImfile.class_id\n"
         " LEFT JOIN detStackedImfile\n"
@@ -3007,7 +3007,7 @@
         "   ON detRun.det_id = detInputExp.det_id"
         "   AND detRun.iteration = detInputExp.iteration"
-        "   AND detProcessedImfile.exp_tag = detInputExp.exp_tag"
+        "   AND detProcessedImfile.exp_id = detInputExp.exp_id"
         " JOIN rawExp"
-        "   ON rawExp.exp_tag = detProcessedImfile.exp_tag"
+        "   ON rawExp.exp_id = detProcessedImfile.exp_id"
         " WHERE"
     );
@@ -3213,5 +3213,5 @@
     if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==",
             (psS64)atoll(det_id))) {
-        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
+        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
         psFree(where);
         return false;
@@ -3377,5 +3377,5 @@
     // by:
     // find the current iteration bassed on det_id
-    // find all exp_tags in the current det_id/iteration from detInputExp
+    // find all exp_ids in the current det_id/iteration from detInputExp
     // sort to detInputExp.imfiles to find the largest value per det_id/iter
     // compare imfiles to the number of detStackedImfiles by class_id
@@ -3407,5 +3407,5 @@
         "   AND detRun.iteration = detInputExp.iteration"
         " JOIN rawExp"
-        "   ON detInputExp.exp_tag = rawExp.exp_tag"
+        "   ON detInputExp.exp_id = rawExp.exp_id"
         " JOIN detStackedImfile"
         "   ON detInputExp.det_id = detStackedImfile.det_id"
@@ -3423,5 +3423,5 @@
         "   AND detNormalizedStatImfile.class_id IS NULL"
         " GROUP BY"
-        "   rawExp.exp_tag,"
+        "   rawExp.exp_id,"
         "   detRun.iteration,"
         "   detRun.det_id"
@@ -3633,5 +3633,5 @@
         "   USING(det_id, iteration)"
         " JOIN rawExp"
-        "   ON detInputExp.exp_tag = rawExp.exp_tag"
+        "   ON detInputExp.exp_id = rawExp.exp_id"
         " JOIN detNormalizedStatImfile"
         "   ON detStackedImfile.det_id = detNormalizedStatImfile.det_id"
@@ -3774,8 +3774,8 @@
         psMetadata *where = psMetadataAlloc();
         for (long i = 0; i < psArrayLength(inputExps); i++) {
-            if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_tag",
+            if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id",
                     PS_META_DUPLICATE_OK, "==",
-                    ((detInputExpRow *)inputExps->data[i])->exp_tag)) {
-                psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
+                    ((detInputExpRow *)inputExps->data[i])->exp_id)) {
+                psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
                 psFree(inputExps);
                 psFree(where);
@@ -3963,10 +3963,10 @@
         "    AND detRun.iteration = detInputExp.iteration"
         " JOIN rawExp"
-        "    ON detInputExp.exp_tag = rawExp.exp_tag"
+        "    ON detInputExp.exp_id = rawExp.exp_id"
         " JOIN detNormalizedImfile"
         "    ON detInputExp.det_id = detNormalizedImfile.det_id"
         "    AND detInputExp.iteration = detNormalizedImfile.iteration"
         " LEFT JOIN rawImfile"
-        "    ON detInputExp.exp_tag = rawImfile.exp_tag"
+        "    ON detInputExp.exp_id = rawImfile.exp_id"
         "    AND detNormalizedImfile.class_id = rawImfile.class_id"
         " LEFT JOIN detNormalizedExp"
@@ -4152,10 +4152,10 @@
         "    AND detRun.iteration = detInputExp.iteration"
         " JOIN rawExp"
-        "    ON detInputExp.exp_tag = rawExp.exp_tag"
+        "    ON detInputExp.exp_id = rawExp.exp_id"
         " JOIN detNormalizedImfile"
         "    ON detInputExp.det_id = detNormalizedImfile.det_id"
         "    AND detInputExp.iteration = detNormalizedImfile.iteration"
         " LEFT JOIN rawImfile"
-        "    ON detInputExp.exp_tag = rawImfile.exp_tag"
+        "    ON detInputExp.exp_id = rawImfile.exp_id"
         "    AND detNormalizedImfile.class_id = rawImfile.class_id"
         " LEFT JOIN detNormalizedExp"
@@ -4437,5 +4437,5 @@
         "   detRun.workdir,\n"
         "   detRun.reduction,\n"
-        "   detProcessedImfile.exp_tag,\n"
+        "   detProcessedImfile.exp_id,\n"
         "   detProcessedImfile.class_id,\n"
         "   detProcessedImfile.uri,\n"
@@ -4446,8 +4446,8 @@
         "   USING(det_id, iteration)\n"
         " JOIN rawExp\n"
-        "   ON detInputExp.exp_tag = rawExp.exp_tag\n"
+        "   ON detInputExp.exp_id = rawExp.exp_id\n"
         " JOIN detProcessedImfile\n"
         "   ON detRun.det_id = detProcessedImfile.det_id\n"
-        "   AND detInputExp.exp_tag = detProcessedImfile.exp_tag\n"
+        "   AND detInputExp.exp_id = detProcessedImfile.exp_id\n"
         " JOIN detNormalizedImfile\n"
         "   ON detRun.det_id = detNormalizedImfile.det_id\n"
@@ -4457,5 +4457,5 @@
         "   ON detRun.det_id = detResidImfile.det_id\n"
         "   AND detRun.iteration = detResidImfile.iteration\n"
-        "   AND detProcessedImfile.exp_tag = detResidImfile.exp_tag\n"
+        "   AND detProcessedImfile.exp_id = detResidImfile.exp_id\n"
         "   AND detProcessedImfile.class_id = detResidImfile.class_id\n"
         " WHERE\n"
@@ -4465,5 +4465,5 @@
         "   AND detResidImfile.det_id IS NULL\n"
         "   AND detResidImfile.iteration IS NULL\n"
-        "   AND detResidImfile.exp_tag IS NULL\n"
+        "   AND detResidImfile.exp_id IS NULL\n"
         "   AND detResidImfile.class_id IS NULL\n"
         " UNION"
@@ -4475,5 +4475,5 @@
         "   detRun.workdir,\n"
         "   detRun.reduction,\n"
-        "   rawImfile.exp_tag,\n"
+        "   rawImfile.exp_id,\n"
         "   rawImfile.class_id,\n"
         "   rawImfile.uri,\n"
@@ -4484,11 +4484,11 @@
         "    USING(det_id, iteration)\n"
         " JOIN rawExp\n"
-        "    ON detInputExp.exp_tag = rawExp.exp_tag\n"
+        "    ON detInputExp.exp_id = rawExp.exp_id\n"
         " JOIN rawImfile\n"
-        "    ON detInputExp.exp_tag = rawImfile.exp_tag\n"
+        "    ON detInputExp.exp_id = rawImfile.exp_id\n"
         " LEFT JOIN detResidImfile\n"
         "   ON detRun.det_id = detResidImfile.det_id\n"
         "   AND detRun.iteration = detResidImfile.iteration\n"
-        "   AND rawImfile.exp_tag = detResidImfile.exp_tag\n"
+        "   AND rawImfile.exp_id = detResidImfile.exp_id\n"
         "   AND rawImfile.class_id = detResidImfile.class_id\n"
         " WHERE\n"
@@ -4497,5 +4497,5 @@
         "   AND detResidImfile.det_id IS NULL\n"
         "   AND detResidImfile.iteration IS NULL\n"
-        "   AND detResidImfile.exp_tag IS NULL\n"
+        "   AND detResidImfile.exp_id IS NULL\n"
         "   AND detResidImfile.class_id IS NULL\n"
         );
@@ -4658,5 +4658,5 @@
 
     // make sure that there is a coresponding entry in detNormalizedImfile
-    // and the exp_tag specified is valid
+    // and the exp_id specified is valid
     // select * from detNormalizedImfile
     // by det_id, iteration, class_id
@@ -4674,5 +4674,5 @@
         "   ON detRun.det_id = detResidImfile.det_id\n"
         "   AND detRun.iteration = detResidImfile.iteration\n"
-        "   AND detInputExp.exp_tag = detResidImfile.exp_tag\n"
+        "   AND detInputExp.exp_id = detResidImfile.exp_id\n"
         "   AND detNormalizedImfile.class_id = detResidImfile.class_id\n"
         " WHERE\n"
@@ -4681,5 +4681,5 @@
         "  AND detResidImfile.det_id IS NULL\n"
         "  AND detResidImfile.iteration IS NULL\n"
-        "  AND detResidImfile.exp_tag IS NULL\n"
+        "  AND detResidImfile.exp_id IS NULL\n"
         "  AND detResidImfile.class_id IS NULL\n"
         " UNION\n"
@@ -4703,11 +4703,11 @@
         "    USING(det_id, iteration)\n"
         " JOIN rawExp\n"
-        "    ON detInputExp.exp_tag = rawExp.exp_tag\n"
+        "    ON detInputExp.exp_id = rawExp.exp_id\n"
         " JOIN rawImfile\n"
-        "    ON detInputExp.exp_tag = rawImfile.exp_tag\n"
+        "    ON detInputExp.exp_id = rawImfile.exp_id\n"
         " LEFT JOIN detResidImfile\n"
         "   ON detRun.det_id = detResidImfile.det_id\n"
         "   AND detRun.iteration = detResidImfile.iteration\n"
-        "   AND rawImfile.exp_tag = detResidImfile.exp_tag\n"
+        "   AND rawImfile.exp_id = detResidImfile.exp_id\n"
         "   AND rawImfile.class_id = detResidImfile.class_id\n"
         " WHERE\n"
@@ -4716,7 +4716,7 @@
         "   AND detResidImfile.det_id IS NULL\n"
         "   AND detResidImfile.iteration IS NULL\n"
-        "   AND detResidImfile.exp_tag IS NULL\n"
+        "   AND detResidImfile.exp_id IS NULL\n"
         "   AND detResidImfile.class_id IS NULL\n"
-        "   AND detInputExp.exp_tag = '%1$s'\n"
+        "   AND detInputExp.exp_id = '%1$s'\n"
         ") AS foo\n"
         "  %2$s"
@@ -4776,15 +4776,15 @@
     psFree(where);
 
-    // exp_tag is manadatory to cross check that this is a exp_tag for this
+    // exp_id is manadatory to cross check that this is a exp_id for this
     // detRun
-    psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
+    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
         psFree(whereClause);
         psFree(query);
         return false;
     }
-    if (!exp_tag) {
-        psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
+    if (!exp_id) {
+        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
         psFree(whereClause);
         psFree(query);
@@ -4792,5 +4792,5 @@
     }
 
-    if (!p_psDBRunQuery(config->dbh, query, exp_tag, whereClause)) {
+    if (!p_psDBRunQuery(config->dbh, query, exp_id, whereClause)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
         psFree(whereClause);
@@ -4862,11 +4862,11 @@
 
     bool status = false;
-    psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
-        return false;
-    }
-    if (!exp_tag) {
-        psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
+    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
+        return false;
+    }
+    if (!exp_id) {
+        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
         return false;
     }
@@ -4979,5 +4979,5 @@
             normalizedImfile->det_id,
             normalizedImfile->iteration,
-            exp_tag,
+            (psS64)atoll(exp_id),
             normalizedImfile->class_id,
             uri,
@@ -5020,5 +5020,5 @@
     // select detResidImfile.*
     // by:
-    // where det_id, iteration, exp_tag is not in detResidExp;
+    // where det_id, iteration, exp_id is not in detResidExp;
 
     psString query = psStringCopy(
@@ -5032,5 +5032,5 @@
         "   USING(det_id, iteration)"
         " JOIN rawExp"
-        "   USING(exp_tag)"
+        "   USING(exp_id)"
         " WHERE"
     );
@@ -5128,12 +5128,12 @@
     // select detRun.iteration
     // select detRun.det_type
-    // select detInputExp.exp_tag
+    // select detInputExp.exp_id
     // select detInputExp.include
     // by:
     // find the current iteration bassed on det_id
-    // find all exp_tags in the current det_id/iteration from detInputExp
+    // find all exp_ids in the current det_id/iteration from detInputExp
     // compare to detInputExp.imfiles to derResidImfile by class_id
     // and:
-    // detResidImfile.{det_id, iteration, exp_tag} is not in detResidExp
+    // detResidImfile.{det_id, iteration, exp_id} is not in detResidExp
 
     psString query = psStringCopy(
@@ -5143,5 +5143,5 @@
         "   det_type,\n"
         "   mode,\n"
-        "   exp_tag,\n"
+        "   exp_id,\n"
         "   include,\n"
         "   camera,\n"
@@ -5154,5 +5154,5 @@
         "       detRun.mode,\n"
         "       detRun.workdir,\n"
-        "       detInputExp.exp_tag,\n"
+        "       detInputExp.exp_id,\n"
         "       detInputExp.include,\n"
         "       rawExp.imfiles,\n"
@@ -5163,13 +5163,13 @@
         "       USING(det_id, iteration)\n"
         "   JOIN rawExp\n"
-        "       ON detInputExp.exp_tag = rawExp.exp_tag\n"
+        "       ON detInputExp.exp_id = rawExp.exp_id\n"
         "   JOIN detResidImfile\n"
         "       ON detRun.det_id = detResidImfile.det_id\n"
         "       AND detRun.iteration = detResidImfile.iteration\n"
-        "       AND detInputExp.exp_tag = detResidImfile.exp_tag\n"
+        "       AND detInputExp.exp_id = detResidImfile.exp_id\n"
         "   LEFT JOIN detResidExp\n"
         "       ON detResidImfile.det_id = detResidExp.det_id\n"
         "       AND detResidImfile.iteration = detResidExp.iteration\n"
-        "       AND detResidImfile.exp_tag = detResidExp.exp_tag\n"
+        "       AND detResidImfile.exp_id = detResidExp.exp_id\n"
         "   WHERE\n"
         "       detRun.state = 'run'\n"
@@ -5177,7 +5177,7 @@
         "       AND detResidExp.det_id IS NULL\n"
         "       AND detResidExp.iteration IS NULL\n"
-        "       AND detResidExp.exp_tag IS NULL\n"
+        "       AND detResidExp.exp_id IS NULL\n"
         "   GROUP BY\n"
-        "       detInputExp.exp_tag,\n"
+        "       detInputExp.exp_id,\n"
         "       detRun.iteration,\n"
         "       detRun.det_id\n"
@@ -5258,12 +5258,12 @@
     // select detRun.iteration
     // select detRun.det_type
-    // select detInputExp.exp_tag
+    // select detInputExp.exp_id
     // select detInputExp.include
     // by:
     // find the current iteration bassed on det_id
-    // find all exp_tags in the current det_id/iteration from detInputExp
+    // find all exp_ids in the current det_id/iteration from detInputExp
     // compare to detInputExp.imfiles to derResidImfile by class_id
     // and:
-    // detResidImfile.{det_id, iteration, exp_tag} is not in detResidExp
+    // detResidImfile.{det_id, iteration, exp_id} is not in detResidExp
 
     psString query = psStringCopy(
@@ -5271,5 +5271,5 @@
         "   det_id,"
         "   iteration,"
-        "   exp_tag,"
+        "   exp_id,"
         "   include"
         " FROM"
@@ -5278,5 +5278,5 @@
         "       detRun.iteration,"
         "       detRun.det_type,"
-        "       detInputExp.exp_tag,"
+        "       detInputExp.exp_id,"
         "       detInputExp.include,"
         "       rawExp.imfiles"
@@ -5285,20 +5285,20 @@
         "       USING(det_id, iteration)"
         "   JOIN rawExp"
-        "       ON detInputExp.exp_tag = rawExp.exp_tag"
+        "       ON detInputExp.exp_id = rawExp.exp_id"
         "   JOIN detResidImfile"
         "       ON detRun.det_id = detResidImfile.det_id"
         "       AND detRun.iteration = detResidImfile.iteration"
-        "       AND detInputExp.exp_tag = detResidImfile.exp_tag"
+        "       AND detInputExp.exp_id = detResidImfile.exp_id"
         "   LEFT JOIN detResidExp"
         "       ON detResidImfile.det_id = detResidExp.det_id"
         "       AND detResidImfile.iteration = detResidExp.iteration"
-        "       AND detResidImfile.exp_tag = detResidExp.exp_tag"
+        "       AND detResidImfile.exp_id = detResidExp.exp_id"
         "   WHERE"
         "       detRun.state = 'run'"
         "       AND detResidExp.det_id IS NULL"
         "       AND detResidExp.iteration IS NULL"
-        "       AND detResidExp.exp_tag IS NULL"
+        "       AND detResidExp.exp_id IS NULL"
         "   GROUP BY"
-        "       detInputExp.exp_tag,"
+        "       detInputExp.exp_id,"
         "       detRun.iteration,"
         "       detRun.det_id"
@@ -5309,5 +5309,5 @@
 
     {
-        // build a query to search by det_id, iteration, exp_tag
+        // build a query to search by det_id, iteration, exp_id
         psMetadata *where = psMetadataAlloc();
         bool status = false;
@@ -5342,14 +5342,14 @@
             return false;
         }
-        psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
-        if (!status) {
-            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
+        psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
+        if (!status) {
+            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
             psFree(where);
             psFree(query);
             return false;
         }
-        if (exp_tag) {
-            if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_tag", 0, "==", exp_tag)) {
-                psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
+        if (exp_id) {
+            if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) {
+                psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
                 psFree(where);
                 psFree(query);
@@ -5448,11 +5448,11 @@
         return false;
     }
-    psString exp_tag = psMetadataLookupStr(&status, row, "exp_tag");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_tag");
-        return false;
-    }
-    if (!exp_tag) {
-        psError(PS_ERR_UNKNOWN, true, "exp_tag is required");
+    psString exp_id = psMetadataLookupStr(&status, row, "exp_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_id");
+        return false;
+    }
+    if (!exp_id) {
+        psError(PS_ERR_UNKNOWN, true, "exp_id is required");
         return false;
     }
@@ -5565,5 +5565,5 @@
             det_id,
             iteration,
-            exp_tag,
+            (psS64)atoll(exp_id),
             recipe,
             bg,
@@ -5611,5 +5611,5 @@
         "   USING(det_id, iteration)"
         " JOIN detResidExp"
-        "   USING(det_id, iteration, exp_tag)"
+        "   USING(det_id, iteration, exp_id)"
         " WHERE"
         "   detRun.state = 'run'"
@@ -5697,7 +5697,7 @@
     // by:
     // find the current iteration bassed on det_id
-    // find all exp_tags in the current det_id/iteration from detInputExp
-    // find all exp_tags in the current det_id/iteration from detResidExp
-    // compare the counts of exp_tags
+    // find all exp_ids in the current det_id/iteration from detInputExp
+    // find all exp_ids in the current det_id/iteration from detResidExp
+    // compare the counts of exp_ids
 
     psString query = psStringCopy(
@@ -5716,5 +5716,5 @@
         "       detRun.mode,\n"
         "       detRun.workdir,\n"
-        "       detInputExp.exp_tag,\n"
+        "       detInputExp.exp_id,\n"
         "       rawExp.camera\n"
         "   FROM detRun\n"
@@ -5722,9 +5722,9 @@
         "       USING(det_id, iteration)\n"
         "   JOIN rawExp\n"
-        "       ON detInputExp.exp_tag = rawExp.exp_tag\n"
+        "       ON detInputExp.exp_id = rawExp.exp_id\n"
         "   LEFT JOIN detResidExp\n"
         "       ON detRun.det_id = detResidExp.det_id\n"
         "       AND detRun.iteration = detResidExp.iteration\n"
-        "       AND detInputExp.exp_tag = detResidExp.exp_tag\n"
+        "       AND detInputExp.exp_id = detResidExp.exp_id\n"
         "   WHERE\n"
         "       detRun.state = 'run'\n"
@@ -5733,5 +5733,5 @@
         "       detRun.iteration\n"
         "   HAVING\n"
-        "       COUNT(detResidExp.exp_tag) = COUNT(detInputExp.exp_tag)\n"
+        "       COUNT(detResidExp.exp_id) = COUNT(detInputExp.exp_id)\n"
         " ) AS residdetrun\n"
         );
@@ -5797,5 +5797,5 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
-    // build a query to search by det_id, iteration, exp_tag
+    // build a query to search by det_id, iteration, exp_id
     psMetadata *where = psMetadataAlloc();
     bool status = false;
@@ -5825,13 +5825,13 @@
         return false;
     }
-    psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
+    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
         psFree(where);
         return false;
     }
-    if (exp_tag) {
-        if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_tag", 0, "==", exp_tag)) {
-            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
+    if (exp_id) {
+        if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) {
+            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
             psFree(where);
             return false;
@@ -5840,5 +5840,5 @@
 
     // find the values we're going to set
-    // copy everything but det_id, iteration, & exp_tag from the args and
+    // copy everything but det_id, iteration, & exp_id from the args and
     // remove the '-' prefix
     psMetadata *set = psMetadataAlloc();
@@ -5957,7 +5957,7 @@
     // by:
     // find the current iteration bassed on det_id
-    // find all exp_tags in the current det_id/iteration from detInputExp
-    // find all exp_tags in the current det_id/iteration from detResidExp
-    // compare the counts of exp_tags
+    // find all exp_ids in the current det_id/iteration from detInputExp
+    // find all exp_ids in the current det_id/iteration from detResidExp
+    // compare the counts of exp_ids
 
     psString query = pxDataGet("dettool_find_completed_runs.sql");
@@ -5968,5 +5968,5 @@
 
     {
-        // build a query to search by det_id, iteration, exp_tag
+        // build a query to search by det_id, iteration, exp_id
         psMetadata *where = psMetadataAlloc();
         bool status = false;
@@ -6271,11 +6271,11 @@
     // select detRun.det_id
     // select detRun.iteration
-    // select detInputExp.exp_tag
+    // select detInputExp.exp_id
     // select detResidExp.accept
     // by:
     // find the current iteration bassed on det_id
-    // find all exp_tags in the current det_id/iteration from detInputExp
-    // find all exp_tags in the current det_id/iteration from detResidExp
-    // compare the counts of exp_tags
+    // find all exp_ids in the current det_id/iteration from detInputExp
+    // find all exp_ids in the current det_id/iteration from detResidExp
+    // compare the counts of exp_ids
 
     psString query = psStringCopy(
@@ -6283,5 +6283,5 @@
         "   detRun.det_id AS det_id,"
         "   detRun.iteration,"
-        "   detInputExp.exp_tag,"
+        "   detInputExp.exp_id,"
         "   detResidExp.accept"
         " FROM detRun"
@@ -6292,5 +6292,5 @@
         "   ON detRun.det_id = detResidExp.det_id"
         "   AND detRun.iteration = detResidExp.iteration"
-        "   AND detInputExp.exp_tag = detResidExp.exp_tag"
+        "   AND detInputExp.exp_id = detResidExp.exp_id"
         " WHERE"
         "   detRun.state = 'run'"
@@ -6310,7 +6310,7 @@
         "   detRun.det_id,"
         "   detRun.iteration,"
-        "   detInputExp.exp_tag"
+        "   detInputExp.exp_id"
         " HAVING"
-        "   COUNT(detResidExp.exp_tag) = COUNT(detInputExp.exp_tag)"
+        "   COUNT(detResidExp.exp_id) = COUNT(detInputExp.exp_id)"
         );
 
@@ -6357,5 +6357,5 @@
     for (long i = 0; i < psArrayLength(output); i++) {
         psMetadata *row = output->data[i];
-        psString exp_tag = psMetadataLookupStr(&status, row, "exp_tag");
+        psString exp_id = psMetadataLookupStr(&status, row, "exp_id");
         if (!status) {
             // rollback
@@ -6363,5 +6363,5 @@
                 psError(PS_ERR_UNKNOWN, false, "database error");
             }
-            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_tag");
+            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_id");
             psFree(output);
             return false;
@@ -6383,5 +6383,5 @@
                     (psS32)atol(det_id),
                     newIteration,
-                    exp_tag,
+                    (psS64)atoll(exp_id),
                     accept
                 )
@@ -6424,15 +6424,15 @@
     }
 
-    // we have to support multipe exp_tags
-    psMetadataItem *item = psMetadataLookup(config->args, "-exp_tag");
+    // we have to support multipe exp_ids
+    psMetadataItem *item = psMetadataLookup(config->args, "-exp_id");
     if (!item) {
         // this shouldn't actually happen when using psArgs
-        psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
-        return false;
-    }
-
-    psList *exp_tag_list = item->data.list;
+        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
+        return false;
+    }
+
+    psList *exp_id_list = item->data.list;
     psMetadata *where = psMetadataAlloc();
-    // make sure that -exp_tag was parsed correctly
+    // make sure that -exp_id was parsed correctly
     // XXX this can be removed someday
     if (item->type == PS_DATA_METADATA_MULTI) {
@@ -6440,17 +6440,17 @@
         psMetadataItem *mItem = NULL;
         while ((mItem = psListGetAndIncrement(iter))) {
-            psString exp_tag = mItem->data.V;
-            // if exp_tag is NULL then it means that -exp_tag has not been
+            psString exp_id = mItem->data.V;
+            // if exp_id is NULL then it means that -exp_id has not been
             // specified
-            if (!exp_tag) {
+            if (!exp_id) {
                 psError(PS_ERR_UNKNOWN, true,
-                        "at least one -exp_tag is required");
+                        "at least one -exp_id is required");
                 psFree(where);
                 return false;
             }
 
-            if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_tag",
-                        PS_META_DUPLICATE_OK, "==", exp_tag)) {
-                psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
+            if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id",
+                        PS_META_DUPLICATE_OK, "==", exp_id)) {
+                psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
                 psFree(iter);
                 psFree(where);
@@ -6460,8 +6460,8 @@
         psFree(iter);
     } else {
-        psAbort(                "-exp_tag was not parsed correctly (this should not happen");
-    }
-
-    // check that the specified exp_tags actually exist in the iteration zero
+        psAbort(                "-exp_id was not parsed correctly (this should not happen");
+    }
+
+    // check that the specified exp_ids actually exist in the iteration zero
     // detInputExp set
 
@@ -6487,12 +6487,15 @@
     }
 
-    // build a hash for the valid exp_tags
-    psHash *valid_exp_tags = psHashAlloc(psArrayLength(detrendExps));
+    // build a hash for the valid exp_ids
+    psHash *valid_exp_ids = psHashAlloc(psArrayLength(detrendExps));
+// XXX: FIXME!
+#if 0
     for (long i = 0; i < psArrayLength(detrendExps); i++) {
-        psHashAdd(valid_exp_tags,
-            ((detInputExpRow *)detrendExps->data[i])->exp_tag,
+        psHashAdd(valid_exp_ids,
+            ((detInputExpRow *)detrendExps->data[i])->exp_id,
             detrendExps->data[i]
         );
     }
+#endif
     psFree(detrendExps);
 
@@ -6501,5 +6504,5 @@
     if (!psDBTransaction(config->dbh)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
-        psFree(valid_exp_tags);
+        psFree(valid_exp_ids);
         return false;
     }
@@ -6512,15 +6515,15 @@
             psError(PS_ERR_UNKNOWN, false, "database error");
         }
-        psFree(valid_exp_tags);
-        return false;
-    }
-
-    // check exp_tags and build up an array of new detInputExp rows at the same
+        psFree(valid_exp_ids);
+        return false;
+    }
+
+    // check exp_ids and build up an array of new detInputExp rows at the same
     // time
-    psListIterator *iter = psListIteratorAlloc(exp_tag_list, 0, false);
+    psListIterator *iter = psListIteratorAlloc(exp_id_list, 0, false);
     psMetadataItem *mItem = NULL;
-    psArray *newInputExps = psArrayAllocEmpty(psListLength(exp_tag_list));
+    psArray *newInputExps = psArrayAllocEmpty(psListLength(exp_id_list));
     while ((mItem = psListGetAndIncrement(iter))) {
-        detInputExpRow *inputExp = psHashLookup(valid_exp_tags,
+        detInputExpRow *inputExp = psHashLookup(valid_exp_ids,
                 (char *)mItem->data.V);
         if (!inputExp) {
@@ -6529,9 +6532,9 @@
                 psError(PS_ERR_UNKNOWN, false, "database error");
             }
-            // invalid exp_tag
-            psError(PS_ERR_UNKNOWN, false, "exp_tag %s is invalid for det_id %s",
+            // invalid exp_id
+            psError(PS_ERR_UNKNOWN, false, "exp_id %s is invalid for det_id %s",
                     (char *)mItem->data.V, det_id);
             psFree(iter);
-            psFree(valid_exp_tags);
+            psFree(valid_exp_ids);
             return false;
         }
@@ -6539,5 +6542,5 @@
             (psS32)atol(det_id),
             newIteration,
-            inputExp->exp_tag,
+            inputExp->exp_id,
             true   // use
         );
@@ -6546,5 +6549,5 @@
     }
     psFree(iter);
-    psFree(valid_exp_tags);
+    psFree(valid_exp_ids);
 
     for (long i = 0; i < psArrayLength(newInputExps); i++) {
Index: /trunk/ippTools/src/dettoolConfig.c
===================================================================
--- /trunk/ippTools/src/dettoolConfig.c	(revision 14022)
+++ /trunk/ippTools/src/dettoolConfig.c	(revision 14023)
@@ -49,5 +49,5 @@
     // -pending
     psMetadata *pendingArgs = psMetadataAlloc();
-    psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_id",  0,
             "search by exposure ID", NULL);
     psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_type",  0,
@@ -66,5 +66,5 @@
     // -definebytag
     psMetadata *definebytagArgs = psMetadataAlloc();
-    psMetadataAddStr(definebytagArgs, PS_LIST_TAIL, "-exp_tag",
+    psMetadataAddStr(definebytagArgs, PS_LIST_TAIL, "-exp_id",
             PS_META_DUPLICATE_OK,
             "include this exposure (multiple OK, required)", NULL);
@@ -292,5 +292,5 @@
     psMetadataAddS32(inputArgs, PS_LIST_TAIL, "-iteration",  0,
             "define iteration number", 0);
-    psMetadataAddStr(inputArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(inputArgs, PS_LIST_TAIL, "-exp_id",  0,
             "search for exp ID", NULL);
     psMetadataAddBool(inputArgs, PS_LIST_TAIL, "-simple",  0,
@@ -306,5 +306,5 @@
     psMetadataAddStr(toprocessedimfileArgs, PS_LIST_TAIL, "-det_id",  0,
             "search for detrend ID", NULL);
-    psMetadataAddStr(toprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(toprocessedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
             "search for exp ID", NULL);
     psMetadataAddStr(toprocessedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
@@ -319,5 +319,5 @@
     psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-det_id",  0,
             "define detrend ID (required)", NULL);
-    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
             "define exp ID (required)", NULL);
     psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
@@ -358,5 +358,5 @@
     psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-det_id",  0,
             "search for detrend ID", NULL);
-    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
             "search for exp ID", NULL);
     psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
@@ -390,5 +390,5 @@
     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-det_id",  0,
             "define detrend ID (required)", NULL);
-    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_id",  0,
             "define detrend ID (required)", NULL);
     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-recip",  0,
@@ -425,5 +425,5 @@
     psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-det_id",  0,
             "define detrend ID", NULL);
-    psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-exp_id",  0,
             "define detrend ID", NULL);
     psMetadataAddU64(processedexpArgs, PS_LIST_TAIL, "-limit",  0,
@@ -645,5 +645,5 @@
     psMetadataAddS32(addresidimfileArgs, PS_LIST_TAIL, "-iteration",  0,
             "define iteration number", 0);
-    psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
             "define detrend ID (required)", NULL);
     psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-class_id",  0,
@@ -688,5 +688,5 @@
     psMetadataAddS32(residimfileArgs, PS_LIST_TAIL, "-iteration",  0,
             "search for iteration number", 0);
-    psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
             "define detrend ID", NULL);
     psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-class_id",  0,
@@ -709,5 +709,5 @@
     psMetadataAddS32(addresidexpArgs, PS_LIST_TAIL, "-iteration",  0,
             "define iteration number", 0);
-    psMetadataAddStr(addresidexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(addresidexpArgs, PS_LIST_TAIL, "-exp_id",  0,
             "define detrend ID (required)", NULL);
     psMetadataAddStr(addresidexpArgs, PS_LIST_TAIL, "-recip",  0,
@@ -750,5 +750,5 @@
     psMetadataAddS32(residexpArgs, PS_LIST_TAIL, "-iteration",  0,
             "search for iteration number", 0);
-    psMetadataAddStr(residexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(residexpArgs, PS_LIST_TAIL, "-exp_id",  0,
             "search for exp ID", NULL);
     psMetadataAddStr(residexpArgs, PS_LIST_TAIL, "-recip",  0,
@@ -776,5 +776,5 @@
     psMetadataAddS32(updateresidexpArgs, PS_LIST_TAIL, "-iteration",  0,
             "define iteration number", 0);
-    psMetadataAddStr(updateresidexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(updateresidexpArgs, PS_LIST_TAIL, "-exp_id",  0,
             "define exp ID", NULL);
     psMetadataAddStr(updateresidexpArgs, PS_LIST_TAIL, "-recip",  0,
@@ -834,5 +834,5 @@
     psMetadataAddStr(rerunArgs, PS_LIST_TAIL, "-det_id",  0,
             "search for detrend master for detrend ID (required)", NULL);
-    psMetadataAddStr(rerunArgs, PS_LIST_TAIL, "-exp_tag",  PS_META_DUPLICATE_OK,
+    psMetadataAddStr(rerunArgs, PS_LIST_TAIL, "-exp_id",  PS_META_DUPLICATE_OK,
             "include this exposure (multiple OK, required)", NULL);
 
@@ -999,5 +999,5 @@
     }
     addWhereStr(det_type);
-    addWhereStr(exp_tag);
+    addWhereStr(exp_id);
     addWhereStr(class_id);
     // convert '-inst' to 'camera'
Index: /trunk/ippTools/src/guidetool.c
===================================================================
--- /trunk/ippTools/src/guidetool.c	(revision 14022)
+++ /trunk/ippTools/src/guidetool.c	(revision 14023)
@@ -185,5 +185,5 @@
 
     return guidePendingExpRowAlloc(
-        exp->exp_tag,
+        exp->exp_id,
         exp->camera,
         exp->telescope,
Index: /trunk/ippTools/src/guidetoolConfig.c
===================================================================
--- /trunk/ippTools/src/guidetoolConfig.c	(revision 14022)
+++ /trunk/ippTools/src/guidetoolConfig.c	(revision 14023)
@@ -52,5 +52,5 @@
     // -pending search
     psMetadata *pendingArgs = psMetadataAlloc();
-    psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_id",  0,
         "define exposure ID", NULL);
     psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-inst",  0,
@@ -71,5 +71,5 @@
     // -define inputs
     psMetadata *defineArgs = psMetadataAlloc();
-    psMetadataAddStr(defineArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(defineArgs, PS_LIST_TAIL, "-exp_id",  0,
         "define class", NULL);
     psMetadataAddStr(defineArgs, PS_LIST_TAIL, "-inst",  0,
@@ -163,5 +163,5 @@
     bool status = false;
 
-    addWhereStr(exp_tag);
+    addWhereStr(exp_id);
     // convert '-inst' to 'camera'
     if ((str = psMetadataLookupStr(&status, config->args, "-inst"))) {
Index: /trunk/ippTools/src/pxcam.c
===================================================================
--- /trunk/ippTools/src/pxcam.c	(revision 14022)
+++ /trunk/ippTools/src/pxcam.c	(revision 14023)
@@ -66,5 +66,5 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
-    // load the SQL to enqueue our exp_tags from disk once
+    // load the SQL to enqueue our exp_ids from disk once
     static psString query = NULL;
     if (!query) {
Index: /trunk/ippTools/src/pxchip.c
===================================================================
--- /trunk/ippTools/src/pxchip.c	(revision 14022)
+++ /trunk/ippTools/src/pxchip.c	(revision 14023)
@@ -57,5 +57,5 @@
 
 bool pxchipQueueByExpTag(pxConfig *config,
-                         psString exp_tag,
+                         psString exp_id,
                          psString workdir,
                          psString label,
@@ -96,5 +96,5 @@
 #endif
 
-    // populate the chipInputImfile table from rawImfile based on exp_tag,
+    // populate the chipInputImfile table from rawImfile based on exp_id,
     // where the coresponding newExp.state entry is set to stop
     psString query = pxDataGetCached("chiptool_queuerawimfile.sql");
@@ -104,6 +104,6 @@
     }
 
-    // queue the imfiles for the exp_tag
-    if (!p_psDBRunQuery(config->dbh, query, exp_tag)) {
+    // queue the imfiles for the exp_id
+    if (!p_psDBRunQuery(config->dbh, query, exp_id)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
         return false;
Index: /trunk/ippTools/src/pxchip.h
===================================================================
--- /trunk/ippTools/src/pxchip.h	(revision 14022)
+++ /trunk/ippTools/src/pxchip.h	(revision 14023)
@@ -28,5 +28,5 @@
 
 bool pxchipQueueByExpTag(pxConfig *config,
-                         psString exp_tag,
+                         psString exp_id,
                          psString workdir,
                          psString label,
Index: /trunk/ippTools/src/pxinject.c
===================================================================
--- /trunk/ippTools/src/pxinject.c	(revision 14022)
+++ /trunk/ippTools/src/pxinject.c	(revision 14023)
@@ -80,29 +80,29 @@
 
     bool status = false;
-    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
-        return false;
-    }
-    if (!exp_id) {
-        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
-        return false;
-    }
-    psString camera = psMetadataLookupStr(&status, config->args, "-inst");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -inst");
-        return false;
-    }
-    if (!camera) {
-        psError(PS_ERR_UNKNOWN, true, "-inst is required");
-        return false;
-    }
-    psString telescope = psMetadataLookupStr(&status, config->args, "-telescope");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -telescope");
-        return false;
-    }
-    if (!telescope) {
-        psError(PS_ERR_UNKNOWN, true, "-telescope is required");
+    psString tmp_exp_name = psMetadataLookupStr(&status, config->args, "-tmp_exp_name");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_exp_name");
+        return false;
+    }
+    if (!tmp_exp_name) {
+        psError(PS_ERR_UNKNOWN, true, "-tmp_exp_name is required");
+        return false;
+    }
+    psString tmp_camera = psMetadataLookupStr(&status, config->args, "-tmp_inst");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_inst");
+        return false;
+    }
+    if (!tmp_camera) {
+        psError(PS_ERR_UNKNOWN, true, "-tmp_inst is required");
+        return false;
+    }
+    psString tmp_telescope = psMetadataLookupStr(&status, config->args, "-tmp_telescope");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_telescope");
+        return false;
+    }
+    if (!tmp_telescope) {
+        psError(PS_ERR_UNKNOWN, true, "-tmp_telescope is required");
         return false;
     }
@@ -127,16 +127,10 @@
     }
 
-    psString exp_tag = pxGenExpTag(config, exp_id);
-    if (!exp_tag) {
-        psError(PS_ERR_UNKNOWN, false, "database error");
-        return false;
-    }
-
     if (!newExpInsert(config->dbh,
-                exp_tag,
-                exp_id,
+                0x0, // exp_id
+                tmp_exp_name,
                 "reg", // state
-                camera,
-                telescope,
+                tmp_camera,
+                tmp_telescope,
                 imfiles,
                 workdir,
@@ -145,16 +139,17 @@
         ) {
         psError(PS_ERR_UNKNOWN, false, "database error");
-        psFree(exp_tag);
-        return false;
-    }
+        return false;
+    }
+
+    psS64 lastInsertID = psDBLastInsertID(config->dbh);
+    psString exp_id = psDBIntToString(lastInsertID);
 
     psMetadata *md = psMetadataAlloc();
-    if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_tag", 0, NULL, exp_tag)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
+    if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, exp_id)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
         psFree(md);
-        psFree(exp_tag);
-        psFree(md);
-    }
-    psFree(exp_tag);
+        psFree(exp_id);
+    }
+    psFree(exp_id);
 
     bool simple = false;
@@ -186,11 +181,11 @@
 
     bool status = false;
-    psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
-        return false;
-    }
-    if (!exp_tag) {
-        psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
+    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
+        return false;
+    }
+    if (!exp_id) {
+        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
         return false;
     }
@@ -206,11 +201,11 @@
     }
 #endif
-    psString class_id = psMetadataLookupStr(&status, config->args, "-class_id");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -class_id");
-        return false;
-    }
-    if (!class_id) {
-        psError(PS_ERR_UNKNOWN, true, "-class_id is required");
+    psString tmp_class_id = psMetadataLookupStr(&status, config->args, "-tmp_class_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_class_id");
+        return false;
+    }
+    if (!tmp_class_id) {
+        psError(PS_ERR_UNKNOWN, true, "-tmp_class_id is required");
         return false;
     }
@@ -226,5 +221,5 @@
 
     // insert with error flag state set to 0 (no errors)
-    if (!newImfileInsert(config->dbh, exp_tag, class_id, uri)) {
+    if (!newImfileInsert(config->dbh, (psS64)atoll(exp_id), tmp_class_id, uri)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
         return false;
@@ -240,11 +235,11 @@
 
     bool status = false;
-    psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
-        return false;
-    }
-    if (!exp_tag) {
-        psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
+    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
+        return false;
+    }
+    if (!exp_id) {
+        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
         return false;
     }
@@ -262,5 +257,5 @@
     if (state) {
         // set detRun.state to state
-        return pxnewExpSetState(config, exp_tag, state);
+        return pxnewExpSetState(config, exp_id, state);
     }
 
Index: /trunk/ippTools/src/pxinjectConfig.c
===================================================================
--- /trunk/ippTools/src/pxinjectConfig.c	(revision 14022)
+++ /trunk/ippTools/src/pxinjectConfig.c	(revision 14023)
@@ -45,9 +45,9 @@
     // -newExp
     psMetadata *newExpArgs = psMetadataAlloc();
-    psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "-exp_id",  0,
-            "define the exp_id (required)", NULL);
-    psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "-inst",  0,
+    psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "-tmp_exp_name",  0,
+            "define the exp_name (required)", NULL);
+    psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "-tmp_inst",  0,
             "define the camera name (required)", NULL);
-    psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "-telescope",  0,
+    psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "-tmp_telescope",  0,
             "define the telescope name (required)", NULL);
     psMetadataAddS32(newExpArgs, PS_LIST_TAIL, "-imfiles",  0,
@@ -60,11 +60,11 @@
     // -newImfile
     psMetadata *newImfileArgs = psMetadataAlloc();
-    psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
-            "define the exp_tag (required)", NULL);
+    psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-exp_id",  0,
+            "define the exp_id (required)", NULL);
 #if 0
     psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-class",  0,
             "define the class (required)", NULL);
 #endif
-    psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-class_id",  0,
+    psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-tmp_class_id",  0,
             "define the class ID (required)", NULL);
     psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-uri",  0,
@@ -73,6 +73,6 @@
     // -updatenewExp
     psMetadata *updatenewExpArgs = psMetadataAlloc();
-    psMetadataAddStr(updatenewExpArgs, PS_LIST_TAIL, "-exp_tag",  0,
-            "define the exp_tag (required)", NULL);
+    psMetadataAddStr(updatenewExpArgs, PS_LIST_TAIL, "-exp_id",  0,
+            "define the exp_id (required)", NULL);
     psMetadataAddStr(updatenewExpArgs, PS_LIST_TAIL, "-state", 0,
             "set state (required)", NULL);
@@ -127,5 +127,5 @@
     }
     addWhereStr(det_type);
-    addWhereStr(exp_tag);
+    addWhereStr(exp_id);
     addWhereStr(class_id);
     // convert '-inst' to 'camera'
Index: /trunk/ippTools/src/pxregister.c
===================================================================
--- /trunk/ippTools/src/pxregister.c	(revision 14022)
+++ /trunk/ippTools/src/pxregister.c	(revision 14023)
@@ -29,7 +29,7 @@
 #include "pxregister.h"
 
-bool pxnewExpSetState(pxConfig *config, const char *exp_tag, const char *state)
+bool pxnewExpSetState(pxConfig *config, const char *exp_id, const char *state)
 {
-    PS_ASSERT_PTR_NON_NULL(exp_tag, false);
+    PS_ASSERT_PTR_NON_NULL(exp_id, false);
     PS_ASSERT_PTR_NON_NULL(state, false);
 
@@ -46,8 +46,8 @@
     }
 
-    char *query = "UPDATE newExp SET state = '%s' WHERE exp_tag = '%s'";
-    if (!p_psDBRunQuery(config->dbh, query, state, exp_tag)) {
+    char *query = "UPDATE newExp SET state = '%s' WHERE exp_id = '%s'";
+    if (!p_psDBRunQuery(config->dbh, query, state, exp_id)) {
         psError(PS_ERR_UNKNOWN, false,
-                "failed to change state for exp_tag %s", exp_tag);
+                "failed to change state for exp_id %s", exp_id);
         return false;
     }
Index: /trunk/ippTools/src/pxregister.h
===================================================================
--- /trunk/ippTools/src/pxregister.h	(revision 14022)
+++ /trunk/ippTools/src/pxregister.h	(revision 14023)
@@ -25,5 +25,5 @@
 #include "pxtools.h"
 
-bool pxnewExpSetState(pxConfig *config, const char *exp_tag, const char *state);
+bool pxnewExpSetState(pxConfig *config, const char *exp_id, const char *state);
 
 #endif // PXREGISTER_H
Index: /trunk/ippTools/src/pxtables.c
===================================================================
--- /trunk/ippTools/src/pxtables.c	(revision 14022)
+++ /trunk/ippTools/src/pxtables.c	(revision 14023)
@@ -43,4 +43,5 @@
 
     bool            status = true;
+#if 0
     CREATE_TABLE(expTagCounterCreateTable);
     // the counter must be initialized to 0
@@ -49,4 +50,5 @@
         status = false; 
     }
+#endif
     CREATE_TABLE(summitExpCreateTable);
     CREATE_TABLE(summitImfileCreateTable);
@@ -129,5 +131,5 @@
     }
 
-    DROP_TABLE(expTagCounterDropTable);
+//    DROP_TABLE(expTagCounterDropTable);
     DROP_TABLE(summitExpDropTable);
     DROP_TABLE(summitImfileDropTable);
Index: /trunk/ippTools/src/pxtag.c
===================================================================
--- /trunk/ippTools/src/pxtag.c	(revision 14022)
+++ /trunk/ippTools/src/pxtag.c	(revision 14023)
@@ -27,5 +27,5 @@
 #include "pxtag.h"
 
-psString pxGenExpTag(pxConfig *config, const char *exp_id)
+psString pxGenExpTag(pxConfig *config, const char *exp_name)
 {
     PS_ASSERT_PTR_NON_NULL(config, NULL);
@@ -95,8 +95,8 @@
         return NULL;
     }
-    psString exp_tag = NULL;
-    psStringAppend(&exp_tag, "%s.%" PRIu64, exp_id, counter);
+    psString exp_id = NULL;
+    psStringAppend(&exp_id, "%s.%" PRIu64, exp_name, counter);
     psFree(output);
 
-    return exp_tag;
+    return exp_id;
 }
Index: /trunk/ippTools/src/pxtag.h
===================================================================
--- /trunk/ippTools/src/pxtag.h	(revision 14022)
+++ /trunk/ippTools/src/pxtag.h	(revision 14023)
@@ -25,5 +25,5 @@
 #include "pxconfig.h"
 
-psString pxGenExpTag(pxConfig *config, const char *exp_id);
+psString pxGenExpTag(pxConfig *config, const char *exp_name);
 
 #endif // PXTAG_H
Index: /trunk/ippTools/src/pzgetexp.c
===================================================================
--- /trunk/ippTools/src/pzgetexp.c	(revision 14022)
+++ /trunk/ippTools/src/pzgetexp.c	(revision 14023)
@@ -68,5 +68,5 @@
 {
     PS_ASSERT_PTR_NON_NULL(config, NULL);
-    // find last fileset/exp_id (if we have one)
+    // find last fileset/exp_name (if we have one)
     bool haveLastFileSet = false;
     psString lastFileSet = NULL;
@@ -90,5 +90,5 @@
             haveLastFileSet = true;
             bool status = false;
-            lastFileSet = psStringCopy(psMetadataLookupStr(&status, output->data[0], "exp_id"));
+            lastFileSet = psStringCopy(psMetadataLookupStr(&status, output->data[0], "exp_name"));
             psFree(output);
         }
@@ -142,5 +142,5 @@
     {
         char *query = "CREATE TEMPORARY TABLE incoming" 
-            " (exp_id VARCHAR(64), camera VARCHAR(64), telescope VARCHAR(64), dateobs DATETIME, exp_type VARCHAR(64), uri VARCHAR(255), PRIMARY KEY(exp_id, camera, telescope))"
+            " (exp_name VARCHAR(64), camera VARCHAR(64), telescope VARCHAR(64), dateobs DATETIME, exp_type VARCHAR(64), uri VARCHAR(255), PRIMARY KEY(exp_name, camera, telescope))"
            " ENGINE=MEMORY";
         if (!p_psDBRunQuery(config->dbh, query)) {
@@ -156,5 +156,5 @@
 
     {
-        char *query = "INSERT INTO incoming (exp_id, camera, telescope, dateobs, exp_type, uri) VALUES (?, ?, ?, ?, ?, ?)";
+        char *query = "INSERT INTO incoming (exp_name, camera, telescope, dateobs, exp_type, uri) VALUES (?, ?, ?, ?, ?, ?)";
 
         long inserted = p_psDBRunQueryPrepared(config->dbh, newSummitExps, query);
@@ -188,12 +188,12 @@
             "INSERT INTO pzPendingExp" 
             "   SElECT"
-            "       incoming.exp_id,"
+            "       incoming.exp_name,"
             "       incoming.camera,"
             "       incoming.telescope"
             "   FROM incoming"
             "   LEFT JOIN summitExp"
-            "       USING(exp_id, camera, telescope)"
+            "       USING(exp_name, camera, telescope)"
             "   WHERE"
-            "       summitExp.exp_id is NULL"
+            "       summitExp.exp_name is NULL"
             "       AND summitExp.camera is NULL"
             "       AND summitExp.telescope is NULL";
@@ -218,7 +218,7 @@
             "   FROM incoming"
             "   LEFT JOIN summitExp"
-            "       USING(exp_id, camera, telescope)"
+            "       USING(exp_name, camera, telescope)"
             "   WHERE"
-            "       summitExp.exp_id is NULL"
+            "       summitExp.exp_name is NULL"
             "       AND summitExp.camera is NULL"
             "       AND summitExp.telescope is NULL";
@@ -296,5 +296,5 @@
         psListIterator *tokenCursor = psListIteratorAlloc(tokens, 0, false);
         char *uri       = psListGetAndIncrement(tokenCursor);
-        char *exp_id    = psListGetAndIncrement(tokenCursor); // fileset
+        char *exp_name    = psListGetAndIncrement(tokenCursor); // fileset
         char *dateobsStr= psListGetAndIncrement(tokenCursor); // datetime
         char *exp_type  = psListGetAndIncrement(tokenCursor); // type
@@ -302,6 +302,6 @@
         // create a new metadata to represent this line and it's values
         psMetadata *md = psMetadataAlloc();
-        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, exp_id)) {
-            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_name", 0, NULL, exp_name)) {
+            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_name");
             psFree(md);
             psFree(tokenCursor);
Index: /trunk/ippTools/src/pzgetimfiles.c
===================================================================
--- /trunk/ippTools/src/pzgetimfiles.c	(revision 14022)
+++ /trunk/ippTools/src/pzgetimfiles.c	(revision 14023)
@@ -161,5 +161,5 @@
             "UPDATE summitExp"
             " SET imfiles = %d"
-            " WHERE exp_id = '%s'"
+            " WHERE exp_name = '%s'"
             " AND camera = '%s'"
             " AND telescope = '%s'";
@@ -178,5 +178,5 @@
                 "DELETE FROM pzPendingExp"
                 " WHERE"
-                "   exp_id = '%s'"
+                "   exp_name = '%s'"
                 "   AND camera = '%s'"
                 "   AND telescope = '%s'";
@@ -220,5 +220,5 @@
     {
         char *query = 
-            "CREATE TEMPORARY TABLE incoming (exp_id VARCHAR(64), camera VARCHAR(64), telescope VARCHAR(64), file_id VARCHAR(64), bytes INT, md5sum VARCHAR(32), class VARCHAR(64), class_id VARCHAR(64), uri VARCHAR(255), PRIMARY KEY(exp_id, camera, telescope, class, class_id)) ENGINE=MEMORY";
+            "CREATE TEMPORARY TABLE incoming (exp_name VARCHAR(64), camera VARCHAR(64), telescope VARCHAR(64), file_id VARCHAR(64), bytes INT, md5sum VARCHAR(32), class VARCHAR(64), class_id VARCHAR(64), uri VARCHAR(255), PRIMARY KEY(exp_name, camera, telescope, class, class_id)) ENGINE=MEMORY";
 
         if (!p_psDBRunQuery(config->dbh, query)) {
@@ -235,5 +235,5 @@
     // load the imfiles (files) into the temp table
     {
-        char *query = "INSERT INTO incoming (exp_id, camera, telescope, file_id, bytes, md5sum, class, class_id, uri) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
+        char *query = "INSERT INTO incoming (exp_name, camera, telescope, file_id, bytes, md5sum, class, class_id, uri) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
 
         long inserted = p_psDBRunQueryPrepared(config->dbh, newImfiles, query);
@@ -270,17 +270,17 @@
             "INSERT INTO pzPendingImfile" 
             "   SElECT"
-            "       incoming.exp_id,"
+            "       incoming.exp_name,"
             "       incoming.camera,"
             "       incoming.telescope,"
             "       incoming.class,"
             "       incoming.class_id,"
-            "       NULL" // exp_tag, will be assigned later
+            "       NULL" // exp_id, will be assigned later
             "   FROM incoming"
             "   JOIN pzPendingExp"
-            "       USING(exp_id, camera, telescope)"
+            "       USING(exp_name, camera, telescope)"
             "   LEFT JOIN summitImfile"
-            "       USING(exp_id, camera, telescope, class, class_id)"
+            "       USING(exp_name, camera, telescope, class, class_id)"
             "   WHERE"
-            "       summitImfile.exp_id is NULL"
+            "       summitImfile.exp_name is NULL"
             "       AND summitImfile.camera is NULL"
             "       AND summitImfile.telescope is NULL"
@@ -303,5 +303,5 @@
             "INSERT INTO summitImfile" 
             "   SElECT"
-            "       incoming.exp_id,"
+            "       incoming.exp_name,"
             "       incoming.camera,"
             "       incoming.telescope,"
@@ -314,7 +314,7 @@
             "   FROM incoming"
             "   LEFT JOIN summitImfile"
-            "       USING(exp_id, camera, telescope, class, class_id)"
+            "       USING(exp_name, camera, telescope, class, class_id)"
             "   WHERE"
-            "       summitImfile.exp_id is NULL"
+            "       summitImfile.exp_name is NULL"
             "       AND summitImfile.camera is NULL"
             "       AND summitImfile.telescope is NULL"
@@ -338,10 +338,10 @@
             " SET imfiles = (SELECT COUNT(*) FROM summitImfile"
             "   WHERE"
-            "       exp_id = '%s'"
+            "       exp_name = '%s'"
             "       AND camera = '%s'"
             "       AND telescope = '%s'"
             ")" 
             " WHERE"
-            "   exp_id = '%s'"
+            "   exp_name = '%s'"
             "   AND camera = '%s'"
             "   AND telescope = '%s'";
@@ -367,8 +367,8 @@
     }
 
-    // copy the summitExp row into newExp in order to create a new exp_tag
-    {
-        psString exp_tag = pxGenExpTag(config, filesetid);
-        if (!exp_tag) {
+    // copy the summitExp row into newExp in order to create a new exp_id
+    {
+        psString exp_id = pxGenExpTag(config, filesetid);
+        if (!exp_id) {
             // rollback
             if (!psDBRollback(config->dbh)) {
@@ -382,6 +382,6 @@
             "INSERT INTO newExp" 
             "   SElECT"
-            "       '%s'," // exp_tag
-            "       summitExp.exp_id,"
+            "       '%s'," // exp_id
+            "       summitExp.exp_name,"
             "       summitExp.camera,"
             "       summitExp.telescope,"
@@ -392,18 +392,18 @@
             "   FROM summitExp"
             "   WHERE"
-            "       summitExp.exp_id = '%s'"
+            "       summitExp.exp_name = '%s'"
             "       AND summitExp.camera = '%s'"
             "       AND summitExp.telescope = '%s'";
 
-        if (!p_psDBRunQuery(config->dbh, query, exp_tag, filesetid, camera, telescope)) {
-            // rollback
-            if (!psDBRollback(config->dbh)) {
-                psError(PS_ERR_UNKNOWN, false, "database error");
-            }
-            psError(PS_ERR_UNKNOWN, false, "database error");
-            psFree(exp_tag);
-            return false;
-        }
-        psFree(exp_tag);
+        if (!p_psDBRunQuery(config->dbh, query, exp_id, filesetid, camera, telescope)) {
+            // rollback
+            if (!psDBRollback(config->dbh)) {
+                psError(PS_ERR_UNKNOWN, false, "database error");
+            }
+            psError(PS_ERR_UNKNOWN, false, "database error");
+            psFree(exp_id);
+            return false;
+        }
+        psFree(exp_id);
 
         // sanity check: we should have inserted only one row
@@ -419,15 +419,15 @@
     }
  
-    // set the exp_tag for the imfiles (files) in the exposure (fileset) that
+    // set the exp_id for the imfiles (files) in the exposure (fileset) that
     // we are investigating
     {
         char *query = 
             "UPDATE pzPendingImfile"
-            " SET exp_tag = (SELECT exp_tag from newExp"
-            "                WHERE exp_id = '%s'"
+            " SET exp_id = (SELECT exp_id from newExp"
+            "                WHERE exp_name = '%s'"
             "                AND camera = '%s'"
             "                AND telescope = '%s')"
             " WHERE"
-            "   exp_id = '%s'"
+            "   exp_name = '%s'"
             "   AND camera = '%s'"
             "   AND telescope = '%s'";
@@ -450,5 +450,5 @@
             "   FROM pzPendingExp"
             "   WHERE"
-            "       pzPendingExp.exp_id = '%s'"
+            "       pzPendingExp.exp_name = '%s'"
             "       AND pzPendingExp.camera = '%s'"
             "       AND pzPendingExp.telescope = '%s'";
@@ -479,5 +479,5 @@
             "DELETE FROM pzPendingExp"
             " WHERE"
-            "   exp_id = '%s'"
+            "   exp_name = '%s'"
             "   AND camera = '%s'"
             "   AND telescope = '%s'";
@@ -524,10 +524,10 @@
     // any work
     bool status = false;
-    psString exp_id = psMetadataLookupStr(&status, config->args, "-filesetid");
+    psString exp_name = psMetadataLookupStr(&status, config->args, "-filesetid");
     if (!status) {
         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for '-filesetid'");
         return NULL;
     }
-    if (!exp_id) {
+    if (!exp_name) {
         psError(PS_ERR_UNKNOWN, true, "-filesetid is required");
         return NULL;
@@ -596,6 +596,6 @@
         // create a new metadata to represent this line and it's values
         psMetadata *md = psMetadataAlloc();
-        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, exp_id)) {
-            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_name", 0, NULL, exp_name)) {
+            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_name");
             psFree(md);
             psFree(tokenCursor);
Index: /trunk/ippTools/src/pztool.c
===================================================================
--- /trunk/ippTools/src/pztool.c	(revision 14022)
+++ /trunk/ippTools/src/pztool.c	(revision 14023)
@@ -140,5 +140,5 @@
             " FROM pzPendingExp"
             " JOIN summitExp"
-            "   USING(exp_id, camera, telescope)"
+            "   USING(exp_name, camera, telescope)"
         );
 
@@ -197,8 +197,8 @@
             "SELECT"
             "   summitImfile.*,"
-            "   pzPendingImfile.exp_tag"
+            "   pzPendingImfile.exp_id"
             " FROM pzPendingImfile"
             " JOIN summitImfile"
-            "   USING(exp_id, camera, telescope, class, class_id)"
+            "   USING(exp_name, camera, telescope, class, class_id)"
         );
 
@@ -255,11 +255,11 @@
 
     bool status = false;
-    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
-        return false;
-    }
-    if (!exp_id) {
-        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
+    psString exp_name = psMetadataLookupStr(&status, config->args, "-exp_name");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_name");
+        return false;
+    }
+    if (!exp_name) {
+        psError(PS_ERR_UNKNOWN, true, "-exp_name is required");
         return false;
     }
@@ -315,5 +315,5 @@
     }
 
-    // need to know exp_id, camera, telescope, class, class_id (to find the
+    // need to know exp_name, camera, telescope, class, class_id (to find the
     // pzPendingImfile entry and the URI for the newImfile entry.
 
@@ -329,5 +329,5 @@
             "INSERT INTO newImfile"
             "   SElECT"
-            "       pzPendingImfile.exp_tag,"
+            "       pzPendingImfile.exp_id,"
             "       pzPendingImfile.class,"
             "       pzPendingImfile.class_id,"
@@ -336,5 +336,5 @@
             "   FROM pzPendingImfile"
             "   WHERE"
-            "       pzPendingImfile.exp_id = '%s'"
+            "       pzPendingImfile.exp_name = '%s'"
             "       AND pzPendingImfile.camera = '%s'"
             "       AND pzPendingImfile.telescope = '%s'"
@@ -342,5 +342,5 @@
             "       AND pzPendingImfile.class_id = '%s'";
 
-        if (!p_psDBRunQuery(config->dbh, query, uri, exp_id, camera, telescope, class, class_id)) {
+        if (!p_psDBRunQuery(config->dbh, query, uri, exp_name, camera, telescope, class, class_id)) {
             // rollback
             if (!psDBRollback(config->dbh)) {
@@ -372,5 +372,5 @@
             "   FROM pzPendingImfile"
             "   WHERE"
-            "       pzPendingImfile.exp_id = '%s'"
+            "       pzPendingImfile.exp_name = '%s'"
             "       AND pzPendingImfile.camera = '%s'"
             "       AND pzPendingImfile.telescope = '%s'"
@@ -378,5 +378,5 @@
             "       AND pzPendingImfile.class_id = '%s'";
 
-        if (!p_psDBRunQuery(config->dbh, query, uri, exp_id, camera, telescope, class, class_id)) {
+        if (!p_psDBRunQuery(config->dbh, query, uri, exp_name, camera, telescope, class, class_id)) {
             // rollback
             if (!psDBRollback(config->dbh)) {
@@ -404,5 +404,5 @@
             "DELETE FROM pzPendingImfile"
             "   WHERE"
-            "       pzPendingImfile.exp_id = '%s'"
+            "       pzPendingImfile.exp_name = '%s'"
             "       AND pzPendingImfile.camera = '%s'"
             "       AND pzPendingImfile.telescope = '%s'"
@@ -410,5 +410,5 @@
             "       AND pzPendingImfile.class_id = '%s'";
 
-        if (!p_psDBRunQuery(config->dbh, query, exp_id, camera, telescope, class, class_id)) {
+        if (!p_psDBRunQuery(config->dbh, query, exp_name, camera, telescope, class, class_id)) {
             // rollback
             if (!psDBRollback(config->dbh)) {
Index: /trunk/ippTools/src/pztoolConfig.c
===================================================================
--- /trunk/ippTools/src/pztoolConfig.c	(revision 14022)
+++ /trunk/ippTools/src/pztoolConfig.c	(revision 14023)
@@ -45,5 +45,5 @@
     // -seen
     psMetadata *seenArgs = psMetadataAlloc();
-    psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-exp_tag", 0,
+    psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-exp_id", 0,
             "define exposure ID", NULL); 
     psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-inst", 0,
@@ -58,5 +58,5 @@
     // -pendingexp
     psMetadata *pendingexpArgs = psMetadataAlloc();
-    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_tag", 0,
+    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_id", 0,
             "define exposure ID", NULL); 
     psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-inst", 0,
@@ -71,5 +71,5 @@
     // -pendingimfile
     psMetadata *pendingimfileArgs = psMetadataAlloc();
-    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_tag", 0,
+    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_id", 0,
             "define exposure ID", NULL); 
     psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-inst", 0,
@@ -84,5 +84,5 @@
     // -copydone
     psMetadata *copydoneArgs = psMetadataAlloc();
-    psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-exp_id", 0,
+    psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-exp_name", 0,
             "define exposure ID", NULL); 
     psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-inst", 0,
@@ -173,5 +173,5 @@
     config->where = psMetadataAlloc();
 
-    addWhereStr(exp_tag); 
+    addWhereStr(exp_id); 
     addWhereStr(telescope); 
     // convert '-inst' to 'camera'
Index: /trunk/ippTools/src/regtool.c
===================================================================
--- /trunk/ippTools/src/regtool.c	(revision 14022)
+++ /trunk/ippTools/src/regtool.c	(revision 14023)
@@ -111,7 +111,7 @@
 
     // select newImfiles that:
-    // exp_tag is in newExp
-    // don't have their exp_tag in rawExp 
-    // XXX having the same exp_tag in newExp and raw*Exp is probably an error
+    // exp_id is in newExp
+    // don't have their exp_id in rawExp 
+    // XXX having the same exp_id in newExp and raw*Exp is probably an error
     // that should be checked for
 
@@ -181,5 +181,5 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
-    psString query = pxDataGet("regtool_find_unprocessed_imfile.sql");
+    psString query = pxDataGet("regtool_pendingimfile.sql");
     if (!query) {
         psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
@@ -188,16 +188,16 @@
 
     {
-        // build a query to search by exp_tag, class, class_id
+        // build a query to search by exp_id, class, class_id
         psMetadata *where = psMetadataAlloc();
         bool status = false;
-        psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
+        psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
         if (!status) {
-            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
+            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
             psFree(query);
             return false;
         }
-        if (exp_tag) {
-            if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_tag", 0, "==", exp_tag)) {
-                psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
+        if (exp_id) {
+            if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) {
+                psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
                 psFree(where);
                 psFree(query);
@@ -206,13 +206,13 @@
         }
 
-        psString class_id = psMetadataLookupStr(&status, config->args, "-class_id");
+        psString tmp_class_id = psMetadataLookupStr(&status, config->args, "-tmp_class_id");
         if (!status) {
-            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -class_id");
+            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_class_id");
             psFree(query);
             return false;
         }
-        if (class_id) {
-            if (!psMetadataAddStr(where, PS_LIST_TAIL, "class_id", 0, "==", class_id)) {
-                psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
+        if (tmp_class_id) {
+            if (!psMetadataAddStr(where, PS_LIST_TAIL, "tmp_class_id", 0, "==", tmp_class_id)) {
+                psError(PS_ERR_UNKNOWN, false, "failed to add item tmp_class_id");
                 psFree(where);
                 psFree(query);
@@ -511,17 +511,17 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
-    // make sure that the exp_tag(s) are ready to be updated based on:
-    // exp_tag is not in rawExp
-    // exp_tag is not in newImfile
+    // make sure that the exp_id(s) are ready to be updated based on:
+    // exp_id is not in rawExp
+    // exp_id is not in newImfile
     // that the correct count of imfiles is in rawImfile
    
     bool status = false;
-    psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
-        return false;
-    }
-    if (!exp_tag) {
-        psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
+    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
+        return false;
+    }
+    if (!exp_id) {
+        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
         return false;
     }
@@ -539,5 +539,5 @@
     }
 
-    if (!p_psDBRunQuery(config->dbh, query, exp_tag)) {
+    if (!p_psDBRunQuery(config->dbh, query, exp_id)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
         psFree(query);
@@ -608,10 +608,10 @@
         if (detrend) {
             // set the state for the newExp to stop 
-            if (!pxnewExpSetState(config, exp_tag, "stop")) {
+            if (!pxnewExpSetState(config, exp_id, "stop")) {
                 // rollback
                 if (!psDBRollback(config->dbh)) {
                     psError(PS_ERR_UNKNOWN, false, "database error");
                 }
-                psError(PS_ERR_UNKNOWN, false, "failed to change newExp.state for exp_tag: %s", exp_tag);
+                psError(PS_ERR_UNKNOWN, false, "failed to change newExp.state for exp_id: %s", exp_id);
                 psFree(output);
                 return false;
@@ -622,10 +622,10 @@
 
         // set the state for the newExp to stop
-        if (!pxnewExpSetState(config, exp_tag, "stop")) {
+        if (!pxnewExpSetState(config, exp_id, "stop")) {
             // rollback
             if (!psDBRollback(config->dbh)) {
                 psError(PS_ERR_UNKNOWN, false, "database error");
             }
-            psError(PS_ERR_UNKNOWN, false, "failed to change newExp.state for exp_tag: %s", exp_tag);
+            psError(PS_ERR_UNKNOWN, false, "failed to change newExp.state for exp_id: %s", exp_id);
             psFree(output);
             return false;
@@ -634,5 +634,5 @@
         // insert an entry into the chipPendingExp table
         // this can only be run as the newExp's state has been set to stop
-        if (!pxchipQueueByExpTag(config, exp_tag, NULL, NULL, NULL, NULL, NULL)) {
+        if (!pxchipQueueByExpTag(config, exp_id, NULL, NULL, NULL, NULL, NULL)) {
             // rollback
             if (!psDBRollback(config->dbh)) {
@@ -776,5 +776,5 @@
 {
     return guidePendingExpRowAlloc(
-        newExp->exp_tag,
+        newExp->exp_id,
         newExp->camera,
         newExp->telescope,
@@ -810,5 +810,5 @@
     chipPendingExpRow *chipExp = chipPendingExpRowAlloc(
             0,              // chip ID, assigned by db
-            exp->exp_tag,
+            exp->exp_id,
             0xdeadbeef,     // guide version
             label,
@@ -839,4 +839,55 @@
 
     bool status = false;
+    // required
+    psString exp_name = psMetadataLookupStr(&status, config->args, "-exp_name");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_name");
+        return false;
+    }
+    if (!exp_name) {
+        psError(PS_ERR_UNKNOWN, true, "-exp_name is required");
+        return false;
+    }
+
+    psString camera = psMetadataLookupStr(&status, config->args, "-inst");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -inst");
+        return false;
+    }
+    if (!camera) {
+        psError(PS_ERR_UNKNOWN, true, "-inst is required");
+        return false;
+    }
+
+    psString telescope = psMetadataLookupStr(&status, config->args, "-telescope");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -telescope");
+        return false;
+    }
+    if (!telescope) {
+        psError(PS_ERR_UNKNOWN, true, "-telescope is required");
+        return false;
+    }
+
+    psS32 imfiles = psMetadataLookupS32(&status, config->args, "-imfiles");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -imfiles");
+        return false;
+    }
+    if (!imfiles) {
+        psError(PS_ERR_UNKNOWN, true, "-imfiles is required");
+        return false;
+    }
+
+    psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
+        return false;
+    }
+    if (!exp_tag) {
+        psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
+        return false;
+    }
+
     // optional
     psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type");
@@ -989,11 +1040,12 @@
 
     rawExpRow *raw = rawExpRowAlloc(
-        exp->exp_tag,
         exp->exp_id,
-        exp->camera,
-        exp->telescope,
+        exp_name,
+        camera,
+        telescope,
         dateobs,
+        exp_tag,
         exp_type,
-        exp->imfiles,
+        imfiles,
         filelevel,
         exp->workdir,
@@ -1011,9 +1063,9 @@
         ccd_temp,
         posang,
-	user_1,
-	user_2,
-	user_3,
-	user_4,
-	user_5,
+        user_1,
+        user_2,
+        user_3,
+        user_4,
+        user_5,
         object,
         0.0,
@@ -1035,4 +1087,55 @@
 
     bool status = false;
+    // required
+    psString exp_name = psMetadataLookupStr(&status, config->args, "-exp_name");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_name");
+        return false;
+    }
+    if (!exp_name) {
+        psError(PS_ERR_UNKNOWN, true, "-exp_name is required");
+        return false;
+    }
+
+    psString camera = psMetadataLookupStr(&status, config->args, "-inst");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -inst");
+        return false;
+    }
+    if (!camera) {
+        psError(PS_ERR_UNKNOWN, true, "-inst is required");
+        return false;
+    }
+
+    psString telescope = psMetadataLookupStr(&status, config->args, "-telescope");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -telescope");
+        return false;
+    }
+    if (!telescope) {
+        psError(PS_ERR_UNKNOWN, true, "-telescope is required");
+        return false;
+    }
+
+    psString tmp_class_id = psMetadataLookupStr(&status, config->args, "-tmp_class_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_class_id");
+        return false;
+    }
+    if (!tmp_class_id) {
+        psError(PS_ERR_UNKNOWN, true, "-tmp_class_id is required");
+        return false;
+    }
+
+    psString class_id = psMetadataLookupStr(&status, config->args, "-class_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -class_id");
+        return false;
+    }
+    if (!class_id) {
+        psError(PS_ERR_UNKNOWN, true, "-class_id is required");
+        return false;
+    }
+
     // optional
     psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type");
@@ -1180,6 +1283,11 @@
 
     rawImfileRow *raw = rawImfileRowAlloc(
-        imfile->exp_tag,
-        imfile->class_id,
+        imfile->exp_id,
+        exp_name,
+        camera,
+        telescope,
+        dateobs,
+        tmp_class_id,
+        class_id,
         imfile->uri,
         exp_type,
@@ -1198,11 +1306,10 @@
         ccd_temp,
         posang,
-	user_1,
-	user_2,
-	user_3,
-	user_4,
-	user_5,
+        user_1,
+        user_2,
+        user_3,
+        user_4,
+        user_5,
         object,
-        dateobs,
         code
     );
Index: /trunk/ippTools/src/regtoolConfig.c
===================================================================
--- /trunk/ippTools/src/regtoolConfig.c	(revision 14022)
+++ /trunk/ippTools/src/regtoolConfig.c	(revision 14023)
@@ -48,5 +48,5 @@
     // -pendingimfile
     psMetadata *pendingimfileArgs = psMetadataAlloc();
-    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
         "search by exposure ID", NULL);
     psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class",  0,
@@ -61,6 +61,14 @@
     // -addprocessedimfile
     psMetadata *addprocessedimfileArgs = psMetadataAlloc();
-    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
         "define exposure ID (required)", NULL);
+    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_name",  0,
+        "define the exp_name (required)", NULL); 
+    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-inst",  0,
+        "define the camera name (required)", NULL);
+    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-telescope",  0,
+        "define the telescope name (required)", NULL);
+    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-tmp_class_id",  0,
+        "define temp. class ID (required)", NULL);
     psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
         "define class ID (required)", NULL);
@@ -114,5 +122,5 @@
     // -processedimfile
     psMetadata *processedimfileArgs = psMetadataAlloc();
-    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
         "search by exposure ID", NULL);
     psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
@@ -127,5 +135,5 @@
     // -updateprocessedimfile
     psMetadata *updateprocessedimfileArgs = psMetadataAlloc();
-    psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
         "search by exposure ID", NULL);
     psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
@@ -137,5 +145,5 @@
     // -pendingexp
     psMetadata *pendingexpArgs = psMetadataAlloc();
-    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_id",  0,
         "search by exposure ID", NULL);
     psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-inst",  0,
@@ -154,8 +162,20 @@
     // -addprocessedexp
     psMetadata *addprocessedexpArgs = psMetadataAlloc();
+    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_id",  0,
+        "exp_id to operate on (required)", NULL); 
+    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_name",  0,
+        "define the exp_name (required)", NULL); 
+    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-inst",  0,
+        "define the camera name (required)", NULL);
+    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-telescope",  0,
+        "define the telescope name (required)", NULL);
     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
-        "exp_tag to operate on (required)", NULL); 
+        "define the external exposure tag name (required)", NULL);
+    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-dateobs",  0,
+        "define observation time", NULL);
     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_type",  0,
         "define exposure type", NULL);
+    psMetadataAddS32(addprocessedexpArgs, PS_LIST_TAIL, "-imfiles",  0,
+        "define the number of imfiles in this exp (required)", 0);
     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-filelevel",  0,
         "define the data partitioning level of this file", NULL);
@@ -200,6 +220,4 @@
     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-object",  0,
         "define exposure object", NULL);
-    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-dateobs",  0,
-        "define observation time", NULL);
     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-label",  0,
         "define label for phase 2 processing (non-detrend data only)", NULL);
@@ -217,5 +235,5 @@
     // -processedexp
     psMetadata *processedexpArgs = psMetadataAlloc();
-    psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-exp_id",  0,
         "search by exposure ID", NULL);
     psMetadataAddU64(processedexpArgs, PS_LIST_TAIL, "-limit",  0,
@@ -228,5 +246,5 @@
     // -updatedprocessedexp
     psMetadata *updatedprocessedexpArgs = psMetadataAlloc();
-    psMetadataAddStr(updatedprocessedexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
+    psMetadataAddStr(updatedprocessedexpArgs, PS_LIST_TAIL, "-exp_id",  0,
         "search by exposure ID", NULL);
     psMetadataAddS16(updatedprocessedexpArgs, PS_LIST_TAIL, "-code",  0,
@@ -274,5 +292,5 @@
     config->where = psMetadataAlloc();
 
-    addWhereStr(exp_tag);
+    addWhereStr(exp_id);
     // convert '-inst' to 'camera'
     {
Index: /trunk/ippTools/src/stacktool.c
===================================================================
--- /trunk/ippTools/src/stacktool.c	(revision 14022)
+++ /trunk/ippTools/src/stacktool.c	(revision 14023)
@@ -124,5 +124,5 @@
     }
 
-    // we have to support multipe exp_tags
+    // we have to support multipe exp_ids
     psMetadataItem *warp_ids = psMetadataLookup(config->args, "-warp_id");
     if (!warp_ids) {
Index: /trunk/ippTools/src/stacktoolConfig.c
===================================================================
--- /trunk/ippTools/src/stacktoolConfig.c	(revision 14022)
+++ /trunk/ippTools/src/stacktoolConfig.c	(revision 14023)
@@ -198,5 +198,5 @@
     addWhereStr(skycell_id);
     addWhereStr(tess_id);
-    addWhereStr(exp_tag);
+    addWhereStr(exp_id);
 
     if (config->where->list->n < 1) {
Index: /trunk/ippTools/src/warptoolConfig.c
===================================================================
--- /trunk/ippTools/src/warptoolConfig.c	(revision 14022)
+++ /trunk/ippTools/src/warptoolConfig.c	(revision 14023)
@@ -165,5 +165,5 @@
     psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-tess_id",  0,
             "define tessellation ID", NULL);
-    psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-exp_tag", 0,
+    psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-exp_id", 0,
             "define exposure tag", NULL);
     psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-cam_id", 0,
@@ -254,5 +254,5 @@
     addWhereStr(skycell_id);
     addWhereStr(tess_id);
-    addWhereStr(exp_tag);
+    addWhereStr(exp_id);
 
     if (config->where->list->n < 1) {
