IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 25, 2011, 9:39:26 AM (15 years ago)
Author:
rhenders
Message:

Was writing ImageMeta for empty Detection table: fixed

File:
1 edited

Legend:

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

    r31357 r31365  
    5050           self.startY = 0
    5151           self.endY = 8
     52
     53       #self.startX = 6
     54       #self.endX = 7
     55       #self.startY = 7
     56       #self.endY = 8
    5257
    5358       self.obsTime = float(self.header['MJD-OBS']) + (float(self.header['EXPTIME']) / 172800.0)
     
    556561                self.updateDvoIDs("Detection_" + ota, sourceIDs[ota], imageIDs[ota])
    557562
     563                self.scratchDb.reportAndDeleteRowsWithNULLS("Detection_" + ota, "objID")
     564                self.updateImageID("Detection_" + ota, x, y)
     565               
    558566                # check we have something in this Detection table
    559567                if self.scratchDb.getRowCount("Detection_" + ota) < 1:
     
    561569                    continue;
    562570
    563                 self.scratchDb.reportAndDeleteRowsWithNULLS("Detection_" + ota, "objID")
    564                 self.updateImageID("Detection_" + ota, x, y)
    565                
    566571                # update ImageMeta with count of detections for this OTA and photoCodeID
    567572                sql = "UPDATE ImageMeta_" + ota + " SET nDetect = %d, photoCalID = %d" % (self.scratchDb.getRowCount("Detection_" + ota), self.scratchDb.getPhotoCalID(header['SOURCEID'], header['IMAGEID']))
     
    580585                otaCount = otaCount + 1
    581586
     587        # if we only have one table export, i.e. FrameMeta, then get out of here
     588        if len(self.tablesToExport) == 1:
     589           
     590            self.logger.error("No tables to export")
     591            return False
     592
    582593        self.setMinMaxObjID(tables)
    583594
     
    630641    file = gpc1Db.getCameraStageSmf(camID)
    631642    #file = "detdemo.fits"
    632     detectionBatch = DetectionBatch(logger, camID, file, True)
    633 
    634     if not detectionBatch.alreadyProcessed():
     643    detectionBatch = DetectionBatch(logger, camID, file, False)
     644
     645    if detectionBatch.alreadyProcessed():
    635646
    636647        detectionBatch.createEmptyPspsTables()
     
    640651            detectionBatch.writeBatchManifest()
    641652            detectionBatch.reportNullsInAllPspsTables(False)
    642             #detectionBatch.createTarball()
    643             #detectionBatch.publishToDatastore()
     653            detectionBatch.createTarball()
     654            detectionBatch.publishToDatastore()
    644655   
    645656    i = i+1
Note: See TracChangeset for help on using the changeset viewer.