IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34661


Ignore:
Timestamp:
Nov 6, 2012, 3:19:54 PM (14 years ago)
Author:
heather
Message:

current working ipptopsps - has too much info/debug/print stuff and also funny out of range number hack

Location:
trunk/ippToPsps/jython
Files:
4 edited

Legend:

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

    r33858 r34661  
    638638            and not self.processingNow(batchType, stageID) \
    639639            and not self.consistentlyFailed(batchType, stageID)):
     640           
     641            self.logger.infoPair("heather:","passed logic")
    640642
    641643            sql = "INSERT INTO batch ( \
     
    652654                       '" + self.config.datastoreProduct + "' \
    653655                       )"
     656            self.logger.infoPair("heather:","sql")
    654657
    655658            self.execute(sql)
  • trunk/ippToPsps/jython/loader.py

    r33832 r34661  
    123123
    124124                self.logger.infoPair("Boxes with unprocessed data", "%d" % len(boxIds))
    125    
     125                self.logger.infoPair("numAttempts", str(numAttempts))
    126126                if len(boxIds) > 0: numAttempts = 0
    127127
    128128                for boxId in boxIds:
    129          
     129                    self.logger.infoPair("Check","client status")
    130130                    if not self.checkClientStatus():
    131131                        abort = True
    132132                        break
    133    
     133                    self.logger.infoPair("client status", "ok")
    134134                    # get box info. if boxes have changed, break and start again
    135135                    try:
     
    138138                        self.logger.infoPair("Can't get details for this box", "%d" % boxId)
    139139                        break
    140      
     140                    self.logger.infoPair("client status", "ok")
    141141                    ids = self.ippToPspsDb.getPendingIdsForThisBox(boxId, batchType)
    142142               
     
    150150                    self.logger.infoPair(batchType + " items found in this box", "%d" % len(ids))
    151151                    boxSizeWithBorder = boxDim['SIDE'] + (self.config.BORDER * 2)
    152      
     152                    self.logger.infoPair("got here", "ok")
    153153                    useFullTables = 0
    154154                    if batchType != "OB":
     
    174174                        abort = True
    175175                        break
    176 
     176                    self.logger.infoPair("processed","ok")
    177177            if abort or not self.checkClientStatus(): abort = True
    178178            elif numAttempts > 1 and not self.waitForPollTime():  break
     
    188188        # loop round IDs of all items to be processed
    189189        self.ippToPspsDb.lockBatchTable()
     190        self.logger.infoPair("heather:","lockbatchtable")
    190191        unattemptedCount = 0
    191192        for id in ids:
    192    
     193            self.logger.infoPair("heather:","in ids")
     194            self.logger.infoPair("heather:id",str(id))
    193195            batchID = self.ippToPspsDb.createNewBatch(batchType, id)
    194            
     196            self.logger.infoPair("heather:","creatednewbatch")
     197            self.logger.infoPair("heather:batchId", str(batchID))
    195198            if batchID < 0:
    196199                unattemptedCount += 1
    197200                continue
    198    
     201            self.logger.infoPair("heather:","passed logic")
    199202            self.ippToPspsDb.unlockTables()
     203            self.logger.infoPair("heather:","unlock table")
    200204            self.ippToPspsDb.deletePendingItem(batchType, id)
     205            self.logger.infoPair("heather:","deleted pending item")
    201206
    202207            # catch any raised exceptions in batch constructors
     
    234239   
    235240            # if batch fails, ignore and move on to the next one
    236             except:
     241            except Exception, e:
     242                self.logger.error("EXCEPTION: " + str(e))
    237243                self.logger.errorPair("Problem with this %s batch (%d)" % (batchType, id), "skipping")
    238244                pass
    239245
    240246            if not self.checkClientStatus(): return False
    241    
     247            self.logger.infoPair("checkclient status", "ok")
     248
    242249            self.ippToPspsDb.lockBatchTable()
    243    
     250            self.logger.infoPair("lockbatchtable", "ok")
    244251            self.logger.infoSeparator()
    245252   
  • trunk/ippToPsps/jython/objectbatch.py

    r34649 r34661  
    206206        cpsTableName = self.scratchDb.getDbFriendlyTableName(self.region + ".cps")
    207207
    208         self.logger.infoPair("Populating", "Object")
     208        self.logger.infoPair("setting to null  > 1e-38 and < 1e-38 in", "cps FLUX_KRON_ERR")
     209        sql = "UPDATE " + cpsTableName + " set FLUX_KRON_ERR = NULL where FLUX_KRON_ERR < 1e-37 AND FLUX_KRON_ERR > -1e-37 "
     210     
     211        try:
     212            self.scratchDb.execute(sql)
     213        except:
     214            self.logger.errorPair("Couldn't squash out of range stuff", sql)
     215            return False
     216
     217        self.logger.infoPair("setting to null  > 1e-38 and < 1e-38 in", "cps FLUX_KRON")
     218        sql = "UPDATE " + cpsTableName + " set FLUX_KRON = NULL where FLUX_KRON < 1e-37 AND FLUX_KRON > -1e-37 "
     219     
     220        try:
     221            self.scratchDb.execute(sql)
     222        except:
     223            self.logger.errorPair("Couldn't squash out of range stuff", sql)
     224            return False
     225
     226
     227
     228
     229       
     230        self.logger.infoPair("Populating", "Object s")
    209231        self.logger.infoPair("Inserting objects from", "cpt file")
    210232
  • trunk/ippToPsps/jython/stackbatch.py

    r34640 r34661  
    7575       self.skycell = self.skycell[8:12]
    7676       self.projectioncell = self.skycell
     77
     78       # proposed new values. Need to coordinate with the SkyCell table
     79       # this fits in 32 bits for 0 < tessID < 214
     80       # self.skycell = str( (tessID * (10000 * 1000)) + (int(self.projectioncell) * 1000) + cellID )
    7781
    7882       self.analysisVer = meta[2];
     
    611615               ,surveyID \
    612616               FROM StackDetection"
    613         self.logger.info(sql)
    614617        self.scratchDb.execute(sql)
    615618        # insert calibration information from dvoDetections into the Table
     
    623626            a.expTime = b.expTime, \
    624627            a.airMass = b.airMass   \
    625             WHERE a.objID = b.objID AND a.ippDetectID = b.ippDetectID"
    626         # XXXX: this qualifier assumes that there is only one stack being processed at a time
    627         self.logger.info(sql)
     628            WHERE a.stackDetectID = b.detectID"
    628629        self.scratchDb.execute(sql)
    629630        self.scratchDb.updateAllRows(tableName, "dataRelease", str(self.config.dataRelease))
     
    669670        self.scratchDb.execute("ALTER TABLE StackDetectionCalib CHANGE dec_ `dec` double")
    670671
    671 
    672 
    673672        return True
    674673
     
    696695        sql = "UPDATE " + table + " AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \
    697696               a.ippObjID = b.ippObjID, \
    698                a.stackDetectID = 10 * b.detectID + " + str(self.filterID) + ", \
     697               a.stackDetectID = b.detectID, \
    699698               a.objID = b.objID \
    700699               WHERE a.ippDetectID = b.ippDetectID \
     
    712711        sql = "UPDATE " + table + " AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \
    713712               a.ippObjID = b.ippObjID, \
    714                a.stackDetectID = 10 * b.detectID + " + str(self.filterID) + ", \
     713               a.stackDetectID = b.detectID, \
    715714               a.objID = b.objID, \
    716715               a.infoFlag = b.flags << 45 | a.infoFlag \
Note: See TracChangeset for help on using the changeset viewer.