- Timestamp:
- Jan 11, 2015, 1:31:50 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/ippToPsps/jython/detectionbatch.py
r37355 r37801 214 214 sqlLine.group("completMag", self.getKeyFloat(header, "%.8f", 'FLIMIT')) 215 215 sqlLine.group("astroScat", self.getKeyFloat(header, "%.8f", 'CERROR')) 216 sqlLine.group("photoScat", self.getKeyFloat(self.header, "%.8f", 'ZPT_ OBS'))216 sqlLine.group("photoScat", self.getKeyFloat(self.header, "%.8f", 'ZPT_ERR')) 217 217 sqlLine.group("numAstroRef", self.getKeyValue(header, 'NASTRO')) 218 218 sqlLine.group("numPhotoRef", self.getKeyValue(header, 'NASTRO')) … … 336 336 337 337 sqlLine.group("ippDetectID", "IPP_IDET") 338 sqlLine.group("randomDetID", "FLOOR(RAND( )*9223372036854775807)")338 sqlLine.group("randomDetID", "FLOOR(RAND("+str(self.batchID)+")*9223372036854775807)") 339 339 sqlLine.group("filterID", str(self.filterID)) 340 340 sqlLine.group("surveyID", str(self.surveyID)) … … 607 607 608 608 ''' 609 Updates table and generates pspsuniqueids 610 ''' 611 612 def updatePspsUniqueIDs(self,table, ota): 613 sql = "UPDATE "+table+" join (select @r:=@r+1 rownum, objID from \ 614 (select @r:=0) r, "+table+" t) as foo using (objID) set \ 615 uniquePspsP2id = ((" +str(self.batchID)+ "*1000000000 ) \ 616 + (" +str(ota) + "*10000000 )+rownum)" 617 try: self.scratchDb.execute(sql) 618 except: 619 self.logger.errorPair('failed sql',sql) 620 raise 621 622 ''' 609 623 Does the processing, i.e. pulling stuff from IPP tables into PSPS tables 610 624 ''' … … 637 651 results['NULLOBJID'] = self.scratchDb.reportAndDeleteRowsWithNULLS("Detection_" + chipname, "objID") 638 652 #self.logger.info("deleted nulls") 653 self.logger.info("add psps unique p2 ids") 654 ota = x*10+y 655 self.updatePspsUniqueIDs("Detection_" + chipname, ota) 639 656 self.updateImageID("Detection_" + chipname, x, y) 640 657 #self.logger.info("updateImageId")
Note:
See TracChangeset
for help on using the changeset viewer.
