Index: trunk/ippToPsps/config/tables.DF.vot
===================================================================
--- trunk/ippToPsps/config/tables.DF.vot	(revision 38601)
+++ trunk/ippToPsps/config/tables.DF.vot	(revision 38602)
@@ -283,4 +283,7 @@
         <DESCRIPTION>flag indicating provenance information</DESCRIPTION>
       </FIELD>
+      <FIELD name="infoFlag3" arraysize="1" datatype="long" unit="dimensionless" default="-999">
+        <DESCRIPTION>flag indicating provenance information</DESCRIPTION>
+      </FIELD>
       <FIELD name="dataRelease" arraysize="1" datatype="unsignedByte" unit="dimensionless" default="NA">
         <DESCRIPTION>Data release when this detection was originally taken. Recalibrations do not affect this value.</DESCRIPTION>
Index: trunk/ippToPsps/config/tables.FW.vot
===================================================================
--- trunk/ippToPsps/config/tables.FW.vot	(revision 38601)
+++ trunk/ippToPsps/config/tables.FW.vot	(revision 38602)
@@ -251,4 +251,7 @@
         <DESCRIPTION>combination of cmf and dvo flags</DESCRIPTION>
       </FIELD>
+       <FIELD name="infoFlag3" arraysize="1" datatype="long" unit="dimensionless" default="-999">
+        <DESCRIPTION>combination of cmf and dvo flags</DESCRIPTION>
+      </FIELD>
       <FIELD name="dataRelease" arraysize="1" datatype="unsignedByte" unit="dimensionless" default="NA">
         <DESCRIPTION>Data release when this detection was originally taken. Recalibrations do not affect this value.</DESCRIPTION>
Index: trunk/ippToPsps/config/tables.P2.vot
===================================================================
--- trunk/ippToPsps/config/tables.P2.vot	(revision 38601)
+++ trunk/ippToPsps/config/tables.P2.vot	(revision 38602)
@@ -548,4 +548,7 @@
         <DESCRIPTION>flag indicating provenance information</DESCRIPTION>
       </FIELD>
+      <FIELD name="infoFlag3" arraysize="1" datatype="int" unit="dimensionless" default="-999">
+        <DESCRIPTION>flag indicating provenance information</DESCRIPTION>
+      </FIELD>
       <FIELD name="dataRelease" arraysize="1" datatype="unsignedByte" unit="dimensionless" default="NA">
         <DESCRIPTION>Data release when this detection was originally taken. Recalibrations do not affect this value.</DESCRIPTION>
Index: trunk/ippToPsps/config/tables.ST.vot
===================================================================
--- trunk/ippToPsps/config/tables.ST.vot	(revision 38601)
+++ trunk/ippToPsps/config/tables.ST.vot	(revision 38602)
@@ -213,4 +213,7 @@
         <DESCRIPTION>informational bits</DESCRIPTION>
       </FIELD>
+      <FIELD name="ginfoFlag3" arraysize="1" datatype="int" unit="dimensionless" default="0">
+        <DESCRIPTION>informational bits</DESCRIPTION>
+      </FIELD>
       <FIELD name="gnFrames" arraysize="1" datatype="int" unit="dimensionless" default="-999">
         <DESCRIPTION>number of frames contributing to source</DESCRIPTION>
@@ -263,4 +266,7 @@
         <DESCRIPTION>informational bits</DESCRIPTION>
       </FIELD>
+      <FIELD name="rinfoFlag3" arraysize="1" datatype="int" unit="dimensionless" default="0">
+        <DESCRIPTION>informational bits</DESCRIPTION>
+      </FIELD>
       <FIELD name="rnFrames" arraysize="1" datatype="int" unit="dimensionless" default="-999">
         <DESCRIPTION>number of frames contributing to source</DESCRIPTION>
@@ -313,4 +319,7 @@
         <DESCRIPTION>informational bits</DESCRIPTION>
       </FIELD>
+      <FIELD name="iinfoFlag3" arraysize="1" datatype="int" unit="dimensionless" default="0">
+        <DESCRIPTION>informational bits</DESCRIPTION>
+      </FIELD>
       <FIELD name="inFrames" arraysize="1" datatype="int" unit="dimensionless" default="-999">
         <DESCRIPTION>number of frames contributing to source</DESCRIPTION>
@@ -363,4 +372,7 @@
         <DESCRIPTION>informational bits</DESCRIPTION>
       </FIELD>
