Changeset 38958 for trunk/ippToPsps/jython/detectionbatch.py
- Timestamp:
- Oct 24, 2015, 2:20:15 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/detectionbatch.py (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/detectionbatch.py
r38956 r38958 46 46 47 47 super(DetectionBatch, self).__init__( 48 logger,49 config,50 skychunk,51 gpc1Db,52 ippToPspsDb,53 scratchDb,54 camID,55 batchID,56 "P2",57 gpc1Db.getCameraStageSmf(camID,skychunk.P2_smf_version))48 logger, 49 config, 50 skychunk, 51 gpc1Db, 52 ippToPspsDb, 53 scratchDb, 54 camID, 55 batchID, 56 "P2", 57 gpc1Db.getCameraStageSmf(camID,skychunk.P2_smf_version)) 58 58 59 59 # get camera meta data … … 109 109 self.logger.errorPair("Could not get", "FILTERID") 110 110 raise 111 111 112 112 # MJD-OBS is the exposure start, EXTIME / 172800 = (EXPTIME sec / 84600 sec/day) / 2 113 113 self.obsTime = float(self.header['MJD-OBS']) + (float(self.header['EXPTIME']) / 172800.0) 114 114 115 115 ## MEH md5sum options test 116 self.md5sum = None117 116 self.md5sum = self.fits.getMd5sum() 118 #self.md5sum = self.fits.getMd5sumShell() 119 #self.md5sum = self.fits.getMd5sumFile() 120 117 121 118 # set up some defauts 122 119 self.totalNumPhotoRef = 0 123 124 120 125 121 self.filter = self.header['FILTERID'][0:1] … … 198 194 self.scratchDb.updateFilterID("FrameMeta", self.filter) 199 195 self.scratchDb.updateAllRows("FrameMeta", "processingVersion", str(self.skychunk.processingVersion)) 196 return True 200 197 201 198 ''' … … 344 341 self.scratchDb.execute(sql) 345 342 343 print "---- inserted ImageMeta into mysql" 344 346 345 self.scratchDb.updateRecalStats(tableName, header['IMAGEID'], str(pltscale)); 347 346 self.scratchDb.updateFilterID(tableName, self.filter) 348 347 self.scratchDb.updateAllRows(tableName, "processingVersion", str(self.skychunk.processingVersion)) 349 348 349 print "---- updated things" 350 350 351 if 'NASTRO' in header: self.totalNumPhotoRef = self.totalNumPhotoRef + int(header['NASTRO']) 351 352 self.scratchDb.replaceNullsInThisColumn(tableName, "polyOrder", "0") 352 353 354 print "---- completed ImageMeta" 355 return True 356 353 357 ''' 354 358 Populates the ImageDetEffMeta table for this OTA 355 359 ''' 356 360 def populateImageDetEffMetaTablePart1(self, ota, header): 361 print "---- *** populate ImageDetEffMetaTablePart1" 357 362 ippTableName = ota + "_deteff" 358 363 tableName = "ImageDetEffMeta_" + ota … … 384 389 385 390 # for loop 391 return True 386 392 387 393 ''' … … 389 395 ''' 390 396 def populateImageDetEffMetaTablePart2(self, ota): 397 print "---- *** populate ImageDetEffMetaTablePart2" 398 391 399 ippTableName = ota + "_deteff" 392 400 tableName = "ImageDetEffMeta_" + ota 393 401 394 # ok, this is a bit tricky - Ideally I just want this all in one table, however, the way the table is layed out is 90 degrees from how I want it.402 # ok, this is a bit tricky - Ideally I just want this all in one table, however, the way the table is layed out is 90 degrees from how I want it. 395 403 # the steps out of this mess are as follows: 396 404 # give an index to XYxy_deteff (already done, called table_index) … … 424 432 self.logger.errorPair('failed sql: ', sql) 425 433 raise 434 return True 426 435 427 436 … … 552 561 # we don't delete these anymore 553 562 results['NULLINSTFLUX'] = 0; 563 return True 554 564 555 565 ''' … … 580 590 581 591 self.scratchDb.updateAllRows(tableName, "processingVersion", str(self.skychunk.processingVersion)) 592 return True 593 582 594 ''' 583 595 Populates the SkinnyObject table for this OTA … … 607 619 608 620 self.scratchDb.updateAllRows(tableName, "processingVersion", str(self.skychunk.processingVersion)) 621 return True 609 622 610 623 ''' … … 641 654 642 655 # populate ImageMeta 656 # XXX EAM 20151024 : 643 657 if not self.populateImageMetaTable(chipname, header): 644 658 self.logger.infoPair("skipping chip: ", chipname) … … 647 661 self.updateImageID("ImageMeta_" + chipname, x, y) 648 662 663 # XXX EAM 20151024 : problem is here? 649 664 self.populateImageDetEffMetaTablePart1(chipname, header) 650 665 self.updateImageID("ImageDetEffMeta_" + chipname, x, y) … … 693 708 return True 694 709 695 696 710 ''' 697 711 Applies indexes to the IPP tables … … 722 736 723 737 self.logger.infoPair("created indexes on", "IPP tables") 738 return True 739 724 740 725 741 ''' … … 771 787 772 788 self.scratchDb.execute(sql) 789 return True 773 790 774 791 ''' … … 786 803 self.logger.errorPair('failed sql',sql) 787 804 raise 805 return True 788 806 789 807 ''' … … 1004 1022 1005 1023 print "duplicates found: ", str(Nduplicates) 1024 return True 1006 1025 1007 1026 ''' … … 1012 1031 sql = "UPDATE " + tableName + " SET imageID = %d%d%d" % (self.expID, x, y) 1013 1032 self.scratchDb.execute(sql) 1033 return True 1014 1034 1015 1035 ''' … … 1022 1042 if table.name == "FrameMeta": self.scratchDb.reportNulls(table.name, showPartials) 1023 1043 else: self.scratchDb.reportNulls(table.name + "_XY33", showPartials) 1024 1044 return True 1025 1045 1026 1046 '''
Note:
See TracChangeset
for help on using the changeset viewer.
