IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 11, 2015, 3:48:35 PM (11 years ago)
Author:
eugene
Message:

get deteffHeader to read nInjected and MAGREF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/detectionbatch.py

    r39101 r39109  
    356356    Populates the ImageDetEffMeta table for this OTA
    357357    '''
    358     def populateImageDetEffMetaTablePart1(self, ota, header):
     358    def populateImageDetEffMetaTablePart1(self, ota, header, deteffHeader):
    359359        print "---- *** populate ImageDetEffMetaTablePart1"
    360360        ippTableName = ota + "_deteff"
     
    373373
    374374        # CZW: 20151110 This needs to get the deteff header as well.
    375         nInjected = int(self.getKeyInt(header, 0, 'DETEFF.NUM'))
    376         detectionThreshold = self.getKeyFloat(header, "%.8f", 'DETEFF.MAGREF')
     375        nInjected = int(self.getKeyInt(deteffHeader, 0, 'DETEFF.NUM'))
     376        magref = self.getKeyFloat(deteffHeader, "%.8f", 'DETEFF.MAGREF')
     377
    377378        expTime = self.getKeyFloat(header, "%.8f", 'EXPTIME')
    378379        zp      = self.getKeyFloat(header, "%.8f", 'ZPT_OBS')
    379380
     381        # zp correction comes from DVO (unless it is not found)
    380382        zpImage = self.scratchDb.getImageZeroPoint(self.imageIDs[ota])
    381383
    382         # XXX zp correction should come from DVO
    383         detectionThreshold = detectionThreshold + zpImage + 2.5 * math.log10(expTime)
    384 
     384        if zpImage < 0.0:
     385            zpImage = zp
     386
     387        detectionThreshold = magref + zpImage + 2.5 * math.log10(expTime)
    385388
    386389        sqlLine.group("frameID",          str(self.expID))
     
    672675        self.updateImageID("ImageMeta_" + chipname, x, y)
    673676
     677        deteffHeader = self.fits.findAndReadHeader(chipname + ".deteff", self.config.test)
     678
    674679        # XXX EAM 20151024 : problem is here?
    675         self.populateImageDetEffMetaTablePart1(chipname, header)
     680        self.populateImageDetEffMetaTablePart1(chipname, header, deteffHeader)
    676681        self.updateImageID("ImageDetEffMeta_" + chipname, x, y)
    677682       
Note: See TracChangeset for help on using the changeset viewer.