Index: trunk/ippToPsps/jython/objectbatch.py
===================================================================
--- trunk/ippToPsps/jython/objectbatch.py	(revision 34615)
+++ trunk/ippToPsps/jython/objectbatch.py	(revision 34630)
@@ -113,4 +113,6 @@
         self.logger.infoPair("Adding magnitudes from", "cps table")
         for filter in filters:
+
+            filterID = self.scratchDb.getFilterID(filter[1])
 
             sql = "UPDATE Object JOIN \
@@ -129,8 +131,6 @@
                    ," + filter[1] + "80pct = MAG_80/1000 \
                    ," + filter[1] + "Flags = FLAGS  \
-                   ," + filter[1] + "StackDetectID = STACK_ID"
-
-            #stackDetectID needs to be filled still for SA10 - currently at STACK_ID for test purposes
-            # everthing should be correctly calculated as mags for SA10       
+                   ," + filter[1] + "StackDetectID = (10 * STACK_DETECT_ID) + " + str(filterID)
+
             #self.logger.info(sql)
             self.scratchDb.execute(sql)
