Changeset 31346
- Timestamp:
- Apr 22, 2011, 1:16:24 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/detectionbatch.py (modified) (28 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/detectionbatch.py
r31325 r31346 5 5 from java.sql import * 6 6 from batch import Batch 7 from gpc1db import Gpc1Db 7 8 8 9 import logging.config … … 16 17 Constructor 17 18 ''' 18 def __init__(self, logger, expID, inputFile):19 def __init__(self, logger, camID, inputFile, test=False): 19 20 super(DetectionBatch, self).__init__( 20 21 logger, 21 22 "detection", 22 23 inputFile, 23 "3PI") # TODO 24 "MD04") # TODO 25 #"3PI") # TODO 24 26 25 27 self.logger.info("DetectionBatch constructor. Creating batch from: '" + inputFile + "'") 26 28 27 self.expID = expID 29 meta = self.gpc1Db.getCameraStageMeta(camID) 30 31 self.expID = meta[0]; 32 self.expName = meta[1]; 33 self.distGroup = meta[2]; 34 35 self.logger.info("Processing exposure with ID: %d, name: %s and distribution group: %s" % (self.expID, self.expName, self.distGroup)) 36 28 37 # create an output filename, which is {expID}.FITS 29 self.outputFitsFile = "%08d.FITS" % expID38 self.outputFitsFile = "%08d.FITS" % self.expID 30 39 self.outputFitsPath = "%s/%s" % (self.localOutPath, self.outputFitsFile) 31 40 41 # if test mode 42 if test: 43 self.startX = 3 44 self.endX = 4 45 self.startY = 3 46 self.endY = 4 47 else: 48 self.startX = 0 49 self.endX = 8 50 self.startY = 0 51 self.endY = 8 52 53 self.obsTime = float(self.header['MJD-OBS']) + (float(self.header['EXPTIME']) / 172800.0) 54 55 # set up some defauts 56 self.calibModNum = 0 57 self.dataRelease = 0 58 59 self.totalNumPhotoRef = 0 32 60 33 61 ''' … … 35 63 ''' 36 64 def populateFrameMeta(self): 37 self.log ("Procesing FrameMeta table")65 self.logger.info("Procesing FrameMeta table") 38 66 39 67 sql = "INSERT INTO FrameMeta (\ 40 frameID \ 68 frameID \ 69 ,frameName \ 70 ,cameraID \ 71 ,cameraConfigID \ 72 ,telescopeID \ 73 ,analysisVer \ 74 ,p1Recip \ 75 ,p2Recip \ 76 ,p3Recip \ 41 77 ,photoScat \ 42 78 ,expStart \ … … 74 110 ) VALUES ( \ 75 111 " + str(self.expID) + " \ 112 ,'" + self.expName + "' \ 113 ,1 \ 114 ,1 \ 115 ,1 \ 116 ,' ' \ 117 ,' ' \ 118 ,' ' \ 119 ,' ' \ 76 120 ," + self.header['ZPT_ERR'] + " \ 77 121 ," + self.header['MJD-OBS'] + " \ … … 108 152 ," + self.header['PCA2X0Y2'] + " \ 109 153 )" 110 self.localStmt.execute(sql) 111 112 self.updateSurveyID("FrameMeta") 113 self.updateFilterID("FrameMeta") 154 self.scratchDb.stmt.execute(sql) 155 156 self.scratchDb.updateAllRows("FrameMeta", "surveyID", str(self.surveyID)) 157 self.scratchDb.updateFilterID("FrameMeta", self.filter) 158 self.scratchDb.updateAllRows("FrameMeta", "calibModNum", str(self.calibModNum)) 159 self.scratchDb.updateAllRows("FrameMeta", "dataRelease", str(self.dataRelease)) 114 160 115 161 ''' … … 119 165 120 166 tableName = "ImageMeta_" + ota 121 self.log (" Dealing with table " + tableName)167 self.logger.info(" Dealing with table " + tableName) 122 168 123 169 # drop then re-create table 124 self. dropTable(tableName)170 self.scratchDb.dropTable(tableName) 125 171 sql = "CREATE TABLE " + tableName + " LIKE ImageMeta" 126 try: self. localStmt.execute(sql)172 try: self.scratchDb.stmt.execute(sql) 127 173 except: pass 128 174 … … 130 176 sql = "INSERT INTO " + tableName + " ( \ 131 177 frameID \ 178 ,ccdID \ 132 179 ,sky \ 133 180 ,skyScat \ … … 135 182 ,completMag \ 136 183 ,astroScat \ 184 ,photoScat \ 137 185 ,numAstroRef \ 138 186 ,numPhotoRef \ 139 187 ,nx \ 140 188 ,ny \ 189 ,psfFwhm \ 141 190 ,psfWidMajor \ 142 191 ,psfWidMinor \ 143 192 ,psfTheta \ 193 ,momentFwhm \ 144 194 ,momentWidMajor \ 145 195 ,momentWidMinor \ … … 147 197 ,dapResid \ 148 198 ,detectorID \ 199 ,qaFlags \ 149 200 ,detrend1 \ 150 201 ,detrend2 \ 151 202 ,detrend3 \ 203 ,detrend4 \ 204 ,detrend5 \ 205 ,detrend6 \ 206 ,detrend7 \ 207 ,detrend8 \ 208 ,photoZero \ 152 209 ,ctype1 \ 153 210 ,ctype2 \ … … 179 236 ) VALUES ( \ 180 237 " + str(self.expID) + " \ 181 ," + header['MSKY_MN'] + " \ 182 ," + header['MSKY_SIG'] + " \ 183 ," + header['FSATUR'] + " \ 184 ," + header['FLIMIT'] + " \ 185 ," + header['CERROR'] + " \ 186 ," + header['NASTRO'] + " \ 187 ," + header['NASTRO'] + " \ 188 ," + header['CNAXIS1'] + " \ 189 ," + header['CNAXIS2'] + " \ 190 ," + header['FWHM_MAJ'] + " \ 191 ," + header['FWHM_MIN'] + " \ 192 ," + header['ANGLE'] + " \ 193 ," + header['IQ_FW1'] + " \ 194 ," + header['IQ_FW2'] + " \ 195 ," + header['APMIFIT'] + " \ 196 ," + header['DAPMIFIT'] + " \ 197 ,'" + header['DETECTOR'] + "' \ 198 ,'" + header['DETREND.MASK'] + "' \ 199 ,'" + header['DETREND.DARK'] + "' \ 200 ,'" + header['DETREND.FLAT'] + "' \ 201 ,'" + header['CTYPE1'] + "' \ 202 ,'" + header['CTYPE2'] + "' \ 203 ," + header['CRVAL1'] + " \ 204 ," + header['CRVAL2'] + " \ 205 ," + header['CRPIX1'] + " \ 206 ," + header['CRPIX2'] + " \ 207 ," + header['CDELT1'] + " \ 208 ," + header['CDELT2'] + " \ 209 ," + header['PC001001'] + " \ 210 ," + header['PC001002'] + " \ 211 ," + header['PC002001'] + " \ 212 ," + header['PC002002'] + " \ 213 ," + header['NPLYTERM'] + " \ 214 ," + header['PCA1X3Y0'] + " \ 215 ," + header['PCA1X2Y1'] + " \ 216 ," + header['PCA1X1Y2'] + " \ 217 ," + header['PCA1X0Y3'] + " \ 218 ," + header['PCA1X2Y0'] + " \ 219 ," + header['PCA1X1Y1'] + " \ 220 ," + header['PCA1X0Y2'] + " \ 221 ," + header['PCA2X3Y0'] + " \ 222 ," + header['PCA2X2Y1'] + " \ 223 ," + header['PCA2X1Y2'] + " \ 224 ," + header['PCA2X0Y3'] + " \ 225 ," + header['PCA2X2Y0'] + " \ 226 ," + header['PCA2X1Y1'] + " \ 227 ," + header['PCA2X0Y2'] + " \ 238 ," + ota[2:4] + " \ 239 ," + self.safeDictionaryAccess(header, 'MSKY_MN') + " \ 240 ," + self.safeDictionaryAccess(header, 'MSKY_SIG') + " \ 241 ," + self.safeDictionaryAccess(header, 'FSATUR') + " \ 242 ," + self.safeDictionaryAccess(header, 'FLIMIT') + " \ 243 ," + self.safeDictionaryAccess(header, 'CERROR') + " \ 244 ," + self.safeDictionaryAccess(self.header, 'ZPT_OBS') + " \ 245 ," + self.safeDictionaryAccess(header, 'NASTRO') + " \ 246 ," + self.safeDictionaryAccess(header, 'NASTRO') + " \ 247 ," + self.safeDictionaryAccess(header, 'CNAXIS1') + " \ 248 ," + self.safeDictionaryAccess(header, 'CNAXIS2') + " \ 249 ," + str((float(self.safeDictionaryAccess(header, 'FWHM_MAJ')) + float(self.safeDictionaryAccess(header, 'FWHM_MIN')))/2.0) + " \ 250 ," + self.safeDictionaryAccess(header, 'FWHM_MAJ') + " \ 251 ," + self.safeDictionaryAccess(header, 'FWHM_MIN') + " \ 252 ," + self.safeDictionaryAccess(header, 'ANGLE') + " \ 253 ," + str((float(self.safeDictionaryAccess(header, 'IQ_FW1')) + float(self.safeDictionaryAccess(header, 'IQ_FW2')))/2.0) + " \ 254 ," + self.safeDictionaryAccess(header, 'IQ_FW1') + " \ 255 ," + self.safeDictionaryAccess(header, 'IQ_FW2') + " \ 256 ," + self.safeDictionaryAccess(header, 'APMIFIT') + " \ 257 ," + self.safeDictionaryAccess(header, 'DAPMIFIT') + " \ 258 ,'" + self.safeDictionaryAccess(header, 'DETECTOR') + "' \ 259 ," + str(self.scratchDb.getDvoImageFlags(header['SOURCEID'], header['IMAGEID'])) + " \ 260 ,'" + self.safeDictionaryAccess(header, 'DETREND.MASK') + "' \ 261 ,'" + self.safeDictionaryAccess(header, 'DETREND.DARK') + "' \ 262 ,'" + self.safeDictionaryAccess(header, 'DETREND.FLAT') + "' \ 263 ,' ' \ 264 ,' ' \ 265 ,' ' \ 266 ,' ' \ 267 ,' ' \ 268 ," + self.safeDictionaryAccess(self.header, 'ZPT_OBS') + " \ 269 ,'" + self.safeDictionaryAccess(header, 'CTYPE1') + "' \ 270 ,'" + self.safeDictionaryAccess(header, 'CTYPE2') + "' \ 271 ," + self.safeDictionaryAccess(header, 'CRVAL1') + " \ 272 ," + self.safeDictionaryAccess(header, 'CRVAL2') + " \ 273 ," + self.safeDictionaryAccess(header, 'CRPIX1') + " \ 274 ," + self.safeDictionaryAccess(header, 'CRPIX2') + " \ 275 ," + self.safeDictionaryAccess(header, 'CDELT1') + " \ 276 ," + self.safeDictionaryAccess(header, 'CDELT2') + " \ 277 ," + self.safeDictionaryAccess(header, 'PC001001') + " \ 278 ," + self.safeDictionaryAccess(header, 'PC001002') + " \ 279 ," + self.safeDictionaryAccess(header, 'PC002001') + " \ 280 ," + self.safeDictionaryAccess(header, 'PC002002') + " \ 281 ," + self.safeDictionaryAccess(header, 'NPLYTERM') + " \ 282 ," + self.safeDictionaryAccess(header, 'PCA1X3Y0') + " \ 283 ," + self.safeDictionaryAccess(header, 'PCA1X2Y1') + " \ 284 ," + self.safeDictionaryAccess(header, 'PCA1X1Y2') + " \ 285 ," + self.safeDictionaryAccess(header, 'PCA1X0Y3') + " \ 286 ," + self.safeDictionaryAccess(header, 'PCA1X2Y0') + " \ 287 ," + self.safeDictionaryAccess(header, 'PCA1X1Y1') + " \ 288 ," + self.safeDictionaryAccess(header, 'PCA1X0Y2') + " \ 289 ," + self.safeDictionaryAccess(header, 'PCA2X3Y0') + " \ 290 ," + self.safeDictionaryAccess(header, 'PCA2X2Y1') + " \ 291 ," + self.safeDictionaryAccess(header, 'PCA2X1Y2') + " \ 292 ," + self.safeDictionaryAccess(header, 'PCA2X0Y3') + " \ 293 ," + self.safeDictionaryAccess(header, 'PCA2X2Y0') + " \ 294 ," + self.safeDictionaryAccess(header, 'PCA2X1Y1') + " \ 295 ," + self.safeDictionaryAccess(header, 'PCA2X0Y2') + " \ 228 296 )" 229 self.localStmt.execute(sql) 230 self.updateFilterID(tableName) 297 298 self.scratchDb.stmt.execute(sql) 299 self.scratchDb.updateFilterID(tableName, self.filter) 300 self.scratchDb.updateAllRows(tableName, "calibModNum", str(self.calibModNum)) 301 self.scratchDb.updateAllRows(tableName, "dataRelease", str(self.dataRelease)) 302 self.totalNumPhotoRef = self.totalNumPhotoRef + int(header['NASTRO']) 231 303 232 304 ''' … … 236 308 237 309 tableName = "Detection_" + ota 238 self.log (" Dealing with table " + tableName)310 self.logger.info(" Dealing with table " + tableName) 239 311 240 312 # drop then re-create table 241 self. dropTable(tableName)313 self.scratchDb.dropTable(tableName) 242 314 sql = "CREATE TABLE " + tableName + " LIKE Detection" 243 try: self. localStmt.execute(sql)315 try: self.scratchDb.stmt.execute(sql) 244 316 except: pass 245 317 … … 251 323 ,xPosErr \ 252 324 ,yPosErr \ 325 ,instFlux \ 326 ,instFluxErr \ 327 ,peakADU \ 253 328 ,psfWidMajor \ 254 329 ,psfWidMinor \ … … 258 333 ,momentXY \ 259 334 ,momentYY \ 335 ,apMag \ 336 ,infoFlag \ 260 337 ,sky \ 261 338 ,skyErr \ … … 268 345 ,X_PSF_SIG \ 269 346 ,Y_PSF_SIG \ 347 ,POW(10.0, (-0.4*PSF_INST_MAG)) / "+self.header['EXPTIME']+" \ 348 ,ABS((PSF_INST_MAG_SIG*(POW(10.0, (-0.4*PSF_INST_MAG)) / "+self.header['EXPTIME']+")) / 1.085736) \ 349 ,POW(10.0, (-0.4*PEAK_FLUX_AS_MAG)) / "+self.header['EXPTIME']+" \ 270 350 ,PSF_MAJOR \ 271 351 ,PSF_MINOR \ … … 275 355 ,MOMENTS_XY \ 276 356 ,MOMENTS_YY \ 357 ,AP_MAG \ 358 ,FLAGS\ 277 359 ,SKY \ 278 360 ,SKY_SIGMA \ … … 280 362 FROM " + ota + "_psf" 281 363 282 self.localStmt.execute(sql) 283 284 self.updateSurveyID(tableName) 285 self.updateFilterID(tableName) 286 287 # now add DVO IDs 288 self.updateDvoIDs(tableName) 364 self.scratchDb.stmt.execute(sql) 365 366 # set obsTime 367 sql = "UPDATE " + tableName + " SET obsTime = %f, assocDate = '%s', activeFlag = 0" % (self.obsTime, self.dateStr) 368 self.scratchDb.stmt.execute(sql) 369 self.scratchDb.updateAllRows(tableName, "dataRelease", str(self.dataRelease)) 370 self.scratchDb.updateAllRows(tableName, "historyModNum", "0") 371 372 self.scratchDb.updateAllRows(tableName, "surveyID", str(self.surveyID)) 373 self.scratchDb.updateFilterID(tableName, self.filter) 374 375 # now delete bad flux 376 self.scratchDb.reportAndDeleteRowsWithNULLS(tableName, "instFlux") 377 self.scratchDb.reportAndDeleteRowsWithNULLS(tableName, "peakADU") 289 378 290 379 ''' … … 294 383 295 384 tableName = "SkinnyObject_" + ota 296 self.log (" Dealing with table " + tableName)385 self.logger.info(" Dealing with table " + tableName) 297 386 298 387 # drop then re-create table 299 self. dropTable(tableName)388 self.scratchDb.dropTable(tableName) 300 389 sql = "CREATE TABLE " + tableName + " LIKE SkinnyObject" 301 try: self. localStmt.execute(sql)390 try: self.scratchDb.stmt.execute(sql) 302 391 except: pass 303 392 … … 313 402 ,surveyID \ 314 403 FROM Detection_" + ota 315 self.localStmt.execute(sql) 404 self.scratchDb.stmt.execute(sql) 405 406 self.scratchDb.updateAllRows(tableName, "dataRelease", str(self.dataRelease)) 316 407 317 408 ''' … … 321 412 322 413 tableName = "ObjectCalColor_" + ota 323 self.log (" Dealing with table " + tableName)414 self.logger.info(" Dealing with table " + tableName) 324 415 325 416 # drop then re-create table 326 self. dropTable(tableName)417 self.scratchDb.dropTable(tableName) 327 418 sql = "CREATE TABLE " + tableName + " LIKE ObjectCalColor" 328 try: self. localStmt.execute(sql)419 try: self.scratchDb.stmt.execute(sql) 329 420 except: pass 330 421 … … 340 431 ,filterID \ 341 432 FROM Detection_" + ota 342 self.localStmt.execute(sql) 343 344 345 ''' 346 Applies indexes to the PSPS tables 433 self.scratchDb.stmt.execute(sql) 434 435 self.scratchDb.updateAllRows(tableName, "calibModNum", str(self.calibModNum)) 436 self.scratchDb.updateAllRows(tableName, "dataRelease", str(self.dataRelease)) 437 438 439 ''' 440 Applies indexes to the PSPS tables TODO need this? 347 441 ''' 348 442 def indexPspsTables(self): 349 443 350 self.log ("Creating indexes on PSPS tables")444 self.logger.info("Creating indexes on PSPS tables") 351 445 # self.createIndex("StackDetection", "ippDetectID") 352 446 # self.createIndex("StackApFlx", "ippDetectID") … … 358 452 def indexIppTables(self): 359 453 360 self.log ("Creating indexes on IPP tables")361 362 for x in range( 0,8):363 for y in range( 0,8):454 self.logger.info("Creating indexes on IPP tables") 455 456 for x in range(self.startX, self.endX): 457 for y in range(self.startY, self.endY): 364 458 365 459 # dodge the corners … … 370 464 371 465 extension = "XY%d%d_psf" % (x, y) 372 self.createIndex(extension, "IPP_IDET") 373 374 ''' 375 Overriden from Batch class 466 self.scratchDb.createIndex(extension, "IPP_IDET") 467 468 ''' 376 469 Updates provided table with DVO IDs from DVO table 377 470 ''' 378 def updateDvoIDs(self, table ):471 def updateDvoIDs(self, table, sourceID, imageID): 379 472 380 473 self.logger.info("Updating table '" + table + "' with DVO IDs...") … … 382 475 a.ippObjID = b.ippObjID, \ 383 476 a.detectID = b.detectID, \ 384 a.objID = b.objID \ 385 WHERE a.ippDetectID = b.ippDetectID" 386 self.localStmt.execute(sql) 477 a.objID = b.objID, \ 478 a.infoFlag = b.flags << 32 | a.infoFlag \ 479 WHERE a.ippDetectID = b.ippDetectID \ 480 AND b.sourceID = " + str(sourceID) + " \ 481 AND b.imageID = " + str(imageID) 482 483 self.scratchDb.stmt.execute(sql) 387 484 self.logger.info("...done") 388 485 … … 392 489 ''' 393 490 def populatePspsTables(self): 394 395 491 396 492 # get filterID using init table … … 398 494 399 495 self.populateFrameMeta() 400 401 for x in range(3, 4): 402 for y in range(3, 4): 496 497 # dictionary objects to hold sourceIDs and imageIDs for later 498 sourceIDs = {} 499 imageIDs = {} 500 501 file = open(self.inputFitsPath, 'r') 502 503 # loop through all OTAs and populate ImageMeta extensions 504 for x in range(self.startX, self.endX): 505 for y in range(self.startY, self.endY): 403 506 404 507 # dodge the corners … … 411 514 412 515 # load corresponding header into memory 413 header = self.findAndReadFITSHeader(ota + ".hdr") 414 self.getIDsFromDVO(header['SOURCEID'], header['IMAGEID']) 415 516 header = self.findAndReadFITSHeader(ota + ".hdr", file) 517 518 # store sourceID/imageID combo in Db so DVO can look up later 519 self.scratchDb.insertNewDvoImage(header['SOURCEID'], header['IMAGEID']) 520 521 # store these for later 522 sourceIDs[ota] = header['SOURCEID'] 523 imageIDs[ota] = header['IMAGEID'] 524 525 # populate ImageMeta 416 526 self.populateImageMetaTable(ota, header) 527 self.updateImageID("ImageMeta_" + ota, x, y) 528 529 # now run DVO code to get all IDs 530 self.getIDsFromDVO() 531 532 # loop through all OTAs again to update with DVO IDs 533 self.tablesToExport = [] 534 self.tablesToExport.append("FrameMeta") 535 tables = [] 536 otaCount = 0 537 for x in range(self.startX, self.endX): 538 for y in range(self.startY, self.endY): 539 540 # dodge the corners 541 if x==0 and y==0: continue 542 if x==0 and y==7: continue 543 if x==7 and y==0: continue 544 if x==7 and y==7: continue 545 546 ota = "XY%d%d" % (x, y) 547 548 # populate remainder of tables 417 549 self.populateDetectionTable(ota) 550 551 # now add DVO IDs 552 self.updateDvoIDs("Detection_" + ota, sourceIDs[ota], imageIDs[ota]) 553 554 # check we have something in this Detection table 555 if self.scratchDb.getRowCount("Detection_" + ota) < 1: 556 self.logger.info("Empty tables for ota " + ota + ". Skipping.") 557 continue; 558 559 self.scratchDb.reportAndDeleteRowsWithNULLS("Detection_" + ota, "objID") 560 self.updateImageID("Detection_" + ota, x, y) 561 562 # update ImageMeta with count of detections for this OTA and photoCodeID 563 sql = "UPDATE ImageMeta_" + ota + " SET nDetect = %d, photoCalID = %d" % (self.scratchDb.getRowCount("Detection_" + ota), self.scratchDb.getPhotoCalID(header['SOURCEID'], header['IMAGEID'])) 564 self.scratchDb.stmt.execute(sql) 565 418 566 self.populateSkinnyObjectTable(ota) 419 567 self.populateObjectCalColorTable(ota) 420 568 421 422 #self.setMinMaxObjID(tableName) # TODO set based on all tables 569 # add these to list of tables to export later 570 self.tablesToExport.append("ImageMeta_" + ota) 571 self.tablesToExport.append("Detection_" + ota) 572 self.tablesToExport.append("SkinnyObject_" + ota) 573 self.tablesToExport.append("ObjectCalColor_" + ota) 574 tables.append("Detection_" + ota) 575 576 otaCount = otaCount + 1 577 578 self.setMinMaxObjID(tables) 579 580 # update FrameMeta with count OTAs in this file and total number of photometric reference sources 581 sql = "UPDATE FrameMeta SET nOTA = %d, numPhotoRef = %d" % (otaCount, self.totalNumPhotoRef) 582 self.scratchDb.stmt.execute(sql) 583 584 return True 585 586 ''' 587 Updates imageID {EXP_ID}{OTA} in the provided table 588 ''' 589 def updateImageID(self, tableName, x, y): 590 591 sql = "UPDATE " + tableName + " SET imageID = %d%d%d" % (self.expID, x, y) 592 self.scratchDb.stmt.execute(sql) 593 423 594 424 595 … … 430 601 # loops round all imported tables, but we want to check one OTA's worth 431 602 for table in self.pspsTables: 432 if table.name == "FrameMeta": self. reportNulls(table.name, showPartials)433 else: self. reportNulls(table.name + "_XY33", showPartials)603 if table.name == "FrameMeta": self.scratchDb.reportNulls(table.name, showPartials) 604 else: self.scratchDb.reportNulls(table.name + "_XY33", showPartials) 434 605 435 606 … … 438 609 logger.info("Starting") 439 610 440 expID = 230033; 441 inputFile = "detdemo.fits" 442 detectionBatch = DetectionBatch(logger, expID, inputFile) 443 detectionBatch.createEmptyPspsTables() 444 detectionBatch.importIppTables("XY33\.psf") 445 detectionBatch.populatePspsTables() 446 detectionBatch.exportPspsTablesToFits() 447 detectionBatch.writeBatchManifest() 448 detectionBatch.reportNullsInAllPspsTables(False) 449 450 611 gpc1Db = Gpc1Db(logger) 612 camIDs = gpc1Db.getIDsInThisDVODbForThisStage("MD04.V2", "cam") 613 #camIDs = gpc1Db.getIDsInThisDVODbForThisStage("ThreePi.V1", "cam") 614 615 logger.info("Found %d exposures" % len(camIDs)) 616 617 i = 0 618 for camID in camIDs: 619 620 file = gpc1Db.getCameraStageSmf(camID) 621 #file = "detdemo.fits" 622 detectionBatch = DetectionBatch(logger, camID, file, True) 623 detectionBatch.createEmptyPspsTables() 624 detectionBatch.importIppTables("XY33\.psf") 625 if detectionBatch.populatePspsTables(): 626 detectionBatch.exportPspsTablesToFits() 627 detectionBatch.writeBatchManifest() 628 detectionBatch.reportNullsInAllPspsTables(False) 629 630 i = i+1 631 if i > 0: break 632
Note:
See TracChangeset
for help on using the changeset viewer.
