IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32436


Ignore:
Timestamp:
Sep 22, 2011, 10:55:19 PM (15 years ago)
Author:
rhenders
Message:

new method to count total detections published for this label, epoch etc

File:
1 edited

Legend:

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

    r32362 r32436  
    208208
    209209        return ids
     210
     211    '''
     212    Returns the total detections published to the datastore for this epoch, dvo label and batch type
     213    '''
     214    def getTotalDetectionsPublished(self, batchType, epoch, dvoGpc1Label):
     215
     216        sql = "SELECT SUM(total_detections) \
     217               FROM batch \
     218               WHERE batch_type = '" + batchType + "' \
     219               AND timestamp > '" + epoch + "' \
     220               AND dvo_db = '" + dvoGpc1Label + "'"
     221
     222        total = -1
     223        try:
     224            rs = self.executeQuery(sql)
     225            rs.first()
     226            total =  rs.getInt(1)
     227        except:
     228            self.logger.exception("Can't query for total detections published")
     229
     230        rs.close()
     231
     232        self.logger.debug("Found %d detections" % total)
     233
     234        return total
    210235
    211236    '''
     
    273298    '''
    274299    def getStages(self):
    275         return ['processed', 'loaded_to_datastore', 'loaded_to_ODM', 'merge_worthy', 'merged', 'deleted_datastore', 'deleted_dxlayer', 'deleted_local']
     300        return ['processed', 'loaded_to_datastore', 'loaded_to_ODM', 'merge_worthy', 'deleted_datastore', 'merged', 'deleted_dxlayer', 'deleted_local']
    276301
    277302    '''
Note: See TracChangeset for help on using the changeset viewer.