IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39097 for trunk


Ignore:
Timestamp:
Nov 10, 2015, 3:09:38 PM (11 years ago)
Author:
watersc1
Message:

DetEff/ detectionThreshold/ nInjected fixes.

Location:
trunk/ippToPsps/jython
Files:
3 edited

Legend:

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

    r39094 r39097  
    372372        sqlLine = sqlUtility("INSERT INTO " + tableName + "(")
    373373
     374        nInjected = int(self.getKeyInt(header, 0, 'DETEFF.NUM'))
     375        detectionThreshold = self.getKeyFloat(header, "%.8f", 'DETEFF.MAGREF')
     376        expTime = self.getKeyFloat(header, "%.8f", 'EXPTIME')
     377        zp      = self.getKeyFloat(header, "%.8f", 'ZPT_OBS')
     378
     379        zpImage = self.scratchDb.getImageZeroPoint(self.imageIDs[ota])
     380
     381        # XXX zp correction should come from DVO
     382        detectionThreshold = detectionThreshold + zpImage + 2.5 * math.log10(expTime)
     383
     384
    374385        sqlLine.group("frameID",          str(self.expID))
    375         sqlLine.group("magref",           self.getKeyFloat(header,"%.8f","DETEFF.MAGREF"))
     386        sqlLine.group("magref",           detectionThreshold)
     387        sqlLine.group("nInjected",        nInjected)
    376388        sql = sqlLine.make(") VALUES ( ", ")")
    377389                     
     
    10631075        ## regex only works for -stilts import
    10641076        regex = ".*"
    1065    
     1077       
    10661078        ## for a quick test, just do the first chip:
    10671079        if self.config.test and self.config.camera == "gpc1":
  • trunk/ippToPsps/jython/diffbatch.py

    r39094 r39097  
    507507        header = self.header[num]
    508508        zpImage = self.getKeyFloat(header,"%.8f","FPA.ZP")
     509        expTime = self.getKeyFloat(header, "%.8f", 'EXPTIME')
    509510
    510511        if zpImage == 0.0:
    511512            self.logger.infoPair("CZW If this value for the zeropoint is zero, the getImageZeroPoint call is likely still broken", str(zpImage))
    512513
    513         magref = self.getKeyFloat(header,"%.8f","DETEFF.MAGREF") + zpImage
     514
     515        deteffHeader = self.posFits[num].findAndReadHeader("SkyChip.deteff", self.config.test)
     516        if not deteffHeader:
     517            if self.config.test: self.logger.errorPair("No header found for Skychip.deteff for", filter)
     518            return False
     519
     520        magref = self.getKeyFloat(deteffHeader,"%.8f","DETEFF.MAGREF") + zpImage + 2.5 * math.log10(expTime)
    514521        self.logger.infoPair("Found zeropoint and set magref", str(magref))
     522
     523        nInjected = int(self.getKeyInt(deteffHeader, 0, 'DETEFF.NUM'))
     524       
    515525
    516526        sqlLine = sqlUtility("INSERT INTO " + ippTableName + "(")
    517527        sqlLine.group("diffImageID", str(diffSkyFileID))
    518528        sqlLine.group("magref",       magref)
     529        sqlLine.group("nInjected",    nInjected)
    519530        sql = sqlLine.make(") VALUES ( ", ")")
    520531
  • trunk/ippToPsps/jython/stackbatch.py

    r39094 r39097  
    265265       
    266266        # Convert detectionThreshold to appropriate magnitudes
    267         detectionThreshold = self.getKeyFloat(header, "%.8f", 'DETEFF.MAGREF')
     267        # Grab this from the appropriate extension.
     268        deteffHeader = self.fits[filter].findAndReadHeader("SkyChip.deteff", self.config.test)
     269        if not deteffHeader:
     270            if self.config.test: self.logger.errorPair("No header found for Skychip.deteff for", filter)
     271            return False
     272
     273        detectionThreshold = self.getKeyFloat(deteffHeader, "%.8f", 'DETEFF.MAGREF')
    268274        expTime = self.getKeyFloat(header, "%.8f", 'EXPTIME')
    269275        zp      = self.getKeyFloat(header, "%.8f", 'ZPT_OBS')
     
    11681174
    11691175            header = self.headerSet[filter]
     1176
     1177            # Convert detectionThreshold to appropriate magnitudes
     1178            # Grab this from the appropriate extension.
     1179            deteffHeader = self.fits[filter].findAndReadHeader("SkyChip.deteff", self.config.test)
     1180            if not deteffHeader:
     1181                if self.config.test: self.logger.errorPair("No header found for Skychip.deteff for", filter)
     1182                return False
     1183
     1184            detectionThreshold = self.getKeyFloat(deteffHeader, "%.8f", 'DETEFF.MAGREF')
     1185            expTime = self.getKeyFloat(header, "%.8f", 'EXPTIME')
     1186            zp      = self.getKeyFloat(header, "%.8f", 'ZPT_OBS')
     1187            zpErr   = self.getKeyFloat(header, "%.8f", 'ZPT_ERR')
     1188
     1189        # zp correction should comes from DVO (unless image is not in DVO)
     1190            zpImage = self.scratchDb.getImageZeroPoint(stackID)
     1191            if zpImage < 0.0:
     1192                zpImage = zp
     1193
     1194            detectionThreshold = detectionThreshold + zpImage + 2.5 * math.log10(expTime)
     1195            nInjected = int(self.getKeyInt(deteffHeader, 0, 'DETEFF.NUM'))
     1196
    11701197            zpImage = self.scratchDb.getImageZeroPoint(stackImageID)
    11711198            if zpImage < 0.0:
     
    11761203            sqlLine.group("stackImageID", str(stackImageID))
    11771204            sqlLine.group("magref",       magref)
     1205            sqlLine.group("nInjected",    nInjected)
    11781206            sql = sqlLine.make(") VALUES ( ", ")")
    11791207           
Note: See TracChangeset for help on using the changeset viewer.