IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 31, 2013, 4:13:09 PM (14 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/batch.py

    r35056 r35076  
    3030                 logger,
    3131                 config,
     32                 skychunk,
    3233                 gpc1Db,
    3334                 ippToPspsDb,
     
    4647        self.readHeader = False
    4748        self.config = config
     49        self.skychunk = skychunk
    4850        self.fits = fits
    4951        self.useFullTables = useFullTables
     
    5557
    5658        # self.testprint()
    57 
    58         self.configDir = os.getenv("IPPTOPSPS_DATA")
    59         if self.configDir is not None:
    60             self.configDir = self.configDir + "/"
    6159
    6260        # set up class variables
     
    6765        self.scratchDb = scratchDb
    6866        self.batchType = batchType;
    69         self.pspsVoTableFilePath = self.configDir + "tables." + batchType + ".vot"
     67        self.pspsVoTableFilePath = self.config.configDir + "tables." + batchType + ".vot"
    7068
    7169        # self.testprint()
     
    8583        self.tablesToExport = []
    8684
    87         if self.config.survey != "":
    88             self.surveyID = self.scratchDb.getSurveyID(self.config.survey)
     85        if self.skychunk.survey != "":
     86            self.surveyID = self.scratchDb.getSurveyID(self.skychunk.survey)
    8987        else:
    9088            self.surveyID = -1;
    9189       
    9290        # create datastore object
    93         self.datastore = Datastore(self.logger, self.config, self.ippToPspsDb)
    94 
    95         # get local storage location from config
     91        self.datastore = Datastore(self.logger, self.skychunk, self.ippToPspsDb)
     92
     93        # get local storage location from skychunk
    9694        self.batchName = Batch.getNameFromID(self.batchID)
    9795        self.subDir = Batch.getSubDir(
    98                 self.config.basePath,
     96                self.skychunk.basePath,
    9997                self.batchType,
    100                 self.config.dvoLabel)
     98                self.skychunk.dvoLabel)
    10199
    102100        self.localOutPath = Batch.getOutputPath(
    103                 self.config.basePath,
     101                self.skychunk.basePath,
    104102                self.batchType,
    105                 self.config.dvoLabel,
     103                self.skychunk.dvoLabel,
    106104                self.batchID)
    107105
     
    253251        root.attrib['type'] = self.batchType
    254252        root.attrib['timestamp'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    255         root.attrib['survey'] = self.config.pspsSurvey
     253        root.attrib['survey'] = self.skychunk.pspsSurvey
    256254
    257255        # min/max object IDs
     
    294292        # set up filenams and paths
    295293        tarFile = Batch.getTarFile(self.batchID)
    296         tarPath = Batch.getTarPath(self.config.basePath, self.batchType, self.config.dvoLabel, self.batchID)
     294        tarPath = Batch.getTarPath(self.skychunk.basePath, self.batchType, self.skychunk.dvoLabel, self.batchID)
    297295        tarballFile = Batch.getTarballFile(self.batchID)
    298         tarballPath = Batch.getTarballPath(self.config.basePath, self.batchType, self.config.dvoLabel, self.batchID)
     296        tarballPath = Batch.getTarballPath(self.skychunk.basePath, self.batchType, self.skychunk.dvoLabel, self.batchID)
    299297
    300298        # tar directory
     
    516514
    517515        # TODO path to DVO prog hardcoded temporarily
    518         cmd = "../src/dvograbber " + self.config.settingsPath + " " + self.scratchDb.dbName + " " + self.config.dvoLocation
     516        cmd = "../src/dvograbber " + self.config.settingsPath + " " + self.scratchDb.dbName + " " + self.skychunk.dvoLocation
    519517        self.logger.infoPair("Running DVO", cmd)
    520518        p = Popen(cmd, shell=True, stdout=PIPE)
     
    532530    '''
    533531    Creates and publishes a batch
    534     TODO all methods call below should throw exceptions on failure
     532    TODO all method calls below should throw exceptions on failure
    535533    '''
    536534    def run(self):
     
    561559   
    562560        if self.writeBatchManifest():
    563             if self.config.datastorePublishing:
     561            if self.skychunk.datastorePublishing:
    564562
    565563                # tar and zip ready for publication to datastore
Note: See TracChangeset for help on using the changeset viewer.