IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36709


Ignore:
Timestamp:
Apr 30, 2014, 4:28:10 PM (12 years ago)
Author:
heather
Message:

stacks need a lot of work

Location:
trunk/ippToPsps/jython
Files:
3 edited

Legend:

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

    r36697 r36709  
    8787
    8888            stage = "skycal"
    89             sql = "SELECT DISTINCT stack_id, radeg, decdeg FROM skycalRun \
     89            sql = "SELECT DISTINCT sky_id, radeg, decdeg FROM skycalRun \
    9090                   JOIN addRun ON(skycalRun.skycal_id = addRun.stage_id) \
    9191                   JOIN minidvodbRun USING(minidvodb_name) \
     
    499499
    500500
     501    '''
     502    grabs the stackID for a particular skyId, filter, and dvodb
     503    the mapping of stack_id from sky_id is not unique unless
     504    joined to the dvodb
     505    '''
     506    def getStackIDsFromSkyID(self,dvoDb,skyID,filter):
     507
     508        self.logger.infoPair("finding stack_ids from gpc1 for sky_id ", skyID)
     509
     510        sql = "SELECT DISTINCT stack_id from skycalRun \
     511               JOIN addRun ON(skycalRun.skycal_id = addRun.stage_id) \
     512               JOIN minidvodbRun USING(minidvodb_name) \
     513               JOIN minidvodbProcessed USING(minidvodb_id) \
     514               JOIN mergedvodbRun USING(minidvodb_id) \
     515               JOIN mergedvodbProcessed USING(merge_id) \
     516               JOIN stackRun USING (stack_id) \
     517               WHERE mergedvodbRun.mergedvodb = '" + dvoDb + "' \
     518               AND minidvodbRun.state = 'merged' \
     519               AND minidvodbProcessed.fault = 0 \
     520               AND mergedvodbRun.state = 'full' \
     521               AND mergedvodbProcessed.fault = 0  \
     522               AND addRun.stage = 'skycal' \
     523               AND addRun.state = 'full' \
     524               AND filter = '" + filter + "' \
     525               AND sky_id = '" + skyID + "'"
     526             
     527        try:
     528            rs = self.executeQuery(sql)
     529            while (rs.next()):
     530                rows.append([rs.getInt(1)])
     531            rs.close()   
     532        except:   
     533            self.logger.exception("can't query for stackid in DVO")
     534            self.logger.infoPair("failed sql:", sql)
     535            return rows
     536
     537        self.logger.infoPair("number of stackIDs found ", len(rows))
     538        return rows
  • trunk/ippToPsps/jython/loader.py

    r36697 r36709  
    234234        # loop round IDs of all items to be processed
    235235        self.ippToPspsDb.lockBatchTable()
    236         self.logger.infoPair("heather:","lockbatchtable")
     236        #self.logger.infoPair("heather:","lockbatchtable")
    237237        unattemptedCount = 0
    238238        for id in ids:
    239             self.logger.infoPair("heather:","in ids")
    240             self.logger.infoPair("heather:id",str(id))
     239            #self.logger.infoPair("heather:","in ids")
     240            #self.logger.infoPair("heather:id",str(id))
    241241            batchID = self.ippToPspsDb.createNewBatch(batchType, id)
    242             self.logger.infoPair("heather:","creatednewbatch")
    243             self.logger.infoPair("heather:batchId", str(batchID))
     242            #self.logger.infoPair("heather:","creatednewbatch")
     243            #self.logger.infoPair("heather:batchId", str(batchID))
    244244            if batchID < 0:
    245245                unattemptedCount += 1
    246246                continue
    247             self.logger.infoPair("heather:","passed logic")
     247            #self.logger.infoPair("heather:","passed logic")
    248248            self.ippToPspsDb.unlockTables()
    249             self.logger.infoPair("heather:","unlock table")
     249            #self.logger.infoPair("heather:","unlock table")
    250250            self.ippToPspsDb.deletePendingItem(batchType, id)
    251             self.logger.infoPair("heather:","deleted pending item")
     251            #self.logger.infoPair("heather:","deleted pending item")
    252252
    253253            # catch any raised exceptions in batch constructors
    254254            try:
    255255                if batchType == "P2":
     256                    self.logger.infoPair("defining P2 batch for cam_id:",id)
    256257                    batch = DetectionBatch(self.logger,
    257258                            self.config,
     
    264265                            useFullTables)
    265266                elif batchType == "ST":
     267                    self.logger.infoPair("defining ST batch for sky_id:",id)
    266268                    batch = StackBatch(self.logger,
    267269                            self.config,
     
    328330                            batchID,
    329331                            useFullTables)
    330    
     332                   
    331333                batch.run()
    332334   
  • trunk/ippToPsps/jython/stackbatch.py

    r36706 r36709  
    3737                 ippToPspsDb,
    3838                 scratchDb,
    39                  stackID,
     39                 skyID,
    4040                 batchID,
    4141                 useFullTables):
     
    4848               ippToPspsDb,
    4949               scratchDb,
    50                stackID,
     50               skyID,
    5151               batchID,
    5252               "ST",
    53                gpc1Db.getStackStageCmf(skychunk.dvoLabel, stackID),
     53               "",
     54               #gpc1Db.getStackStageCmf(skychunk.dvoLabel, stackID),
    5455               useFullTables)
    5556
    5657       # self.printline = 0
    5758       # # self.testprint()
    58 
     59       self.logger.infoPair("did I get", "here");
    5960       self.stackType = "DEEP_STACK" # TODO
    6061
     
    917918    '''
    918919    def populatePspsTables(self):
    919 
     920        self.infoPair("starting","populatePspsTables");
    920921        self.skipBatch = False
    921 
    922         if not self.useFullTables:
    923             if not self.getIDsFromDVO():
    924                 return False
    925         #self.logger.infoPair("populating","StackMeta")   
    926         self.populateStackMeta()
    927         #self.logger.infoPair("populating","StackObject")
    928         self.populateStackObject()
    929        
    930         if self.stackType != "NIGHTLY_STACK":
    931             #self.logger.infoPair("populating","StackModelFit")
    932             self.populateStackModelFit()
    933             #self.logger.infoPair("populating","StackApFlx")
    934             self.populateStackApFlx()
    935         #self.logger.infoPair("populating","StackToImage")
    936         self.populateStackToImage()
    937         #self.logger.infoPair("populating","StackObjectCalib")
    938         self.populateStackObjectCalib()
    939 
    940         self.setMinMaxObjID(["StackObject"])
     922     
     923        # HAF everything is commented out for now with ##
     924        ##if not self.useFullTables:
     925        ##     if not self.getIDsFromDVO():
     926        ##        return False
     927        ##self.logger.infoPair("populating","StackMeta")   
     928        ##self.populateStackMeta()
     929        ##self.logger.infoPair("populating","StackObject")
     930        ##self.populateStackObject()
     931       
     932        ##if self.stackType != "NIGHTLY_STACK":
     933            ##self.logger.infoPair("populating","StackModelFit")
     934            ##self.populateStackModelFit()
     935            ##self.logger.infoPair("populating","StackApFlx")
     936            ##self.populateStackApFlx()
     937        ##self.logger.infoPair("populating","StackToImage")
     938        ##self.populateStackToImage()
     939        ##self.logger.infoPair("populating","StackObjectCalib")
     940        ##self.populateStackObjectCalib()
     941
     942        ##self.setMinMaxObjID(["StackObject"])
    941943       
    942         if self.totalDetections < 1:
    943 
    944             self.logger.error("No detections to publish")
    945             return False
    946 
     944        ##if self.totalDetections < 1:
     945
     946            ##self.logger.error("No detections to publish")
     947            ##return False
     948        self.infoPair("finishing","populatePspsTables");
    947949        return True
    948950
Note: See TracChangeset for help on using the changeset viewer.