- Timestamp:
- Sep 6, 2011, 11:00:22 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110710/ippToPsps/jython
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
stackbatch.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110710/ippToPsps/jython
-
Property svn:ignore
set to
*.class
-
Property svn:ignore
set to
-
branches/eam_branches/ipp-20110710/ippToPsps/jython/stackbatch.py
r31847 r32337 27 27 def __init__(self, 28 28 logger, 29 configPath, 29 30 configDoc, 30 31 gpc1Db, … … 34 35 super(StackBatch, self).__init__( 35 36 logger, 37 configPath, 36 38 configDoc, 37 39 gpc1Db, 38 40 ippToPspsDb, 39 41 stackID, 40 "stack", 41 gpc1Db.getStackStageCmf(stackID), 42 "3PI") # TODO 42 "ST", 43 gpc1Db.getStackStageCmf(stackID)) 43 44 44 45 if not self.everythingOK: return … … 48 49 # get stack meta data 49 50 meta = self.gpc1Db.getStackStageMeta(self.id) 51 if not meta: 52 self.everythingOK = False 53 return 54 50 55 self.filter = meta[0]; 51 56 self.filter = self.filter[0:1] 52 57 self.skycell = meta[1]; 53 self.skycell = self.skycell[8:] 58 # TODO HACK fix this 59 self.skycell = self.skycell[8:12] 54 60 # mangling e.g. 0683.043 into 0683043 for now until we have a schema change 55 self.skycell = self.skycell.replace(".", "")61 #self.skycell = self.skycell.replace(".", "") 56 62 self.analysisVer = meta[2]; 57 63 … … 87 93 # insert sourceID/imageID combo so DVO can look it up 88 94 if not self.useFullTables: 89 self.scratchDb.insertNewDvoImage(self.header['SOURCEID'], self.header['IMAGEID']) 90 91 ''' 92 Prints metadata to the log 93 ''' 94 def printMe(self): 95 96 super(StackBatch, self).printMe() 97 95 self.scratchDb.insertNewDvoExternID(self.header['SOURCEID'], self.header['IMAGEID']) 96 97 98 # dump stuff to log 98 99 self.logger.infoPair("Stack ID", "%d" % self.id) 99 100 self.logger.infoPair("Stack type", "%s" % self.stackType) 100 101 self.logger.infoPair("Skycell", "%s" % self.skycell) 101 102 self.logger.infoPair("Filter", "%s" % self.filter) 103 102 104 103 105 … … 383 385 self.updateStackTypeID("StackDetection") 384 386 self.updateDvoIDs("StackDetection") 385 sql = "ALTER TABLE StackDetection ADD PRIMARY KEY (objID, stackDetectID)"386 self.scratchDb.execute(sql) 387 387 sql = "ALTER IGNORE TABLE StackDetection ADD PRIMARY KEY (objID)" 388 self.scratchDb.execute(sql) 389 388 390 if self.stackType == "DEEP_STACK": 389 391 … … 392 394 SET instFlux = 2*b.PSF_INST_FLUX_SIG \ 393 395 WHERE instFlux IS NULL \ 396 AND a.ippDetectID = b.IPP_IDET \ 394 397 AND b.PSF_INST_FLUX_SIG IS NOT NULL" 395 398 self.scratchDb.execute(sql) 396 # instFlux = 2*PSF_INST_FLUX_SIG397 399 398 400 self.scratchDb.reportAndDeleteRowsWithNULLS("StackDetection", "instFlux") … … 588 590 589 591 imageID = self.scratchDb.getImageIDFromExternID(self.header['SOURCEID'], self.header['IMAGEID']) 590 591 592 self.logger.debug("Updating table '" + table + "' with DVO IDs...") 592 sql = "UPDATE IGNORE " + table + " AS a, " + self.scratchDb.dvoDetection+ " AS b SET \593 sql = "UPDATE " + table + " AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \ 593 594 a.ippObjID = b.ippObjID, \ 594 595 a.stackDetectID = b.detectID, \
Note:
See TracChangeset
for help on using the changeset viewer.
