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/loader.py

    r36709 r37129  
    160160                    self.logger.infoPair(batchType + " items found in this box", "%d" % len(ids))
    161161
    162                     useFullTables = 0
    163162                    if batchType != "OB":
    164 
    165                         if (self.dvoDetections.useStilts):
    166                             # look in DVO for this box (with extra border)
    167                             self.logger.infoPair("Querying DVO for this sky area", "")
    168 
    169                             # XXXX EAM : This code should not be used anymore
    170                             boxSize = 0.0
    171                             self.dvoDetections.setSkyAreaAsBox(boxDim['RA'], boxDim['DEC'], boxSize)
    172                             #self.dvoDetections.setSkyArea()
    173                             sizeToBeIngested = self.dvoDetections.getDiskSizeOfRegionsToBeIngested()
    174                             if sizeToBeIngested == 0.0: smfsPerGB = 999999999
    175                             else: smfsPerGB = len(ids)/sizeToBeIngested
    176                             self.logger.infoPair("DVO to be ingested", "%7.1e GB" % sizeToBeIngested)
    177                             self.logger.infoPair("smfs-per-GB", "%.1f" % smfsPerGB)
    178 
    179                             # should do we pre-ingest stuff from DVO?
    180                             # NOTE EAM : this skychunk loads the dvo detections into the mysql db
    181                             # XXXX EAM : this should happen for both P2 and Stack detection
    182                             # XXXX EAM : in parallel model, this should happen for all P2 & Stack batches
    183                             #
    184                             if (batchType == 'P2' or batchType == 'ST' or batchType == 'DF' or batchType == 'FW') and smfsPerGB > 30:
    185                                 if not self.dvoDetections.sync():
    186                                     self.logger.errorPair("Could not sync DVO with MySQL", "skipping")
    187                                     continue
    188                                
    189                                 useFullTables = 1
    190                         else:
    191                             # XXX EAM : this is not currently optional
    192                             # (it is the only path). either remove the
    193                             # non-native ingest code or make it an
    194                             # option if we are using the native
    195                             # loader, always use it need to work out a
    196                             # good boundary / region strategy in
    197                             # coordination with impact of mysql
    198                             # insertion
    199                             if not self.ippToPspsDb.isBoxIngested(boxId, self.scratchDb.dbHost):
    200                                 if not self.dvoDetections.nativeIngestDetections(boxId, boxDim):
    201                                     self.logger.error("Unable to ingest detections with nativeIngest")
    202                                     return False
    203 
    204                             useFullTables = 1
    205                
    206                     ## else:
    207                     ##     # if we are using the native loader, always use it
    208                     ##     # need to work out a good boundary / region strategy in coordination with
    209                     ##     # impact of mysql insertion
    210                     ##     self.dvoObjects.nativeIngestObjects(boxDim['RA'], boxDim['DEC'], boxSizeSansBorder)
    211                     ##     useFullTables = 1
     163                        if not self.ippToPspsDb.isBoxIngested(boxId, self.scratchDb.dbHost):
     164                            if not self.dvoDetections.nativeIngestDetections(boxId, boxDim):
     165                                self.logger.error("Unable to ingest detections with nativeIngest")
     166                                return False
    212167
    213168                    '''
    214169                    NOTE EAM : "TheseItems" refers to each of the stack CMFs, camera SMFs, or object batches
    215170                    '''
    216                     self.logger.infoBool("Using pre-ingested DVO data?", useFullTables)
    217                     if not self.processTheseItems(batchType, ids, useFullTables):
     171                    if not self.processTheseItems(batchType, ids):
    218172                        abort = True
    219173                        break
     
    228182    Actually loops through items and processes them
    229183    '''
    230     def processTheseItems(self, batchType, ids, useFullTables):
     184    def processTheseItems(self, batchType, ids):
    231185   
    232186        self.logger.infoPair("%s items queued" % batchType, "%d" % len(ids))
     
    262216                            self.scratchDb,
    263217                            id,
    264                             batchID,
    265                             useFullTables)
     218                            batchID)
    266219                elif batchType == "ST":
    267220                    self.logger.infoPair("defining ST batch for sky_id:",id)
     
    273226                            self.scratchDb,
    274227                            id,
    275                             batchID,
    276                             useFullTables)
     228                            batchID)
    277229   
    278230                elif batchType == "OB":
     
    284236                            self.scratchDb,
    285237                            id,
    286                             batchID,
    287                             useFullTables)
     238                            batchID)
    288239   
    289240                elif batchType == "DF":
     
    295246                            self.scratchDb,
    296247                            id,
    297                             batchID,
    298                             useFullTables)
     248                            batchID)
    299249   
    300250                elif batchType == "DO":
     
    306256                            self.scratchDb,
    307257                            id,
    308                             batchID,
    309                             useFullTables)
     258                            batchID)
    310259   
    311260                elif batchType == "FW":
     
    317266                            self.scratchDb,
    318267                            id,
    319                             batchID,
    320                             useFullTables)
     268                            batchID)
    321269   
    322270                elif batchType == "FO":
     
    328276                            self.scratchDb,
    329277                            id,
    330                             batchID,
    331                             useFullTables)
     278                            batchID)
    332279                   
    333280                batch.run()
Note: See TracChangeset for help on using the changeset viewer.