IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38841


Ignore:
Timestamp:
Oct 10, 2015, 2:11:52 PM (11 years ago)
Author:
eugene
Message:

fix test for table existence (Chip.psf vs Chip_psf)

Location:
trunk/ippToPsps/jython
Files:
2 edited

Legend:

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

    r38839 r38841  
    680680                if x==7 and y==7: continue
    681681
    682                 ota = "XY%d%d" % (x, y)
    683                 extension = ota + "_psf"
    684                 if extension not in self.tablesLoaded: continue
    685 
    686                 self.scratchDb.createIndex(extension, "IPP_IDET")
    687 
    688         extension = "Chip_psf"
    689         if extension in self.tablesLoaded:
    690             # try the test Chip
    691             self.scratchDb.createIndex(extension, "IPP_IDET")
     682                cmfTable = "XY%d%d.psf" % (x, y)
     683                mysTable = "XY%d%d_psf" % (x, y)
     684                if cmfTable not in self.tablesLoaded: continue
     685
     686                self.scratchDb.createIndex(mysTable, "IPP_IDET")
     687
     688        cmfTable = "XY%d%d.psf" % (x, y)
     689        mysTable = "XY%d%d_psf" % (x, y)
     690        if cmfTable in self.tablesLoaded:
     691            self.scratchDb.createIndex(mysTable, "IPP_IDET")
    692692
    693693        self.logger.infoPair("created indexes on", "IPP tables")     
     
    860860    def populatePspsTables(self):
    861861
     862        print "********** ***************"
     863        for table in self.tablesLoaded:
     864            print "table: " + str(table)
     865        print "--------------------------"
     866
    862867        # loop through all OTAs again to update with DVO IDs
    863868        self.skipBatch = False
     
    882887
    883888                ota = "XY%d%d" % (x, y)
    884                 extension = ota + "_psf"
     889                extension = ota + ".psf"
    885890                if extension not in self.tablesLoaded: continue
    886891
     
    893898
    894899
    895         extension = "Chip_psf"
     900        extension = "Chip.psf"
    896901        if extension in self.tablesLoaded:
    897902            if self.populatePspsTablesChip("Chip", 0, 0, results, tables): otaCount = otaCount + 1
  • trunk/ippToPsps/jython/stackbatch.py

    r38837 r38841  
    549549                continue
    550550
    551             cmfTable = filter + "SkyChip_xsrc"
     551            cmfTable = filter + "SkyChip.xsrc"
     552            mysTable = filter + "SkyChip_xsrc"
    552553            if not cmfTable in self.tablesLoaded:
    553554                self.logger.infoPair("no xsrc data for filter" , filter)
     
    630631            return True
    631632
    632         cmfTable = filter + "SkyChip_xfit"
     633        cmfTable = filter + "SkyChip.xfit"
     634        mysTable = filter + "SkyChip_xfit"
    633635        if not cmfTable in self.tablesLoaded:
    634636            self.logger.infoPair("no xfit data for filter" , filter)
    635637            return True
    636638
    637         if self.scratchDb.getRowCount(cmfTable) <=0 :
     639        if self.scratchDb.getRowCount(mysTable) <=0 :
    638640            self.logger.infoPair("no extended source information, trying to skip",filter)
    639641            return True
     
    644646        magtime = "%.5f" % (2.5*math.log10(float(header['EXPTIME'])))
    645647
    646         sqlLine = sqlUtility("UPDATE " + tablename + " AS a, " + cmfTable + " AS b SET")
     648        sqlLine = sqlUtility("UPDATE " + tablename + " AS a, " + mysTable + " AS b SET")
    647649
    648650        sqlLine.group("a."+filter+"haveData",              "'1'")
     
    798800            return True
    799801
    800         cmfTable = filter + "SkyChip_xsrc"
     802        cmfTable = filter + "SkyChip.xsrc"
     803        mysTable = filter + "SkyChip_xsrc"
    801804        if not cmfTable in self.tablesLoaded:
    802805            self.logger.infoPair("no xsrc data for filter" , filter)
    803806            return True
    804807
    805         if self.scratchDb.getRowCount(cmfTable) <=0 :
     808        if self.scratchDb.getRowCount(mysTable) <=0 :
    806809            self.logger.infoPair("no extended source information, trying to skip", filter)
    807810            return True
     
    817820
    818821        self.logger.infoPair("Adding", "petrosians for extended sources")
    819         sqlLine = sqlUtility("UPDATE " + tablename + " AS a, " + cmfTable + " AS b SET")
     822        sqlLine = sqlUtility("UPDATE " + tablename + " AS a, " + mysTable + " AS b SET")
    820823
    821824        sqlLine.group("a."+filter+"haveData",         "'1'")
     
    951954
    952955        # set the flux values from the cmf file
    953         cmfTable = filter + "SkyChip_xrad"
     956        cmfTable = filter + "SkyChip.xrad"
     957        mysTable = filter + "SkyChip_xrad"
    954958
    955959        # skip this table if it was not loaded from the cmf
     
    959963
    960964        # we have variable numbers of these columns. find out which are in use
    961         sql = "DESCRIBE " + cmfTable + " 'aper_fill_%'"
     965        sql = "DESCRIBE " + mysTable + " 'aper_fill_%'"
    962966        rs = self.scratchDb.executeQuery(sql)
    963967        rs.first()
     
    983987
    984988        # generate the sql to do the necessary ops on the columns   
    985         sqlLine = sqlUtility("UPDATE " + tablename + " AS a, " + cmfTable + " AS b SET ")
     989        sqlLine = sqlUtility("UPDATE " + tablename + " AS a, " + mysTable + " AS b SET ")
    986990
    987991        sqlLine.group("a."+filter+"haveData", "'1'")
     
    11161120            self.logger.infoPair("Creating indexes on", "IPP tables")
    11171121
    1118             cmfTable = filter + "SkyChip_psf"
    1119             if cmfTable in self.tablesLoaded: self.scratchDb.createIndex(cmfTable, "IPP_IDET")
    1120 
    1121             cmfTable = filter + "SkyChip_xfit"
    1122             if cmfTable in self.tablesLoaded: self.scratchDb.createIndex(cmfTable, "IPP_IDET")
    1123 
    1124             cmfTable = filter + "SkyChip_xrad"
    1125             if cmfTable in self.tablesLoaded: self.scratchDb.createIndex(cmfTable, "IPP_IDET")
    1126 
    1127             cmfTable = filter + "SkyChip_xsrc"
    1128             if cmfTable in self.tablesLoaded: self.scratchDb.createIndex(cmfTable, "IPP_IDET")
     1122            cmfTable = filter + "SkyChip.psf"
     1123            mysTable = filter + "SkyChip_psf"
     1124            if cmfTable in self.tablesLoaded: self.scratchDb.createIndex(mysTable, "IPP_IDET")
     1125
     1126            cmfTable = filter + "SkyChip.xfit"
     1127            mysTable = filter + "SkyChip_xfit"
     1128            if cmfTable in self.tablesLoaded: self.scratchDb.createIndex(mysTable, "IPP_IDET")
     1129
     1130            cmfTable = filter + "SkyChip.xrad"
     1131            mysTable = filter + "SkyChip_xrad"
     1132            if cmfTable in self.tablesLoaded: self.scratchDb.createIndex(mysTable, "IPP_IDET")
     1133
     1134            cmfTable = filter + "SkyChip.xsrc"
     1135            mysTable = filter + "SkyChip_xsrc"
     1136            if cmfTable in self.tablesLoaded: self.scratchDb.createIndex(mysTable, "IPP_IDET")
    11291137
    11301138        return True
Note: See TracChangeset for help on using the changeset viewer.