Changeset 32033 for trunk/ippToPsps/jython/batch.py
- Timestamp:
- Aug 4, 2011, 11:51:03 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/batch.py (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/batch.py
r32021 r32033 49 49 self.doc = doc 50 50 self.fits = fits 51 if self.fits is not None: 52 self.header = self.fits.getPrimaryHeader() 51 if self.fits: self.header = self.fits.getPrimaryHeader() 53 52 54 53 # set up logging … … 92 91 # create a new batch 93 92 self.batchID = self.ippToPspsDb.createNewBatch( 94 self. getPspsBatchType(),93 self.batchType, 95 94 self.id, 96 95 survey, … … 100 99 # get local storage location from config 101 100 self.batchName = "B%08d" % self.batchID 102 self.subDir = self.doc.find("localOutPath").text + "/" + self. getPspsBatchType()+ "/" + dvoName101 self.subDir = self.doc.find("localOutPath").text + "/" + self.batchType + "/" + dvoName 103 102 self.localOutPath = self.subDir + "/" + self.batchName 104 103 if not os.path.exists(self.localOutPath): os.makedirs(self.localOutPath) … … 111 110 if not self.useFullTables: self.scratchDb.createDvoTables() 112 111 113 self.everythingOK = True 114 115 ''' 116 Destructor 117 ''' 118 def __del__(self): 119 120 self.logger.debug("Batch destructor") 121 122 ''' 123 Prints metadata to the log 124 ''' 125 def printMe(self): 126 112 # dump stuff to the log 113 self.logger.infoTitle("New " + self.batchType + " batch") 127 114 self.logger.infoPair("Batch name", self.batchName) 128 115 self.logger.infoPair("Survey", self.survey) … … 130 117 self.logger.infoPair("DVO location", self.dvoLocation) 131 118 self.logger.infoPair("Use full DVO tables?", "%d" % self.useFullTables) 119 120 if self.fits: 121 self.logger.infoPair("Input FITS file", self.fits.getOriginalPath()) 122 self.logger.infoPair("Input FITS primary header", "%s cards found" % self.fits.getPrimaryHeaderCardCount()) 123 132 124 self.logger.infoPair("Output path", self.localOutPath) 125 126 self.everythingOK = True 127 128 ''' 129 Destructor 130 ''' 131 def __del__(self): 132 133 self.logger.debug("Batch destructor") 133 134 134 135 ''' … … 169 170 # batch information 170 171 root.attrib['name'] = self.batchName 171 root.attrib['type'] = self. getPspsBatchType()172 root.attrib['type'] = self.batchType 172 173 root.attrib['timestamp'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") 173 174 if self.survey != "": … … 253 254 self.logger.error("Don't know this survey: '" + self.survey + "'") 254 255 return "NA" 255 256 '''257 Gets PSPS friendly batch type TODO only use PSPS batch names, P2, ST etc258 '''259 def getPspsBatchType(self):260 261 if self.batchType == "init": return "IN"262 elif self.batchType == "detection": return "P2"263 elif self.batchType == "stack": return "ST"264 else: self.logger.error("Don't know this batch type: " + self.survey)265 256 266 257 ''' … … 465 456 return 466 457 467 self.printMe()468 458 self.createEmptyPspsTables() 469 459 self.importIppTables() … … 475 465 476 466 self.logger.infoPair("Batch......", "complete") 477 self.logger.infoSeparator() 478 479 467 468
Note:
See TracChangeset
for help on using the changeset viewer.
