Changeset 31285 for trunk/ippToPsps
- Timestamp:
- Apr 14, 2011, 3:16:26 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/detectionbatch.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/detectionbatch.py
r31116 r31285 6 6 from batch import Batch 7 7 8 import logging.config 9 10 ''' 11 DetectionBatch class 12 ''' 8 13 class DetectionBatch(Batch): 9 14 … … 11 16 Constructor 12 17 ''' 13 def __init__(self ):18 def __init__(self, logger, expID, inputFile): 14 19 super(DetectionBatch, self).__init__( 20 logger, 15 21 "detection", 16 "detdemo.fits", 17 "detection.fits", 18 "localhost", 19 "ipptopsps_scratch", 20 "ipp", 21 "ipp", 22 "3PI") # TODO 22 inputFile, 23 "ThreePi") # TODO 23 24 25 self.logger.info("DetectionBatch constructor. Creating batch from: '" + inputFile + "'") 24 26 27 # create an output filename, which is {expID}.FITS 28 self.outputFitsFile = "%08d.FITS" % expID 29 self.outputFitsPath = "%s/%s" % (self.localOutPath, self.outputFitsFile) 25 30 26 '''27 Updates a table with stackMetaID28 '''29 def updateStackMetaID(self, table):30 31 sql = "UPDATE " + table + " SET stackMetaID=" + self.header['STK_ID']32 self.stmt.execute(sql)33 34 '''35 Updates a table with stackTypeID grabbed from FitModel init table36 '''37 def updateStackTypeID(self, table):38 39 sql = "UPDATE "+table+" AS a, StackType AS b SET a.stackTypeID=b.stackTypeID WHERE b.name = '"+self.header['STK_TYPE']+"'"40 self.stmt.execute(sql)41 31 42 32 ''' … … 81 71 ," + self.header['PC002002'] + " \ 82 72 )" 83 self. stmt.execute(sql)73 self.localStmt.execute(sql) 84 74 85 75 self.updateSurveyID("ImageMeta") … … 106 96 FROM XY%d%d_psf" % (x, y) 107 97 108 self. stmt.execute(sql)98 self.localStmt.execute(sql) 109 99 110 100 … … 133 123 134 124 ''' 125 Updates provided table with DVO IDs from DVO table 126 ''' 127 def updateDvoIDs(self, table): 128 129 self.logger.info("Updating table '" + table + "' with DVO IDs...") 130 sql = "UPDATE " + table + " AS a, dvo AS b SET \ 131 a.ippObjID = b.ippObjID, \ 132 a.detectID = b.detectID, \ 133 a.objID = b.objID \ 134 WHERE a.ippDetectID = b.ippDetectID" 135 self.localStmt.execute(sql) 136 self.logger.info("...done") 137 138 139 ''' 135 140 Does the processing, i.e. pulling stuff from IPP tables into PSPS tables 136 141 ''' … … 140 145 self.filter = self.header['FILTERID'] 141 146 self.filter = self.filter[0:1] 142 print "filter = ", self.filter143 147 144 148 #self.populateStackMeta() … … 147 151 #self.populateStackApFlx() 148 152 149 150 detectionBatch = DetectionBatch() 153 self.getIDsFromDVO("33", "8345290") # TODO need to get sourceID and imageID from chip header 154 self.updateDvoIDs("Detection") 155 self.setMinMaxObjID("Detection") 156 157 158 159 logging.config.fileConfig("logging.conf") 160 logger = logging.getLogger("detectionbatch") 161 logger.info("Starting") 162 163 expID = 230033; 164 inputFile = "detdemo.fits" 165 detectionBatch = DetectionBatch(logger, expID, inputFile) 151 166 detectionBatch.createEmptyPspsTables() 152 167 detectionBatch.importIppTables("XY33\.psf") 153 168 detectionBatch.populatePspsTables() 154 169 detectionBatch.exportPspsTablesToFits() 170 detectionBatch.exportPspsTablesToFits() 171 detectionBatch.writeBatchManifest() 172 detectionBatch.reportNullsInAllPspsTables(False) 173 174
Note:
See TracChangeset
for help on using the changeset viewer.
