Index: /trunk/ippToPsps/jython/scratchdb.py
===================================================================
--- /trunk/ippToPsps/jython/scratchdb.py	(revision 32178)
+++ /trunk/ippToPsps/jython/scratchdb.py	(revision 32179)
@@ -153,4 +153,25 @@
         
     '''
+    Checks whether the astrometric solution is ok for this chip
+    TODO the value of 50 for numAstroRef is hardcoded here, but this should be temporary anyway
+    '''
+    def astrometricSolutionOK(self, ota):
+
+        sql = "SELECT numAstroRef FROM ImageMeta_" + ota
+
+        try:
+            rs = self.executeQuery(sql)
+            rs.first()
+            if rs.getInt(1) < 50:
+                self.logger.debug("Bad astrometric solution for",  ota)
+                return False
+            else:
+                return True
+        except:
+            self.logger.debug("Unable to check astrometric solution")
+
+        return True
+
+    '''
     Have we already imported this DVO table?
     '''
