IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 6, 2015, 3:59:13 PM (11 years ago)
Author:
eugene
Message:

added code to populate StackToFrame table

File:
1 edited

Legend:

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

    r39062 r39068  
    184184
    185185       self.dropTableVerbose("StackToImage")
     186       self.dropTableVerbose("StackToFrame")
    186187
    187188
     
    10761077        self.tablesToExport.append("StackToImage")
    10771078
     1079    '''
     1080    Populates the StackToFrame table
     1081    '''
     1082    def populateStackToFrame(self):
     1083
     1084        self.logger.infoPair("Procesing table", "StackToFrame")
     1085
     1086        for filter in self.filters:
     1087           
     1088            header = self.headerSet[filter]
     1089
     1090            stackImageID = self.stackIDs[filter]
     1091            if stackImageID == 0: continue
     1092   
     1093            nInputs = self.getKeyInt(header, 0, 'NINPUTS')
     1094
     1095            for input in range(nInputs):
     1096               
     1097                field = "INP_%04d" % input
     1098                inputName = self.getKeyValue(header, field)
     1099               
     1100                # split inputName of form o5745g0406o.356782.wrp.1199763.skycell.1315.090.fits
     1101                # to get the expID (second block)
     1102                words = inputName.split('.')
     1103                frameID = words[1]
     1104               
     1105                field = "SCL_%04d" % input
     1106                scaleFactor = self.getKeyFloat(header, "%9.5f", field)
     1107               
     1108                field = "ZPT_%04d" % input
     1109                zeroPoint = self.getKeyFloat(header, "%9.5f", field)
     1110               
     1111                field = "EXP_%04d" % input
     1112                expTime = self.getKeyFloat(header, "%6.3f", field)
     1113               
     1114                field = "AIR_%04d" % input
     1115                airMass = self.getKeyFloat(header, "%6.3f", field)
     1116               
     1117                sql = "INSERT INTO StackToFrame "
     1118                sql += " (stackImageID, frameID, scaleFactor, zp, expTime, airMass) VALUES ( "
     1119                sql += str(stackImageID) + ", "
     1120                sql += str(frameID) + ", "
     1121                sql += str(scaleFactor) + ", "
     1122                sql += str(zeroPoint) + ", "
     1123                sql += str(expTime) + ", "
     1124                sql += str(airMass) + ")"
     1125                self.scratchDb.execute(sql)
     1126
     1127        self.tablesToExport.append("StackToFrame")
     1128
    10781129    '''
    10791130    Populate StackDetEffMeta
     
    13731424        self.logger.infoPair("populating","StackToImage")
    13741425        self.populateStackToImage()
     1426       
     1427        self.logger.infoPair("populating","StackToFrame")
     1428        self.populateStackToFrame()
    13751429       
    13761430        self.setMinMaxObjID(["StackObjectThin"])
Note: See TracChangeset for help on using the changeset viewer.