IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 11, 2015, 1:31:50 PM (12 years ago)
Author:
eugene
Message:

merge changes from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/ippToPsps/jython/detectionbatch.py

    r37355 r37801  
    214214        sqlLine.group("completMag",       self.getKeyFloat(header, "%.8f", 'FLIMIT'))
    215215        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'))
    217217        sqlLine.group("numAstroRef",      self.getKeyValue(header, 'NASTRO'))
    218218        sqlLine.group("numPhotoRef",      self.getKeyValue(header, 'NASTRO'))
     
    336336
    337337        sqlLine.group("ippDetectID",     "IPP_IDET")                                               
    338         sqlLine.group("randomDetID",     "FLOOR(RAND()*9223372036854775807)")                       
     338        sqlLine.group("randomDetID",     "FLOOR(RAND("+str(self.batchID)+")*9223372036854775807)")                       
    339339        sqlLine.group("filterID",        str(self.filterID))                                       
    340340        sqlLine.group("surveyID",        str(self.surveyID))                                       
     
    607607
    608608    '''
     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    '''
    609623    Does the processing, i.e. pulling stuff from IPP tables into PSPS tables
    610624    '''
     
    637651        results['NULLOBJID'] = self.scratchDb.reportAndDeleteRowsWithNULLS("Detection_" + chipname, "objID")
    638652        #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)
    639656        self.updateImageID("Detection_" + chipname, x, y)
    640657        #self.logger.info("updateImageId")
Note: See TracChangeset for help on using the changeset viewer.