+      <FIELD name="zinfoFlag3" arraysize="1" datatype="int" unit="dimensionless" default="0">
+        <DESCRIPTION>informational bits</DESCRIPTION>
+      </FIELD>
       <FIELD name="znFrames" arraysize="1" datatype="int" unit="dimensionless" default="-999">
         <DESCRIPTION>number of frames contributing to source</DESCRIPTION>
@@ -411,4 +423,7 @@
       </FIELD>
       <FIELD name="yinfoFlag2" arraysize="1" datatype="int" unit="dimensionless" default="0">
+        <DESCRIPTION>informational bits</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yinfoFlag3" arraysize="1" datatype="int" unit="dimensionless" default="0">
         <DESCRIPTION>informational bits</DESCRIPTION>
       </FIELD>
Index: trunk/ippToPsps/jython/batch.py
===================================================================
--- trunk/ippToPsps/jython/batch.py	(revision 38601)
+++ trunk/ippToPsps/jython/batch.py	(revision 38602)
@@ -414,8 +414,9 @@
     '''   
     def createEmptyPspsTables(self):
-
+         print "THIS SUCKS" 
          self.pspsTables = stilts.treads(self.pspsVoTableFilePath)
          for table in self.pspsTables:
              self.logger.debug("Creating PSPS table: " + table.name)
+             self.logger.infoPair("creating psps table ",table.name)
              table.write(self.scratchDb.url + '#' + table.name)
              self.tablesToExport.append(table.name)
@@ -592,4 +593,5 @@
 
         # creates the empty PSPS tables
+        self.logger.infoPair("creating","empty psps tables")
         if not self.createEmptyPspsTables():
             self.logger.errorPair("Aborting this batch", "could not create empty PSPS tables")
Index: trunk/ippToPsps/jython/detectionbatch.py
===================================================================
--- trunk/ippToPsps/jython/detectionbatch.py	(revision 38601)
+++ trunk/ippToPsps/jython/detectionbatch.py	(revision 38602)
@@ -413,5 +413,5 @@
         sqlLine.group("ippDetectID",     "IPP_IDET")                                                
 #        sqlLine.group("randomDetID",     "FLOOR(RAND("+str(self.batchID)+")*9223372036854775807)")                       
-        sqlLine.group("randomDetID",     "(RAND("+str(self.batchID)+")")                       
+        sqlLine.group("randomDetID",     "RAND("+str(self.batchID)+")")                       
         sqlLine.group("filterID",        str(self.filterID))                                        
         sqlLine.group("surveyID",        str(self.surveyID))                                        
@@ -672,7 +672,7 @@
     '''
     def updateDvoIDs(self, table, externID):
-
+        self.logger.info("getting imge id")
         imageID = self.scratchDb.getImageIDFromExternID(externID)
-        self.logger.debug("Updating table '" + table + "' with DVO IDs using imageID = %d" % imageID)
+        self.logger.info("Updating table '" + table + "' with DVO IDs using imageID = %d" % imageID)
 
         sql = "UPDATE IGNORE " + table + " AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \
@@ -686,12 +686,13 @@
                a.telluricExt  = b.telluricExt, \
                a.airmass      = b.airmass, \
-               a.expTime      = b.expTime, \
-               a.infoFlag2    = (b.flags << 13) | a.infoFlag2 \
+               a.infoFlag3    = b.flags, \
+               a.expTime      = b.expTime \
                WHERE a.ippDetectID = b.ippDetectID \
                AND b.imageID = " + str(imageID)
 
