IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 17, 2014, 1:24:02 PM (12 years ago)
Author:
heather
Message:

final on diff batches - they work, all columns I can fill are properly filled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/batch.py

    r37551 r37754  
    382382        self.logger.infoPair("Min objID", "%ld" % self.minObjID)
    383383        self.logger.infoPair("Max objID", "%ld" % self.maxObjID)
     384
     385
     386    '''                                                                                           
     387    Sets min and max obj ID using the provided table, or list of tables                           
     388    '''
     389    def setMinMaxDiffObjID(self, tables):
     390        first = True
     391        self.totalDetections = 0
     392        for table in tables:
     393            sql = "SELECT MIN(diffObjID), MAX(diffObjID), COUNT(diffObjID) FROM " + table
     394            rs = self.scratchDb.executeQuery(sql)
     395            rs.first()
     396            self.totalDetections = self.totalDetections + rs.getLong(3)
     397            if first:
     398                self.minObjID = rs.getLong(1)
     399                self.maxObjID = rs.getLong(2)
     400            else:
     401                if rs.getLong(1) < self.minObjID: self.minObjID = rs.getLong(1)
     402                if rs.getLong(2) > self.maxObjID: self.maxObjID = rs.getLong(2)
     403            first = False
     404            rs.close()
     405        self.ippToPspsDb.updateDetectionStats(self.batchID, self.minObjID, self.maxObjID, self.totalDetections)
     406        self.logger.infoPair("Total detections", "%ld" % self.totalDetections)
     407        self.logger.infoPair("Min objID", "%ld" % self.minObjID)
     408        self.logger.infoPair("Max objID", "%ld" % self.maxObjID)
     409
     410
    384411
    385412    '''
Note: See TracChangeset for help on using the changeset viewer.