Changeset 33235 for trunk/ippToPsps
- Timestamp:
- Feb 10, 2012, 1:40:18 PM (14 years ago)
- Location:
- trunk/ippToPsps/jython
- Files:
-
- 4 edited
-
batch.py (modified) (5 diffs)
-
detectionbatch.py (modified) (13 diffs)
-
initbatch.py (modified) (1 diff)
-
stackbatch.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/batch.py
r32824 r33235 27 27 ''' 28 28 Constructor 29 30 >>> batch = Batch(1,2,3,4,5,6,7)31 >>> print batch.pspsVoTableFilePath32 "../config/2/tables.vot"33 29 ''' 34 30 def __init__(self, … … 41 37 batchID, 42 38 batchType, 43 fits): 39 fits, 40 useFullTables): 44 41 45 42 self.everythingOK = False … … 48 45 self.doc = doc 49 46 self.fits = fits 47 self.useFullTables = useFullTables 50 48 51 49 # set up logging … … 82 80 self.dvoGpc1Label = self.doc.find("dvo/gpc1Label").text 83 81 self.dvoLocation = self.doc.find("dvo/location").text 84 self.useFullTables = int(self.doc.find("dvo/useFullTables").text)85 82 self.scratchDb = ScratchDb(logger, self.doc, self.useFullTables) 86 83 … … 496 493 def getIDsFromDVO(self): 497 494 498 if self.scratchDb.getRowCount( "dvoMeta") < 1:499 self.logger.error ("No DVO IDs found in dvoMeta")495 if self.scratchDb.getRowCount(self.scratchDb.dvoImagesTable) < 1: 496 self.logger.errorInfo("No DVO images found in", self.scratchDb.dvoImagesTable) 500 497 return False 501 498 -
trunk/ippToPsps/jython/detectionbatch.py
r32592 r33235 38 38 ippToPspsDb, 39 39 camID, 40 batchID): 40 batchID, 41 useFullTables): 41 42 42 43 super(DetectionBatch, self).__init__( … … 49 50 batchID, 50 51 "P2", 51 gpc1Db.getCameraStageSmf(camID)) 52 gpc1Db.getCameraStageSmf(camID), 53 useFullTables) 52 54 53 55 if not self.everythingOK: return … … 322 324 ," + self.safeDictionaryAccess(header, 'DAPMIFIT') + " \ 323 325 ,'" + self.safeDictionaryAccess(header, 'DETECTOR') + "' \ 324 ," + str(self.scratchDb.getDvoImageFlags(header[' SOURCEID'], header['IMAGEID'])) + " \326 ," + str(self.scratchDb.getDvoImageFlags(header['IMAGEID'])) + " \ 325 327 ,'" + self.safeDictionaryAccess(header, 'DETREND.MASK') + "' \ 326 328 ,'" + self.safeDictionaryAccess(header, 'DETREND.DARK') + "' \ … … 416 418 ,momentYY \ 417 419 ,apMag \ 418 ,kronFlux \419 ,kronFluxErr \420 420 ,infoFlag \ 421 421 ,sky \ … … 448 448 ,MOMENTS_YY \ 449 449 ,AP_MAG \ 450 ,KRON_FLUX \451 ,KRON_FLUX_ERR \452 450 ,FLAGS\ 453 451 ,SKY \ … … 545 543 self.populateFrameMeta() 546 544 547 # dictionary objects to hold sourceIDs and imageIDs for later 548 self.sourceIDs = {} 545 # dictionary objects to hold imageIDs for later 549 546 self.imageIDs = {} 550 547 … … 578 575 579 576 # store these for later 580 self.sourceIDs[ota] = header['SOURCEID']581 577 self.imageIDs[ota] = header['IMAGEID'] 582 578 … … 614 610 Updates provided table with DVO IDs from DVO table 615 611 ''' 616 def updateDvoIDs(self, table, sourceID,externID):617 618 imageID = self.scratchDb.getImageIDFromExternID( sourceID,externID)612 def updateDvoIDs(self, table, externID): 613 614 imageID = self.scratchDb.getImageIDFromExternID(externID) 619 615 self.logger.debug("Updating table '" + table + "' with DVO IDs using imageID = %d" % imageID) 620 616 sql = "UPDATE IGNORE " + table + " AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \ … … 624 620 a.infoFlag = b.flags << 32 | a.infoFlag \ 625 621 WHERE a.ippDetectID = b.ippDetectID \ 626 AND b.sourceID = " + str(sourceID) + " \627 622 AND b.imageID = " + str(imageID) 628 623 … … 655 650 656 651 ota = "XY%d%d" % (x, y) 657 if ota not in self. sourceIDs: continue652 if ota not in self.imageIDs: continue 658 653 659 654 #self.logger.infoTitle("Processing " + ota) … … 666 661 667 662 # now add DVO IDs 668 self.updateDvoIDs("Detection_" + ota, self. sourceIDs[ota], self.imageIDs[ota])663 self.updateDvoIDs("Detection_" + ota, self.imageIDs[ota]) 669 664 results['NULLOBJID'] = self.scratchDb.reportAndDeleteRowsWithNULLS("Detection_" + ota, "objID") 670 665 self.updateImageID("Detection_" + ota, x, y) … … 693 688 # update ImageMeta with count of detections for this OTA and photoCodeID 694 689 sql = "UPDATE ImageMeta_" + ota + " \ 695 SET nDetect = %d, photoCalID = %d" % (self.scratchDb.getRowCount("Detection_" + ota), self.scratchDb.getPhotoCalID(self. sourceIDs[ota], self.imageIDs[ota]))690 SET nDetect = %d, photoCalID = %d" % (self.scratchDb.getRowCount("Detection_" + ota), self.scratchDb.getPhotoCalID(self.imageIDs[ota])) 696 691 self.scratchDb.execute(sql) 697 692 … … 760 755 else : regex = ".*.psf" 761 756 762 columns = "IPP_IDET X_PSF Y_PSF X_PSF_SIG Y_PSF_SIG PSF_INST_MAG PSF_INST_MAG_SIG PEAK_FLUX_AS_MAG PSF_MAJOR PSF_MINOR PSF_THETA EXT_NSIGMA PSF_QF MOMENTS_XX MOMENTS_XY MOMENTS_YY AP_MAG KRON_FLUX KRON_FLUX_ERRFLAGS SKY SKY_SIGMA EXT_NSIGMA"757 columns = "IPP_IDET X_PSF Y_PSF X_PSF_SIG Y_PSF_SIG PSF_INST_MAG PSF_INST_MAG_SIG PEAK_FLUX_AS_MAG PSF_MAJOR PSF_MINOR PSF_THETA EXT_NSIGMA PSF_QF MOMENTS_XX MOMENTS_XY MOMENTS_YY AP_MAG FLAGS SKY SKY_SIGMA EXT_NSIGMA" 763 758 764 759 return super(DetectionBatch, self).importIppTables(columns, regex) -
trunk/ippToPsps/jython/initbatch.py
r32458 r33235 40 40 batchID, 41 41 "IN", 42 None) 42 None, 43 0) 43 44 44 45 self.outputFitsFile = "00000000.FITS"; -
trunk/ippToPsps/jython/stackbatch.py
r33146 r33235 35 35 ippToPspsDb, 36 36 stackID, 37 batchID): 37 batchID, 38 useFullTables): 38 39 39 40 super(StackBatch, self).__init__( … … 46 47 batchID, 47 48 "ST", 48 gpc1Db.getStackStageCmf(configDoc.find("dvo/gpc1Label").text, stackID)) 49 gpc1Db.getStackStageCmf(configDoc.find("dvo/gpc1Label").text, stackID), 50 useFullTables) 49 51 50 52 if not self.everythingOK: return
Note:
See TracChangeset
for help on using the changeset viewer.