-        try: self.scratchDb.execute(sql)
-        except:
-            self.logger.InfoPair("failed sql",sql)
+        print sql
+        try: self.scratchDb.execute(sql)
+        except:
+            self.logger.infoPair("failed sql",sql)
             raise
     '''
@@ -740,8 +741,9 @@
         #detection has a primary index, so don't add, use this one
         self.scratchDb.addRowCountColumnNoKey("Detection_"+chipname, "row")
+        self.logger.info("added row")
         self.updateDvoIDs("Detection_" + chipname, self.imageIDs[chipname])
-        #self.logger.info("updated dvoids")
+        self.logger.info("updated dvoids")
         results['NULLOBJID'] = self.scratchDb.reportAndDeleteRowsWithNULLS("Detection_" + chipname, "objID")
-        #self.logger.info("deleted nulls")
+        self.logger.info("deleted nulls")
 
         ota = x*10+y
Index: trunk/ippToPsps/jython/diffbatch.py
===================================================================
--- trunk/ippToPsps/jython/diffbatch.py	(revision 38601)
+++ trunk/ippToPsps/jython/diffbatch.py	(revision 38602)
@@ -163,13 +163,13 @@
       
        # make some generic tables
-           sql = "CREATE TABLE DiffMeta_"+str(num)+" like DiffMeta"
-           try: self.scratchDb.execute(sql)
-           except: raise
-           sql = "CREATE TABLE DiffToImage_"+str(num)+" like DiffToImage"
-           try: self.scratchDb.execute(sql)
-           except: raise
-           sql = "CREATE TABLE DiffDetection_"+str(num)+" like DiffDetection"
-           try: self.scratchDb.execute(sql)
-           except: raise
+           #sql = "CREATE TABLE DiffMeta_"+str(num)+" like DiffMeta"
+           #try: self.scratchDb.execute(sql)
+           #except: raise
+           #sql = "CREATE TABLE DiffToImage_"+str(num)+" like DiffToImage"
+           #try: self.scratchDb.execute(sql)
+           #except: raise
+           #sql = "CREATE TABLE DiffDetection_"+str(num)+" like DiffDetection"
+           #try: self.scratchDb.execute(sql)
+           #except: raise
 
 
@@ -199,4 +199,8 @@
         diffSkyFileID = self.number[num]
         self.logger.infoPair("Proccesing table", "DiffMeta_"+str(num))
+
+        sql = "CREATE TABLE DiffMeta_"+str(num)+" like DiffMeta"
+        try: self.scratchDb.execute(sql)
+        except: raise
 
         sqlLine = sqlUtility("INSERT INTO DiffMeta_"+str(num)+" (")
@@ -246,4 +250,7 @@
         ippTableName =  "SkyChip_psf_"+str(num)
         diffSkyFileID = self.number[num]
+        sql = "CREATE TABLE DiffDetection_"+str(num)+" like DiffDetection"
+        try: self.scratchDb.execute(sql)
+        except: raise
         #results['ORIGINALTOTAL'] = self.scratchDb.getRowCount(ippTableName)
 
@@ -405,4 +412,10 @@
         self.logger.infoPair("Procesing table", "DiffToImage")
 
+        sql = "CREATE TABLE DiffToImage_"+str(num)+" like DiffToImage"
+        try: self.scratchDb.execute(sql)
+        except: raise
+        #sql = "CREATE TABLE DiffDetection_"+str(num)+" like DiffDetection"
+        #try: self.scratchDb.execute(sql)
+        #except: raise
         imageIDs = self.gpc1Db.getImageIDsForThisDiffID(int(diffSkyFileID))
 
@@ -481,5 +494,5 @@
                a.airmass      = b.airmass, \
                a.expTime      = b.expTime, \
-               a.infoFlag2    = (b.flags << 13) | a.infoFlag2 \
+               a.infoFlag3    = b.flags  \
                WHERE a.ippDetectID = b.ippDetectID \
                AND b.imageID = " + str(imageID)
Index: trunk/ippToPsps/jython/forcedwarpbatch.py
===================================================================
--- trunk/ippToPsps/jython/forcedwarpbatch.py	(revision 38601)
+++ trunk/ippToPsps/jython/forcedwarpbatch.py	(revision 38602)
@@ -408,4 +408,5 @@
         sqlLine.group("a.telluricExt","b.telluricExt")
         sqlLine.group("a.airmass","b.airmass")
+        sqlLine.group("a.infoFlag3","b.flags")
         sql = sqlLine.makeEquals("WHERE a.ippDetectID = b.ippDetectID AND b.imageID = " +str( imageID))
         try: self.scratchDb.execute(sql)
Index: trunk/ippToPsps/jython/stackbatch.py
===================================================================
--- trunk/ippToPsps/jython/stackbatch.py	(revision 38601)
+++ trunk/ippToPsps/jython/stackbatch.py	(revision 38602)
@@ -344,5 +344,5 @@
           #  sqlLine.group("a."+filter+"telluricExt",   "b.telluricExt")
 
-            sqlLine.group("a."+filter+"infoFlag2",     "(b.flags << 13)")
+            sqlLine.group("a."+filter+"infoFlag3",     "b.flags")
             sql = sqlLine.makeEquals("WHERE a.objID = b.objID AND b.imageID = " + str(imageID) + " and a." + filter + "ippDetectID=b.ippDetectID")
 
Index: trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/Detection
===================================================================
--- trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/Detection	(revision 38601)
+++ trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/Detection	(revision 38602)
@@ -57,4 +57,5 @@
 infoFlag        dimensionless   INT     4       -999    flag indicating provenance information
 infoFlag2       dimensionless   INT     4       -999    flag indicating provenance information
+infoFlag3       dimensionless   INT     4       -999    flag indicating provenance information
 dataRelease     dimensionless   TINYINT 1         NA    Data release when this detection was originally taken. Recalibrations do not affect this value.
 --
Index: trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/Detection.txt
===================================================================
--- trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/Detection.txt	(revision 38601)
+++ trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/Detection.txt	(revision 38602)
@@ -56,4 +56,5 @@
 skyErr          + smf:SKY_SIGMA / exptime
 infoFlag        + smf:FLAGS
-infoFlag2       + smf:FLAGS2 | (dvo.measure.flags << 13)
+infoFlag2       + smf:FLAGS2
+infoFlag3       + dvo.measure.flags 
 dataRelease     + ippToPsps : user input (skychunk.dataRelease)
Index: trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetection
===================================================================
--- trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetection	(revision 38601)
+++ trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetection	(revision 38602)
@@ -68,3 +68,4 @@
 infoFlag 	dimensionless 	INT     4 	-999 	flag indicating provenance information
 infoFlag2	dimensionless 	INT     4 	-999 	flag indicating provenance information
+infoFlag3	dimensionless 	INT     4 	-999 	flag indicating provenance information
 dataRelease 	dimensionless 	TINYINT	1 	NA 	Data release when this detection was originally taken. Recalibrations do not affect this value.
Index: trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetection.txt
===================================================================
--- trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetection.txt	(revision 38601)
+++ trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetection.txt	(revision 38602)
@@ -68,4 +68,5 @@
 infoFlag 	 = smf
 infoFlag2	 = smf
+infoFlag3	 = dvo.measure db_flags
 dataRelease 	 = ipptopsps
 
Index: trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpMeasurement
===================================================================
--- trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpMeasurement	(revision 38601)
+++ trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpMeasurement	(revision 38602)
@@ -49,5 +49,6 @@
 skyErr          adu/sec/pixel   REAL    4       -999    estimated error in sky
 infoFlag        dimensionless   BIGINT  8       -999    flag indicating provenance information
-infoFlag2        dimensionless   BIGINT  8       -999    FLAG2 | flags << 13
+infoFlag2        dimensionless   BIGINT  8       -999    FLAG2 
+infoFlag3        dimensionless   BIGINT  8       -999    dvo measure flags
 dataRelease     dimensionless   TINYINT 1       NA      Data release when this detection was originally taken. Recalibrations do not affect this value.
 
Index: trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpMeasurement.txt
===================================================================
--- trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpMeasurement.txt	(revision 38601)
+++ trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpMeasurement.txt	(revision 38602)
@@ -49,4 +49,5 @@
 skyErr           = smf:SKY_SIGMA / exptime
 infoFlag         = smf:FLAGS
-infoFlag2        = smf:FLAGS2 | (dvo.measure.flags << 13)
+infoFlag2        = smf:FLAGS2
+infoFlag3        = dvo.measure.flags
 dataRelease      = ipptopsps
Index: trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin
===================================================================
--- trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin	(revision 38601)
+++ trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin	(revision 38602)
@@ -34,4 +34,5 @@
 ginfoFlag         dimensionless   INT      4          0    informational bits
 ginfoFlag2        dimensionless   INT      4          0    informational bits
+ginfoFlag3        dimensionless   INT      4          0    informational bits
 gnFrames          dimensionless   INT      4       -999    Number of frames contributing to source
 
Index: trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin.txt
===================================================================
--- trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin.txt	(revision 38601)
+++ trunk/ippToPsps/pspsschema/SchemaNew21.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin.txt	(revision 38602)
@@ -35,4 +35,5 @@
 gKronMagErr  	   + dvo = measure.dMkron
 ginfoFlag          + smf : FLAGS
-ginfoFlag2         - smf + dvo : FLAGS2 | measure.flags << 13 *** we only include measure.dbflags, not secfilt.flags
+ginfoFlag2         - smf : FLAGS2 
+ginfoFlag3         - dvo.measure.db_flags 
 gnFrames           + smf : N_FRAMES
