Changeset 31298 for trunk/ippToPsps/jython/stackbatch.py
- Timestamp:
- Apr 15, 2011, 1:51:38 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/stackbatch.py (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/stackbatch.py
r31292 r31298 22 22 "stack", 23 23 inputFile, 24 " ThreePi") # TODO24 "MD04") # TODO 25 25 26 26 self.logger.info("StackBatch constructor. Creating batch from: '" + inputFile + "'") 27 27 28 # delete PSPS tables 29 self.dropTable("StackMeta") 30 self.dropTable("StackDetection") 31 self.dropTable("StackModelFit") 32 self.dropTable("StackApFlx") 33 self.dropTable("StackToImage") 34 35 # delete IPP tables 36 self.dropTable("SkyChip_psf") 37 self.dropTable("SkyChip_xsrc") 38 self.dropTable("SkyChip_xfit") 39 self.dropTable("SkyChip_xrad") 40 28 41 # obs time makes no sense except for nightly stacks 42 self.logger.info("Stack type: " + self.header['STK_TYPE']) 29 43 if self.header['STK_TYPE'] != "NIGHTLY_STACK": self.header['MJD-OBS'] = "-999" 30 44 … … 324 338 self.updateDataRelease("StackDetection") 325 339 self.updateStackTypeID("StackDetection") 340 self.updateDvoIDs("StackDetection") 326 341 327 342 ''' … … 336 351 DISTINCT IPP_IDET \ 337 352 FROM SkyChip_xrad" 338 self.localStmt.execute(sql) 353 354 try: 355 self.localStmt.execute(sql) 356 except: return 339 357 340 358 # TODO temporarily loading 1st convolved fluxes into unconvolved fields … … 364 382 self.updateDataRelease("StackApFlx") 365 383 self.updateStackTypeID("StackApFlx") 384 self.updateDvoIDs("StackApFlx") 366 385 367 386 ''' … … 373 392 # insert all the detections 374 393 sql = "INSERT INTO StackModelFit (ippDetectID) SELECT DISTINCT IPP_IDET from SkyChip_xfit" 375 self.localStmt.execute(sql) 394 try: 395 self.localStmt.execute(sql) 396 except: 397 return 398 376 399 377 400 # populate model parameters … … 388 411 self.updateDataRelease("StackModelFit") 389 412 self.updateStackTypeID("StackModelFit") 413 self.updateDvoIDs("StackModelFit") 390 414 391 415 ''' … … 420 444 421 445 ''' 446 Temporary hack to fudge some object IDs 422 447 ''' 423 448 def fudgeIDs(self): … … 450 475 self.setMinMaxObjID("StackDetection") 451 476 477 452 478 ''' 453 479 Does the processing, i.e. pulling stuff from IPP tables into PSPS tables 454 480 ''' 455 481 def populatePspsTables(self): 482 483 self.getIDsFromDVO(self.header['SOURCEID'], self.header['IMAGEID']) 456 484 457 485 self.populateStackMeta() … … 461 489 self.populateStackToImage() 462 490 491 self.setMinMaxObjID("StackDetection") 492 463 493 464 494 logging.config.fileConfig("logging.conf") 465 495 logger = logging.getLogger("stackbatch") 466 496 logger.info("Starting") 467 sky_id = 299 # TODO497 sky_id = 689 # TODO 468 498 gpc1Db = Gpc1Db(logger) 469 499 cmfFiles = gpc1Db.getStackStageCmfs(sky_id) … … 477 507 stackBatch.importIppTables("") 478 508 stackBatch.populatePspsTables() 479 stackBatch.fudgeIDs()480 509 stackBatch.reportNullsInAllPspsTables(False) 481 # stackBatch.replaceAllPspsNulls("-999")482 510 stackBatch.exportPspsTablesToFits() 483 511 stackBatch.writeBatchManifest()
Note:
See TracChangeset
for help on using the changeset viewer.
