IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 23, 2015, 9:50:16 AM (11 years ago)
Author:
eugene
Message:

get image zero point information from DVO Image table

File:
1 edited

Legend:

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

    r38929 r38951  
    199199    def populateImageMetaTable(self, ota, header):
    200200
     201        # does this chip exist in the DVO image table? (if NOT, then skip it)
     202        if not self.scratchDb.haveThisChip(self.imageIDs[ota], self.sourceIDs[ota]):
     203            self.logger.info("| %5s |            ------------- Chip not in DVO : rejecting ------------                    |" % ota)
     204            return False
     205
    201206        # the supplied 'header' matches this chip
    202207        # self.header is the PHU header for this smf
     
    231236        zp      = self.getKeyFloat(header, "%.8f", 'ZPT_OBS')
    232237
     238        zpImage = self.scratchDb.getImageZeroPoint(self.imageIDs[ota])
     239
    233240        # XXX zp correction should come from DVO
    234         detectionThreshold = detectionThreshold + zp - 2.5 * math.log10(expTime)
     241        detectionThreshold = detectionThreshold + zpImage - 2.5 * math.log10(expTime)
    235242       
    236243        # insert image metadata into table
     
    246253        sqlLine.group("astroScat",          astroscat)
    247254        sqlLine.group("photoScat",          self.getKeyFloat(header, "%.8f", 'ZPT_ERR'))
    248         sqlLine.group("photoZero",          zp)
     255        sqlLine.group("photoZero",          zpImage)
    249256        sqlLine.group("nAstroRef",          self.getKeyValue(header, 'NASTRO'))
    250257        sqlLine.group("nPhotoRef",          self.getKeyValue(header, 'NASTRO'))
     
    629636           
    630637        # populate ImageMeta
    631         self.populateImageMetaTable(chipname, header)
     638        if not self.populateImageMetaTable(chipname, header):
     639            self.logger.infoPair("skipping chip: ", chipname)
     640            return False
     641
    632642        self.updateImageID("ImageMeta_" + chipname, x, y)
    633643
     
    810820        ota = x*10+y
    811821
    812 
    813822        self.logger.info("add psps unique p2 ids")
    814823        self.updatePspsUniqueIDs("Detection_" + chipname, ota)
     
    901910                if x==7 and y==7: continue
    902911
     912                # skip chips which were not loaded
    903913                ota = "XY%d%d" % (x, y)
    904914                extension = ota + ".psf"
    905915                if extension not in self.tablesLoaded: continue
    906916
    907                 if self.populatePspsTablesChip(ota, x, y, results, tables): otaCount = otaCount + 1
     917                # skip chips which had a problem (e.g., not in DVO)
     918                if not self.populatePspsTablesChip(ota, x, y, results, tables):
     919                    if self.skipBatch:
     920                        self.logger.error("fatal problem for exposure, skipping")
     921                        return False
     922                    continue
     923                               
     924                otaCount = otaCount + 1
     925                self.populateImageDetEffMetaTablePart2(ota)
     926
     927        extension = "Chip.psf"
     928        if extension in self.tablesLoaded:
     929            if not self.populatePspsTablesChip("Chip", 0, 0, results, tables):
     930                print "--- skipped Chip.psf"
    908931                if self.skipBatch:
    909932                    self.logger.error("fatal problem for exposure, skipping")
    910933                    return False
    911                                
    912                 self.populateImageDetEffMetaTablePart2(ota)
    913 
    914 
    915         extension = "Chip.psf"
    916         if extension in self.tablesLoaded:
    917             if self.populatePspsTablesChip("Chip", 0, 0, results, tables): otaCount = otaCount + 1
    918             if self.skipBatch:
    919                 self.logger.error("fatal problem for exposure, skipping")
    920                 return False
     934            else:
     935                otaCount = otaCount + 1
     936
     937            print "--- tried Chip.psf"
    921938
    922939        # print totals
     
    931948        self.logger.info("+-------+---------------+---------------+---------------+---------------+---------------+")
    932949
     950        print "--- tried Chip.psf (2)"
     951
    933952        # if we only have one table export, i.e. FrameMeta, then get out of here (skip batch, but do not abort)
    934953        if len(self.tablesToExport) == 1:
Note: See TracChangeset for help on using the changeset viewer.