Changeset 32033
- Timestamp:
- Aug 4, 2011, 11:51:03 AM (15 years ago)
- Location:
- trunk/ippToPsps/jython
- Files:
-
- 4 edited
-
batch.py (modified) (9 diffs)
-
detectionbatch.py (modified) (2 diffs)
-
initbatch.py (modified) (1 diff)
-
stackbatch.py (modified) (2 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 -
trunk/ippToPsps/jython/detectionbatch.py
r32000 r32033 43 43 ippToPspsDb, 44 44 camID, 45 " detection",45 "P2", 46 46 gpc1Db.getCameraStageSmf(camID), 47 47 #"MD04") # TODO … … 107 107 self.ippToPspsDb.insertDetectionMeta(self.batchID, self.expID, self.filter) 108 108 109 ''' 110 Prints metadata to the log 111 ''' 112 def printMe(self): 113 114 super(DetectionBatch, self).printMe() 115 116 self.logger.infoPair("Cam ID", "%d" % self.id) 117 self.logger.infoPair("Exp ID", "%d" % self.expID) 118 self.logger.infoPair("Exp name", "%s" % self.expName) 119 self.logger.infoPair("Distribution group", "%s" % self.distGroup) 109 # dump stuff to log 110 self.logger.infoPair("Cam ID", "%d" % self.id) 111 self.logger.infoPair("Exp ID", "%d" % self.expID) 112 self.logger.infoPair("Exp name", "%s" % self.expName) 113 self.logger.infoPair("Distribution group", "%s" % self.distGroup) 120 114 121 115 ''' -
trunk/ippToPsps/jython/initbatch.py
r32005 r32033 37 37 ippToPspsDb, 38 38 0, 39 " init",39 "IN", 40 40 None) 41 41 -
trunk/ippToPsps/jython/stackbatch.py
r32000 r32033 40 40 ippToPspsDb, 41 41 stackID, 42 " stack",42 "ST", 43 43 gpc1Db.getStackStageCmf(stackID), 44 44 "3PI") # TODO … … 92 92 self.scratchDb.insertNewDvoExternID(self.header['SOURCEID'], self.header['IMAGEID']) 93 93 94 ''' 95 Prints metadata to the log 96 ''' 97 def printMe(self): 98 99 super(StackBatch, self).printMe() 100 94 95 # dump stuff to log 101 96 self.logger.infoPair("Stack ID", "%d" % self.id) 102 97 self.logger.infoPair("Stack type", "%s" % self.stackType) 103 98 self.logger.infoPair("Skycell", "%s" % self.skycell) 104 99 self.logger.infoPair("Filter", "%s" % self.filter) 100 105 101 106 102
Note:
See TracChangeset
for help on using the changeset viewer.
