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

    r35063 r35076  
    3434        super(Loader, self).__init__(argv, 1, 1)
    3535
    36         if self.config.parallel:
     36        if self.skychunk.parallel:
    3737            print "PARALLEL dvo"
    3838        else:
     
    5757       
    5858        # create Datastore objects
    59         self.datastore = Datastore(self.logger, self.config, self.ippToPspsDb)
     59        self.datastore = Datastore(self.logger, self.skychunk, self.ippToPspsDb)
    6060
    6161        # if an IN batch is requested, create and quit
     
    6565               batch = InitBatch(self.logger,
    6666                       self.config,
     67                       self.skychunk,
    6768                       self.gpc1Db,
    6869                       self.ippToPspsDb,
     
    7778   
    7879
    79         # if an IN batch is requested, create and quit
     80        # if the 'once' option is passed, we do not loop multiple times in 'run'
    8081        self.onePassOnly = 0
    8182        if len(sys.argv) > 2 and sys.argv[2] == "once":
     
    8586        self.parsePollTimeArg("0.0166")
    8687
    87         self.config.printAll()
     88        self.skychunk.printAll()
    8889
    8990    '''
    9091    Overrides base-class version so we can ensure our scratch Db is using the right DVO Db
    9192    '''
    92     def refreshConfig(self):
    93 
    94         ret = super(Loader, self).refreshConfig()
     93    def refreshSkychunk(self):
     94
     95        ret = super(Loader, self).refreshSkychunk()
    9596        try: self.scratchDb
    9697        except: return ret
    9798           
    98         self.dvoDetections = DvoDetections(self.logger, self.config, self.scratchDb.dbName)
     99        self.dvoDetections = DvoDetections(self.logger, self.config, self.skychunk, self.scratchDb.dbName)
    99100
    100101        return ret
    101102
    102103    '''
    103     Overrides base_class version so we can break out of processing loops if the config changes
     104    Overrides base_class version so we can break out of processing loops if the skychunk changes
    104105    '''
    105106    def checkClientStatus(self):
    106107
    107         oldConfigName = self.config.name
     108        oldSkychunkName = self.skychunk.name
    108109        super(Loader, self).checkClientStatus()
    109         if oldConfigName != self.config.name:
    110             self.logger.infoPair("Config changed",  "from '" + oldConfigName + "' to '" + self.config.name + "'")
    111             self.config.printAll()
     110        if oldSkychunkName != self.skychunk.name:
     111            self.logger.infoPair("Skychunk changed",  "from '" + oldSkychunkName + "' to '" + self.skychunk.name + "'")
     112            self.skychunk.printAll()
    112113            return False
    113114
     
    125126
    126127            abort = False
    127             for batchType in self.config.batchTypes:
     128            for batchType in self.skychunk.batchTypes:
    128129
    129130                # get a stripe's worth of box IDs
     
    161162                    self.logger.infoPair("Box dimensions", "%.1f / %.1f / %.1f" % (boxDim['RA'], boxDim['DEC'], boxDim['SIDE']))
    162163                    self.logger.infoPair(batchType + " items found in this box", "%d" % len(ids))
    163                     boxSizeWithBorder = boxDim['SIDE'] + (self.config.BORDER * 2)
     164                    boxSizeWithBorder = boxDim['SIDE'] + (self.skychunk.BORDER * 2)
    164165                    boxSizeSansBorder = boxDim['SIDE']
    165166                    self.logger.infoPair("got here", "ok")
     
    179180
    180181                            # should do we pre-ingest stuff from DVO?
    181                             # NOTE EAM : this chunk loads the dvo detections into the mysql db
     182                            # NOTE EAM : this skychunk loads the dvo detections into the mysql db
    182183                            # XXXX EAM : this should happen for both P2 and Stack detection
    183184                            # XXXX EAM : in parallel model, this should happen for all P2 & Stack batches
     
    250251                    batch = DetectionBatch(self.logger,
    251252                            self.config,
     253                            self.skychunk,
    252254                            self.gpc1Db,
    253255                            self.ippToPspsDb,
     
    259261                    batch = StackBatch(self.logger,
    260262                            self.config,
     263                            self.skychunk,
    261264                            self.gpc1Db,
    262265                            self.ippToPspsDb,
     
    269272                    batch = ObjectBatch(self.logger,
    270273                            self.config,
     274                            self.skychunk,
    271275                            self.gpc1Db,
    272276                            self.ippToPspsDb,
Note: See TracChangeset for help on using the changeset viewer.