IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 8, 2013, 9:46:47 AM (13 years ago)
Author:
heather
Message:

current ipptopsps

File:
1 edited

Legend:

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

    r35739 r35780  
    616616    '''
    617617    def populateStackApFlx(self):
     618        self.logger.infoPair("getting","imageID")
     619        imageID = self.scratchDb.getImageIDFromExternID(self.header['IMAGEID'])
     620        self.logger.infoPair("obtained","imageID")
    618621
    619622        self.logger.infoPair("Procesing", "StackApFlx")
     
    651654        self.scratchDb.execute(sql)
    652655
     656        self.logger.infoPair("adding"," PrimaryF to stackApFlx")
     657        sql = "UPDATE StackApFlx AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \
     658               a.primaryF = ((b.flags & 0x10000) >> 16 ) \
     659               WHERE a.ippDetectID = b.ippDetectID \
     660               AND b.imageID = " + str(imageID)
     661
     662        print "update dvo sql: ", sql
     663        # response = raw_input("update dvo...")
     664        self.scratchDb.execute(sql)
     665
     666       
     667
    653668        self.scratchDb.updateAllRows("StackApFlx", "surveyID", str(self.surveyID))
    654669        self.scratchDb.updateFilterID("StackApFlx", self.filter)
    655670        self.scratchDb.updateAllRows("StackApFlx", "dataRelease", str(self.skychunk.dataRelease))
    656         self.scratchDb.updateAllRows("StackApFlx", "primaryF", "0")
    657671        self.scratchDb.updateAllRows("StackApFlx", "activeFlag", "0")
    658672        self.updateStackMetaID("StackApFlx")
     
    667681    '''
    668682    def populateStackModelFit(self):
    669 
     683        self.logger.infoPair("getting","imageID")
     684        imageID = self.scratchDb.getImageIDFromExternID(self.header['IMAGEID'])
     685        self.logger.infoPair("obtained","imageID")
    670686        self.logger.infoPair("Procesing table", "StackModelFit")
     687
    671688
    672689        # insert all the detections
     
    688705        self.scratchDb.updateFilterID("StackModelFit", self.filter)
    689706        self.scratchDb.updateAllRows("StackModelFit", "dataRelease", str(self.skychunk.dataRelease))
    690         self.scratchDb.updateAllRows("StackModelFit", "primaryF", "0")
     707
     708        self.logger.infoPair("adding"," PrimaryF to stackApFlx")
     709        sql = "UPDATE StackModelFit AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \
     710               a.primaryF = ((b.flags & 0x10000) >> 16 ) \
     711               WHERE a.ippDetectID = b.ippDetectID \
     712               AND b.imageID = " + str(imageID)
     713
     714        print "update dvo sql: ", sql
     715        # response = raw_input("update dvo...")
     716        try:
     717            self.scratchDb.execute(sql)
     718        except:
     719            return
     720
    691721        self.scratchDb.updateAllRows("StackModelFit", "activeFlag", "0")
    692722        self.updateStackMetaID("StackModelFit")
     
    943973               a.stackDetectID = b.detectID, \
    944974               a.objID = b.objID, \
    945                a.infoFlag = b.flags << 45 | a.infoFlag \
     975               a.infoFlag = b.flags << 45 | a.infoFlag, \
    946976               a.primaryF = ((b.flags & 0x10000) >> 16 ) \
    947977               WHERE a.ippDetectID = b.ippDetectID \
    948978               AND b.imageID = " + str(imageID)
    949979
    950         # print "update dvo sql: ", sql
     980        print "update dvo sql: ", sql
    951981        # response = raw_input("update dvo...")
    952982        self.scratchDb.execute(sql)
Note: See TracChangeset for help on using the changeset viewer.