IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

DetEff/ detectionThreshold/ nInjected fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.