Changeset 35008
- Timestamp:
- Jan 22, 2013, 5:07:13 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121219/ippToPsps/jython/stackbatch.py
r34902 r35008 51 51 useFullTables) 52 52 53 # self.printline = 0 54 # # self.testprint() 55 53 56 self.stackType = "DEEP_STACK" # TODO 54 57 … … 63 66 self.filterID = self.scratchDb.getFilterID(self.filter) 64 67 self.skycell = meta[1]; 68 69 # self.testprint() 65 70 66 71 # skycell is, eg "skycell.1133.081" … … 76 81 self.skycell = self.skycell[8:12] 77 82 self.projectioncell = self.skycell 83 84 # self.testprint() 78 85 79 86 # proposed new values. Need to coordinate with the SkyCell table … … 96 103 self.scratchDb.dropTable("StackDetectionCalib") 97 104 105 # self.testprint() 106 98 107 # delete IPP tables 99 108 self.scratchDb.dropTable("SkyChip_psf") … … 115 124 if not self.useFullTables: 116 125 self.scratchDb.insertNewDvoExternID(self.header['SOURCEID'], self.header['IMAGEID']) 126 127 # self.testprint() 117 128 118 129 # dump stuff to log … … 139 150 self.scratchDb.execute(sql) 140 151 152 153 def testprint(self): 154 print "here ", self.printline 155 self.printline += 1 141 156 142 157 ''' … … 348 363 self.logger.infoPair("Procesing table", "StackMeta") 349 364 365 self.fwhm_maj = self.safeDictionaryAccess(self.header, 'FWHM_MAJ') 366 self.fwhm_maj_uq = self.safeDictionaryAccess(self.header, 'FW_MJ_UQ') 367 self.psfmodel = self.safeDictionaryAccess(self.header, 'PSFMODEL') 368 if (self.fwhm_maj == "NULL"): self.fwhm_maj = -999 369 if (self.fwhm_maj_uq == "NULL"): self.fwhm_maj_uq = -999 370 371 # print "fwhm_maj = ", self.fwhm_maj 372 # print "fwhm_maj_uq = ", self.fwhm_maj_uq 373 # print "psfmodel = ", self.psfmodel 374 350 375 sql = "INSERT INTO StackMeta (\ 351 376 stackMetaID \ … … 375 400 ," + self.header['FPA.ZP'] + " \ 376 401 ," + self.expTime + " \ 377 ,'" + self. safeDictionaryAccess(self.header, 'PSFMODEL')+ "' \378 , '" + self.safeDictionaryAccess(self.header, 'FWHM_MAJ') + "'\379 , '" + self.safeDictionaryAccess(self.header, 'FW_MJ_UQ') + "'\402 ,'" + self.psfmodel + "' \ 403 ," + str(self.fwhm_maj) + " \ 404 ," + str(self.fwhm_maj_uq) + " \ 380 405 ,'" + self.header['CTYPE1'] + "' \ 381 406 ,'" + self.header['CTYPE2'] + "' \ … … 486 511 ," + self.historyModNum + " \ 487 512 FROM SkyChip_psf" 488 self.scratchDb.execute(sql) 489 513 514 # print "sql: ", sql 515 516 self.scratchDb.execute(sql) 517 490 518 #it is possible to drop some detections from dvo (that are present in the cmf). when that happens we get a 0 for objid 491 519 #we drop those... … … 509 537 510 538 self.updateDvoIDsAndFlags("StackDetection") 539 # response = raw_input("updated dvo ") 511 540 512 541 sql = "ALTER IGNORE TABLE StackDetection ADD PRIMARY KEY (objID)" 513 542 514 543 self.scratchDb.execute(sql) 544 # response = raw_input("add primary key? ") 515 545 516 546 if self.stackType == "DEEP_STACK": … … 524 554 525 555 self.scratchDb.execute(sql) 556 # response = raw_input("add psf flux ") 526 557 527 558 #leave null instflux in … … 529 560 530 561 self.scratchDb.reportAndDeleteRowsWithNULLS("StackDetection", "objID") 562 # response = raw_input("delete nulls ") 531 563 532 564 sql="DELETE FROM StackDetection where objID = 0" … … 534 566 self.scratchDb.execute(sql) 535 567 self.logger.infoPair("Delleting", "entries with StackDetection.objID = 0") 568 # response = raw_input("deleted objID is 0 ") 536 569 537 570 … … 702 735 FROM StackDetection" 703 736 self.scratchDb.execute(sql) 737 704 738 # insert calibration information from dvoDetections into the Table 705 739 sql = "UPDATE " + tableName + " AS a, " + self.scratchDb.dvoDetectionTable + " AS b \ … … 802 836 WHERE a.ippDetectID = b.ippDetectID \ 803 837 AND b.imageID = " + str(imageID) 838 839 # print "update dvo sql: ", sql 804 840 self.scratchDb.execute(sql) 805 841
Note:
See TracChangeset
for help on using the changeset viewer.
