IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 31, 2013, 4:13:09 PM (13 years ago)
Author:
eugene
Message:

split out config (static info) and skychunk (area being processed)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20121219/ippToPsps/jython/queue.py

    r35003 r35076  
    2929        # create various objects
    3030        self.gpc1Db = Gpc1Db(self.logger, self.config)
    31         self.datastore = Datastore(self.logger, self.config, self.ippToPspsDb)
     31        self.datastore = Datastore(self.logger, self.skychunk, self.ippToPspsDb)
    3232
    3333        try:
    34             self.dvoObjects = DvoObjects(self.logger, self.config)
     34            self.dvoObjects = DvoObjects(self.logger, self.config, self.skychunk)
    3535        except:
    3636            self.exitProgram("Unable to create instance of DvoObject")
    3737            raise
    3838
    39         self.config.printAll()
     39        self.skychunk.printAll()
    4040
    4141        if len(argv) > 2: self.parsePollTimeArg(sys.argv[2])
     
    4343    '''
    4444    Main processing loop.
    45     Tiled area is defined in config and looks for available stage_ids for each tile and writes them to ippToPsps database ready for processing
     45    Tiled area is defined in 'skychunk' and looks for available stage_ids for each tile and writes them to ippToPsps database ready for processing
    4646    by one or more loading clients that may be running on any host
    4747    '''
     
    5454       
    5555            # queue up batches that are processed but not loaded to datastore
    56             for batchType in self.config.batchTypes:
     56            for batchType in self.skychunk.batchTypes:
    5757
    5858                self.logger.infoTitle("Previous failed datastore loads")
     
    6666                if batchType == "OB":
    6767                    self.dvoObjects.setSkyArea(
    68                             self.config.minRa,
    69                             self.config.maxRa,
    70                             self.config.minDec,
    71                             self.config.maxDec)
     68                            self.skychunk.minRa,
     69                            self.skychunk.maxRa,
     70                            self.skychunk.minDec,
     71                            self.skychunk.maxDec)
    7272                    rows = self.dvoObjects.allPopulatedRegionInfo
    7373                    self.dvoObjects.printSummary()
     
    7676                else:
    7777                    rows = self.gpc1Db.getItemsInThisDVODbForThisStage(
    78                             self.config.dvoLabel,
     78                            self.skychunk.dvoLabel,
    7979                            batchType,
    80                             self.config.minRa,
    81                             self.config.maxRa,
    82                             self.config.minDec,
    83                             self.config.maxDec)
     80                            self.skychunk.minRa,
     81                            self.skychunk.maxRa,
     82                            self.skychunk.minDec,
     83                            self.skychunk.maxDec)
    8484
    8585                # EAM TEST I/O
     
    107107                self.ippToPspsDb.storeAllItems(pending)
    108108
    109                 # loop through full range of RA/Dec queueing stuff in boxes of size self.config.boxSize
     109                # loop through full range of RA/Dec queueing stuff in boxes of size self.skychunk.boxSize
    110110                if len(ids) > 0:
    111111
     
    115115   
    116116                    # starting positions
    117                     ra = self.config.minRa + self.config.halfBox
    118                     dec = self.config.minDec + self.config.halfBox
     117                    ra = self.skychunk.minRa + self.skychunk.halfBox
     118                    dec = self.skychunk.minDec + self.skychunk.halfBox
    119119   
    120                     while ra <= self.config.maxRa:
    121                        while dec <= self.config.maxDec:
     120                    while ra <= self.skychunk.maxRa:
     121                       while dec <= self.skychunk.maxDec:
    122122           
    123123                           box_id = self.ippToPspsDb.insertBox(ra, dec)
     
    128128                                       ra,
    129129                                       dec,
    130                                        self.config.boxSize,
     130                                       self.skychunk.boxSize,
    131131                                       len(ids)))
    132132               
    133133                           if len(ids) > 0: self.ippToPspsDb.insertPending(box_id, batchType, ids)
    134134
    135                            dec = dec + self.config.boxSize
    136                        dec = self.config.minDec + self.config.halfBox
    137                        ra = ra + self.config.boxSize
     135                           dec = dec + self.skychunk.boxSize
     136                       dec = self.skychunk.minDec + self.skychunk.halfBox
     137                       ra = ra + self.skychunk.boxSize
    138138           
    139139                self.logger.info("+-------------+-------------+-------------+-------------+")
     
    153153   
    154154            batchName = Batch.getNameFromID(batchID)
    155             subDir = Batch.getSubDir(self.config.basePath, batchType, self.config.dvoLabel)
     155            subDir = Batch.getSubDir(self.skychunk.basePath, batchType, self.skychunk.dvoLabel)
    156156            tarballFile = Batch.getTarballFile(batchID)
    157157            self.logger.infoPair("Batch name", batchName)
Note: See TracChangeset for help on using the changeset viewer.