Index: branches/tap_branches/ippTools/src/pxcam.c
===================================================================
--- branches/tap_branches/ippTools/src/pxcam.c	(revision 25900)
+++ branches/tap_branches/ippTools/src/pxcam.c	(revision 27838)
@@ -76,16 +76,16 @@
 bool pxcamGetSearchArgs (pxConfig *config, psMetadata *where) {
 
-    PXOPT_COPY_S64(config->args,   where, "-chip_id",            "chipRun.chip_id", 	 "==");
-    PXOPT_COPY_S64(config->args,   where, "-exp_id",             "rawExp.exp_id",   	 "==");
-    PXOPT_COPY_STR(config->args,   where, "-exp_name",           "rawExp.exp_name", 	 "==");
-    PXOPT_COPY_STR(config->args,   where, "-inst",               "rawExp.camera",   	 "==");
-    PXOPT_COPY_STR(config->args,   where, "-telescope",          "rawExp.telescope",	 "==");
-    PXOPT_COPY_TIME(config->args,  where, "-dateobs_begin",      "rawExp.dateobs",  	 ">=");
-    PXOPT_COPY_TIME(config->args,  where, "-dateobs_end",        "rawExp.dateobs",  	 "<=");
-    PXOPT_COPY_STR(config->args,   where, "-exp_tag",            "rawExp.exp_tag",  	 "==");
-    PXOPT_COPY_STR(config->args,   where, "-exp_type",           "rawExp.exp_type", 	 "==");
-    PXOPT_COPY_STR(config->args,   where, "-comment",            "rawExp.comment",  	 "LIKE");
-    PXOPT_COPY_STR(config->args,   where, "-filelevel",          "rawExp.filelevel",	 "==");
-    PXOPT_COPY_STR(config->args,   where, "-filter",             "rawExp.filter",         "==");
+    PXOPT_COPY_S64(config->args,   where, "-chip_id",            "chipRun.chip_id",      "==");
+    PXOPT_COPY_S64(config->args,   where, "-exp_id",             "rawExp.exp_id",        "==");
+    PXOPT_COPY_STR(config->args,   where, "-exp_name",           "rawExp.exp_name",      "==");
+    PXOPT_COPY_STR(config->args,   where, "-inst",               "rawExp.camera",        "==");
+    PXOPT_COPY_STR(config->args,   where, "-telescope",          "rawExp.telescope",     "==");
+    PXOPT_COPY_TIME(config->args,  where, "-dateobs_begin",      "rawExp.dateobs",       ">=");
+    PXOPT_COPY_TIME(config->args,  where, "-dateobs_end",        "rawExp.dateobs",       "<=");
+    PXOPT_COPY_STR(config->args,   where, "-exp_tag",            "rawExp.exp_tag",       "==");
+    PXOPT_COPY_STR(config->args,   where, "-exp_type",           "rawExp.exp_type",      "==");
+    PXOPT_COPY_STR(config->args,   where, "-comment",            "rawExp.comment",       "LIKE");
+    PXOPT_COPY_STR(config->args,   where, "-filelevel",          "rawExp.filelevel",     "==");
+    PXOPT_COPY_STR(config->args,   where, "-filter",             "rawExp.filter",         "LIKE");
     PXOPT_COPY_F64(config->args,   where, "-airmass_min",        "rawExp.airmass",        ">=");
     PXOPT_COPY_F64(config->args,   where, "-airmass_max",        "rawExp.airmass",        "<");
@@ -152,4 +152,5 @@
                     char *tess_id,
                     char *end_stage,
+                    psS64 magicked,
                     char *note)
 {
@@ -162,5 +163,5 @@
         psMemSetPersistent(query, true);
         if (!query) {
-            psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
+            psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
             return false;
         }
@@ -168,5 +169,5 @@
 
     // queue the exp
-    // XXX chip_id is being cast here work around psS64 have a different type
+    // XXX chip_id and magicked are being cast here work around psS64 have a different type
     // different on 32/64
     if (!p_psDBRunQueryF(config->dbh, query,
@@ -182,4 +183,5 @@
                 tess_id  ? tess_id  : "NULL",
                 end_stage ? end_stage : "NULL",
+                (long long) magicked,
                 note     ? note     : "NULL",
                 (long long)chip_id
