IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 28, 2014, 6:20:27 AM (12 years ago)
Author:
eugene
Message:

dropping options for stilts dvo import methods; fixing a number of previously ignored errors (eg, dropping non-existent tables); allowing queue questions to strip leading and trailing spaces (so we can read from an input file); echo back the response so input from a file is clearer; re-write big sql blocks with new sql utility code; updating names in MeanObject, ObjectThin to be more consistent; add a new test code program; update detection fields to match new schema; drop the code for the old now-unused tables (detecitonCalib, SkinnyObject, etc)

Location:
branches/eam_branches/ipp-20140717/ippToPsps
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140717/ippToPsps

  • branches/eam_branches/ipp-20140717/ippToPsps/jython/stackbatch.py

    r36744 r37129  
    3939                 scratchDb,
    4040                 skyID,
    41                  batchID,
    42                  useFullTables):
     41                 batchID):
    4342
    4443       super(StackBatch, self).__init__(
     
    5251               batchID,
    5352               "ST",
    54                "",
    55                #gpc1Db.getStackStageCmf(skychunk.dvoLabel, stackID),
    56                useFullTables)
    57 
    58        # self.printline = 0
    59        # # self.testprint()
    60 #       self.logger.infoPair("did I get", "here");
     53               None)
     54
    6155       self.stackType = "DEEP_STACK" # TODO
    6256       ## = stuff I commented out for pv2 stacks
     
    215209       self.scratchDb.dropTable("StackObject")
    216210       self.logger.infoPair("dropping table:","StackModelFit")
    217               
     211       self.scratchDb.dropTable("SkinnyObject")
    218212       self.scratchDb.dropTable("StackModelFit")
    219213       self.logger.infoPair("dropping table:","StackApFlx")
     
    262256       # insert what we know about this stack batch into the stack table
    263257       self.ippToPspsDb.insertStackMeta(self.batchID, "x" , self.stackType)
    264 
    265        # insert sourceID/imageID combo so DVO can look it up
    266        ##if not self.useFullTables:
    267        ##    self.scratchDb.insertNewDvoExternID(self.header['SOURCEID'], self.header['IMAGEID'])
    268 
    269        # self.testprint()
    270258
    271259       # dump stuff to log
     
    785773        self.logger.infoPair("Deleting", "entries with StackObject.objID = 0")
    786774        # response = raw_input("deleted objID is 0 ")
    787        
     775    '''
     776    Populates the SkinnyObject table
     777    '''
     778    def populateSkinnyObject(self):
     779
     780        self.logger.infoPair("Procesing table", "SkinnyObject")
     781
     782        sql = "INSERT INTO SkinnyObject (\
     783               objID \
     784               ,ippObjID \
     785               ,projectionCellID \
     786               ) \
     787               SELECT \
     788               DISTINCT objID \
     789               ,ippObjID \
     790               ,projectionCellID \
     791               FROM StackDetection"
     792        self.scratchDb.execute(sql)
     793
     794        self.scratchDb.updateAllRows("SkinnyObject", "surveyID", str(self.surveyID))
     795        self.scratchDb.updateAllRows("SkinnyObject", "dataRelease", str(self.skychunk.dataRelease))
     796         
    788797
    789798    '''
     
    11891198        self.logger.infoPair("starting","populatePspsTables");
    11901199        self.skipBatch = False
    1191         if not self.useFullTables:
    1192              if not self.getIDsFromDVO():
    1193                 return False
    1194         #do some basics first
     1200
     1201        # get the IDs from the DVO tables
     1202        if not self.getIDsFromDVO():
     1203            return False
     1204
     1205        # do some basics first:
    11951206        # populate stack meta per filter
    11961207        # insert objid/stackdetectid per filter to each table           
     
    13071318
    13081319        ##if self.totalDetections < 1:
     1320        #self.logger.infoPair("populating","SkinnyObject")
     1321        self.populateSkinnyObject()
    13091322
    13101323            ##self.logger.error("No detections to publish")
     
    13141327        self.tablesToExport.append("StackModelFit")
    13151328        self.tablesToExport.append("StackApFlx")
    1316 
     1329        self.tablesToExport.append("SkinnyObject")
    13171330        self.logger.infoPair("finishing","populatePspsTables");
    13181331        return True
Note: See TracChangeset for help on using the changeset viewer.