- Timestamp:
- Jan 31, 2013, 4:13:09 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121219/ippToPsps/jython/batch.py
r35056 r35076 30 30 logger, 31 31 config, 32 skychunk, 32 33 gpc1Db, 33 34 ippToPspsDb, … … 46 47 self.readHeader = False 47 48 self.config = config 49 self.skychunk = skychunk 48 50 self.fits = fits 49 51 self.useFullTables = useFullTables … … 55 57 56 58 # self.testprint() 57 58 self.configDir = os.getenv("IPPTOPSPS_DATA")59 if self.configDir is not None:60 self.configDir = self.configDir + "/"61 59 62 60 # set up class variables … … 67 65 self.scratchDb = scratchDb 68 66 self.batchType = batchType; 69 self.pspsVoTableFilePath = self.config Dir + "tables." + batchType + ".vot"67 self.pspsVoTableFilePath = self.config.configDir + "tables." + batchType + ".vot" 70 68 71 69 # self.testprint() … … 85 83 self.tablesToExport = [] 86 84 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) 89 87 else: 90 88 self.surveyID = -1; 91 89 92 90 # create datastore object 93 self.datastore = Datastore(self.logger, self. config, self.ippToPspsDb)94 95 # get local storage location from config91 self.datastore = Datastore(self.logger, self.skychunk, self.ippToPspsDb) 92 93 # get local storage location from skychunk 96 94 self.batchName = Batch.getNameFromID(self.batchID) 97 95 self.subDir = Batch.getSubDir( 98 self. config.basePath,96 self.skychunk.basePath, 99 97 self.batchType, 100 self. config.dvoLabel)98 self.skychunk.dvoLabel) 101 99 102 100 self.localOutPath = Batch.getOutputPath( 103 self. config.basePath,101 self.skychunk.basePath, 104 102 self.batchType, 105 self. config.dvoLabel,103 self.skychunk.dvoLabel, 106 104 self.batchID) 107 105 … … 253 251 root.attrib['type'] = self.batchType 254 252 root.attrib['timestamp'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") 255 root.attrib['survey'] = self. config.pspsSurvey253 root.attrib['survey'] = self.skychunk.pspsSurvey 256 254 257 255 # min/max object IDs … … 294 292 # set up filenams and paths 295 293 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) 297 295 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) 299 297 300 298 # tar directory … … 516 514 517 515 # TODO path to DVO prog hardcoded temporarily 518 cmd = "../src/dvograbber " + self.config.settingsPath + " " + self.scratchDb.dbName + " " + self. config.dvoLocation516 cmd = "../src/dvograbber " + self.config.settingsPath + " " + self.scratchDb.dbName + " " + self.skychunk.dvoLocation 519 517 self.logger.infoPair("Running DVO", cmd) 520 518 p = Popen(cmd, shell=True, stdout=PIPE) … … 532 530 ''' 533 531 Creates and publishes a batch 534 TODO all method s callbelow should throw exceptions on failure532 TODO all method calls below should throw exceptions on failure 535 533 ''' 536 534 def run(self): … … 561 559 562 560 if self.writeBatchManifest(): 563 if self. config.datastorePublishing:561 if self.skychunk.datastorePublishing: 564 562 565 563 # tar and zip ready for publication to datastore
Note:
See TracChangeset
for help on using the changeset viewer.
