IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33674


Ignore:
Timestamp:
Apr 3, 2012, 4:26:24 PM (14 years ago)
Author:
rhenders
Message:

added OB batch; removed unnecessary config args to ipptopsps Db methods

File:
1 edited

Legend:

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

    r33528 r33674  
    1313from gpc1db import Gpc1Db
    1414from datastore import Datastore
     15from dvoobjects import DvoObjects
    1516from batch import Batch
    1617
     
    3031        self.gpc1Db = Gpc1Db(self.logger, self.config)
    3132        self.datastore = Datastore(self.logger, self.config, self.ippToPspsDb)
     33        self.dvoObjects = DvoObjects(self.logger, self.config)
    3234
    3335        self.config.printAll()
     
    5052            # queue up batches that are processed but not loaded to datastore
    5153            for batchType in self.config.batchTypes:
     54
    5255                self.logger.infoTitle("Previous failed datastore loads")
    5356                self.publishAnyUnpublishedBatches(batchType)
    5457
    5558                # get totals for whole area to check if there is anything to do
    56                 processedIDs = self.ippToPspsDb.getProcessedIDs(batchType, self.config.epoch, self.config.dvoLabel)
    57                 consistantlyFailedIDs = self.ippToPspsDb.getConsistentlyFailedIDs(batchType, self.config.epoch, self.config.dvoLabel)
    58                 rows = self.gpc1Db.getItemsInThisDVODbForThisStage(
    59                         self.config.dvoLabel,
    60                         batchType,
    61                         self.config.minRa,
    62                         self.config.maxRa,
    63                         self.config.minDec,
    64                         self.config.maxDec)
     59                processedIDs = self.ippToPspsDb.getProcessedIDs(batchType)
     60                consistantlyFailedIDs = self.ippToPspsDb.getConsistentlyFailedIDs(batchType)
     61
     62                # for object batches, get full list of stuff from Dvo
     63                if batchType == "OB":
     64                    self.dvoObjects.setSkyArea(
     65                            self.config.minRa,
     66                            self.config.maxRa,
     67                            self.config.minDec,
     68                            self.config.maxDec)
     69                    rows = self.dvoObjects.allPopulatedRegionInfo
     70                    self.dvoObjects.printSummary()
     71
     72                # for other batches, info comes from gpc1 database
     73                else:
     74                    rows = self.gpc1Db.getItemsInThisDVODbForThisStage(
     75                            self.config.dvoLabel,
     76                            batchType,
     77                            self.config.minRa,
     78                            self.config.maxRa,
     79                            self.config.minDec,
     80                            self.config.maxDec)
    6581
    6682                # first report total stuff
     
    125141    def publishAnyUnpublishedBatches(self, batchType):
    126142   
    127         batchIDs = self.ippToPspsDb.getProcessedButFailedDatastoreBatchIDs(self.config.epoch, self.config.dvoLabel, batchType)
     143        batchIDs = self.ippToPspsDb.getProcessedButFailedDatastoreBatchIDs(batchType)
    128144        self.logger.infoPair("%s batches" % batchType, "%d" % len(batchIDs))
    129145   
Note: See TracChangeset for help on using the changeset viewer.