- Timestamp:
- Mar 30, 2012, 2:49:37 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/ippToPsps/jython/stackbatch.py
r32588 r33638 30 30 def __init__(self, 31 31 logger, 32 configPath, 33 configDoc, 32 config, 34 33 gpc1Db, 35 34 ippToPspsDb, 35 scratchDb, 36 36 stackID, 37 batchID): 37 batchID, 38 useFullTables): 38 39 39 40 super(StackBatch, self).__init__( 40 41 logger, 41 configPath, 42 configDoc, 42 config, 43 43 gpc1Db, 44 44 ippToPspsDb, 45 scratchDb, 45 46 stackID, 46 47 batchID, 47 48 "ST", 48 gpc1Db.getStackStageCmf(stackID)) 49 gpc1Db.getStackStageCmf(config.dvoLabel, stackID), 50 useFullTables) 49 51 50 52 if not self.everythingOK: return … … 60 62 self.filter = meta[0]; 61 63 self.filter = self.filter[0:1] 64 self.filterID = self.scratchDb.getFilterID(self.filter) 62 65 self.skycell = meta[1]; 63 66 … … 77 80 self.analysisVer = meta[2]; 78 81 79 self.expTime = gpc1Db.getStackExpTime(self.id) 80 81 self.logger.debug("Got exp time of %d" % self.expTime) 82 #self.expTime = gpc1Db.getStackExpTime(self.id) 83 self.expTime = self.header['EXPTIME'] 82 84 83 85 # delete PSPS tables … … 281 283 " + str(self.id) + " \ 282 284 ," + self.skycell + " \ 283 ," + str(self.scratchDb.getPhotoCalID(self.header[' SOURCEID'], self.header['IMAGEID'])) + " \285 ," + str(self.scratchDb.getPhotoCalID(self.header['IMAGEID'])) + " \ 284 286 ," + self.header['FPA.ZP'] + " \ 285 ," + s tr(self.expTime)+ " \287 ," + self.expTime + " \ 286 288 ,'" + self.safeDictionaryAccess(self.header, 'PSFMODEL') + "' \ 287 289 ,'" + self.safeDictionaryAccess(self.header, 'FWHM_MAJ') + "' \ … … 304 306 self.scratchDb.updateAllRows("StackMeta", "surveyID", str(self.surveyID)) 305 307 self.scratchDb.updateFilterID("StackMeta", self.filter) 306 self.scratchDb.updateAllRows("StackMeta", "dataRelease", str(self. dataRelease))308 self.scratchDb.updateAllRows("StackMeta", "dataRelease", str(self.config.dataRelease)) 307 309 self.updateStackTypeID("StackMeta") 308 310 … … 400 402 self.scratchDb.updateAllRows("StackDetection", "surveyID", str(self.surveyID)) 401 403 self.scratchDb.updateFilterID("StackDetection", self.filter) 402 self.scratchDb.updateAllRows("StackDetection", "dataRelease", str(self. dataRelease))404 self.scratchDb.updateAllRows("StackDetection", "dataRelease", str(self.config.dataRelease)) 403 405 self.scratchDb.updateAllRows("StackDetection", "primaryF", "0") 404 406 self.scratchDb.updateAllRows("StackDetection", "activeFlag", "0") … … 442 444 # TODO temporarily loading 1st convolved fluxes into unconvolved fields 443 445 self.logger.infoPair("Adding fluxes", "un-convolved") 444 self.updateApFlxs("", " < 7.0")446 self.updateApFlxs("", "IS NULL") 445 447 self.logger.infoPair("Adding fluxes", "1st convolved") 446 448 self.updateApFlxs("c1", "< 7.0") … … 458 460 ,petR90=b.PETRO_RADIUS_90 \ 459 461 ,petR90Err=b.PETRO_RADIUS_90_ERR \ 462 ,petCf=b.PETRO_FILL \ 460 463 WHERE a.ippDetectID=b.IPP_IDET" 461 464 self.scratchDb.execute(sql) … … 463 466 self.scratchDb.updateAllRows("StackApFlx", "surveyID", str(self.surveyID)) 464 467 self.scratchDb.updateFilterID("StackApFlx", self.filter) 465 self.scratchDb.updateAllRows("StackApFlx", "dataRelease", str(self. dataRelease))468 self.scratchDb.updateAllRows("StackApFlx", "dataRelease", str(self.config.dataRelease)) 466 469 self.scratchDb.updateAllRows("StackApFlx", "primaryF", "0") 467 470 self.scratchDb.updateAllRows("StackApFlx", "activeFlag", "0") … … 497 500 self.scratchDb.updateAllRows("StackModelFit", "surveyID", str(self.surveyID)) 498 501 self.scratchDb.updateFilterID("StackModelFit", self.filter) 499 self.scratchDb.updateAllRows("StackModelFit", "dataRelease", str(self. dataRelease))502 self.scratchDb.updateAllRows("StackModelFit", "dataRelease", str(self.config.dataRelease)) 500 503 self.scratchDb.updateAllRows("StackModelFit", "primaryF", "0") 501 504 self.scratchDb.updateAllRows("StackModelFit", "activeFlag", "0") … … 515 518 rs.first() 516 519 nMissing = rs.getInt(1) 517 self.logger.infoPair("Detections deleted from %s that are not in StackDetection" + table, "%5d" % nMissing)518 520 519 521 if nMissing < 1: return … … 521 523 sql = "DELETE FROM " + table + " WHERE ippDetectID NOT IN (SELECT ippDetectID FROM StackDetection)" 522 524 self.scratchDb.execute(sql) 525 self.logger.infoPair("Detections not in StackDetection", "%d deleted from %s" % (nMissing, table)) 523 526 524 527 … … 562 565 563 566 self.scratchDb.updateAllRows("SkinnyObject", "surveyID", str(self.surveyID)) 564 self.scratchDb.updateAllRows("SkinnyObject", "dataRelease", str(self. dataRelease))567 self.scratchDb.updateAllRows("SkinnyObject", "dataRelease", str(self.config.dataRelease)) 565 568 566 569 ''' … … 582 585 583 586 self.scratchDb.updateFilterID("ObjectCalColor", self.filter) 584 self.scratchDb.updateAllRows("ObjectCalColor", "dataRelease", str(self. dataRelease))587 self.scratchDb.updateAllRows("ObjectCalColor", "dataRelease", str(self.config.dataRelease)) 585 588 586 589 … … 616 619 def updateDvoIDs(self, table): 617 620 618 imageID = self.scratchDb.getImageIDFromExternID(self.header[' SOURCEID'], self.header['IMAGEID'])621 imageID = self.scratchDb.getImageIDFromExternID(self.header['IMAGEID']) 619 622 self.logger.debug("Updating table '" + table + "' with DVO IDs...") 620 623 sql = "UPDATE " + table + " AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \ 621 624 a.ippObjID = b.ippObjID, \ 622 a.stackDetectID = b.detectID, \625 a.stackDetectID = 10 * b.detectID + " + str(self.filterID) + ", \ 623 626 a.objID = b.objID \ 624 627 WHERE a.ippDetectID = b.ippDetectID \ 625 AND b.sourceID = " + self.header['SOURCEID'] + "\626 628 AND b.imageID = " + str(imageID) 627 629 self.scratchDb.execute(sql)
Note:
See TracChangeset
for help on using the changeset viewer.
