Changeset 35097 for trunk/ippToPsps/jython/ipptopspsdb.py
- Timestamp:
- Feb 6, 2013, 3:16:35 PM (13 years ago)
- Location:
- trunk/ippToPsps
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps
- Property svn:mergeinfo changed
-
trunk/ippToPsps/jython
- Property svn:ignore
-
old new 1 1 *.class 2 Makefile 3 Makefile.in
-
- Property svn:ignore
-
trunk/ippToPsps/jython/ipptopspsdb.py
r34661 r35097 17 17 Constructor 18 18 ''' 19 def __init__(self, logger, config): 20 super(IppToPspsDb, self).__init__(logger, config, "ipptopspsdatabase") 19 def __init__(self, logger, config, skychunk): 20 if (config.test): 21 dbType = "ipptopspsdatabase_test" 22 else: 23 dbType = "ipptopspsdatabase" 24 super(IppToPspsDb, self).__init__(logger, config, dbType) 25 26 self.skychunk = skychunk 21 27 22 28 self.MAX_FAILS = 5 … … 29 35 sql = "SELECT DISTINCT batch_id \ 30 36 FROM batch \ 31 WHERE timestamp > '" + self. config.epoch + "' \37 WHERE timestamp > '" + self.skychunk.epoch + "' \ 32 38 AND batch_type = '" + batchType + "' \ 33 AND dvo_db = '" + self. config.dvoLabel + "' \39 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 34 40 AND merged = 1 \ 35 41 AND " + column + " = 0" … … 54 60 sql = "SELECT DISTINCT batch_id \ 55 61 FROM batch \ 56 WHERE timestamp > '" + self. config.epoch + "' \62 WHERE timestamp > '" + self.skychunk.epoch + "' \ 57 63 AND batch_type = '" + batchType + "' \ 58 AND dvo_db = '" + self. config.dvoLabel + "' \64 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 59 65 AND purged = 1 \ 60 66 AND " + column + " = 0" … … 80 86 sql = "SELECT DISTINCT batch_id \ 81 87 FROM batch \ 82 WHERE timestamp > '" + self. config.epoch + "' \88 WHERE timestamp > '" + self.skychunk.epoch + "' \ 83 89 AND batch_type = '" + batchType + "' \ 84 AND dvo_db = '" + self. config.dvoLabel + "' \90 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 85 91 AND (loaded_to_ODM = -1 OR merge_worthy = 1) \ 86 92 AND " + column + " = 0" … … 148 154 sql = "SELECT DISTINCT batch_id \ 149 155 FROM batch \ 150 WHERE timestamp > '" + self. config.epoch + "' \156 WHERE timestamp > '" + self.skychunk.epoch + "' \ 151 157 AND batch_type = '" + batchType + "' \ 152 AND dvo_db = '" + self. config.dvoLabel + "' \158 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 153 159 AND processed = 1\ 154 160 AND loaded_to_datastore != 1 \ … … 177 183 sql = "SELECT batch_id \ 178 184 FROM batch \ 179 WHERE timestamp > '" + self. config.epoch + "' \180 AND dvo_db = '" + self. config.dvoLabel + "' \185 WHERE timestamp > '" + self.skychunk.epoch + "' \ 186 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 181 187 AND loaded_to_datastore = 1 \ 182 188 AND batch_type = '" + batchType + "' \ … … 206 212 sql = "SELECT batch_id \ 207 213 FROM batch \ 208 WHERE timestamp > '" + self. config.epoch + "' \209 AND dvo_db = '" + self. config.dvoLabel + "' \214 WHERE timestamp > '" + self.skychunk.epoch + "' \ 215 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 210 216 AND loaded_to_datastore = 1 \ 211 217 AND batch_type = '" + batchType + "' \ … … 235 241 sql = "SELECT batch_id \ 236 242 FROM batch \ 237 WHERE timestamp > '" + self. config.epoch + "' \238 AND dvo_db = '" + self. config.dvoLabel + "' \243 WHERE timestamp > '" + self.skychunk.epoch + "' \ 244 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 239 245 AND merge_worthy = 1 \ 240 246 AND batch_type = '" + batchType + "' \ … … 262 268 sql = "SELECT DISTINCT batch_id \ 263 269 FROM batch \ 264 WHERE timestamp > '" + self. config.epoch + "' \265 AND dvo_db = '" + self. config.dvoLabel + "' \270 WHERE timestamp > '" + self.skychunk.epoch + "' \ 271 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 266 272 AND " + column + " = " + str(value) 267 273 … … 288 294 FROM batch \ 289 295 WHERE batch_type = '" + batchType + "' \ 290 AND timestamp > '" + self. config.epoch + "' \291 AND dvo_db = '" + self. config.dvoLabel + "' \296 AND timestamp > '" + self.skychunk.epoch + "' \ 297 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 292 298 AND processed = 1 \ 293 299 AND loaded_to_datastore = 1 \ … … 315 321 FROM batch \ 316 322 WHERE batch_type = '" + batchType + "' \ 317 AND timestamp > '" + self. config.epoch + "' \318 AND dvo_db = '" + self. config.dvoLabel + "' \323 AND timestamp > '" + self.skychunk.epoch + "' \ 324 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 319 325 AND " + column + " = " + str(value) 320 326 … … 387 393 WHERE batch_type = '" + batchType + "' \ 388 394 AND processed = 1 \ 389 AND timestamp > '" + self. config.epoch + "' \390 AND dvo_db = '" + self. config.dvoLabel + "' \395 AND timestamp > '" + self.skychunk.epoch + "' \ 396 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 391 397 AND timestamp BETWEEN now() - INTERVAL " + interval + " AND now()" 392 398 … … 412 418 WHERE batch_type = '" + batchType + "' \ 413 419 AND loaded_to_datastore = 1 \ 414 AND timestamp > '" + self. config.epoch + "' \415 AND dvo_db = '" + self. config.dvoLabel + "' \420 AND timestamp > '" + self.skychunk.epoch + "' \ 421 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 416 422 ORDER BY timestamp DESC LIMIT 1" 417 423 … … 511 517 WHERE stage_id = " + str(stage_id) + " \ 512 518 AND batch_type = '" + batchType + "' \ 513 AND dvo_db = '" + self. config.dvoLabel + "' \519 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 514 520 AND batch_type != 'IN' \ 515 521 AND timestamp BETWEEN now() - INTERVAL 12 HOUR AND now()" … … 554 560 WHERE stage_id = " + str(stage_id) + " \ 555 561 AND batch_type = '" + batchType + "' \ 556 AND timestamp > '" + self. config.epoch + "' \557 AND dvo_db = '" + self. config.dvoLabel + "' \562 AND timestamp > '" + self.skychunk.epoch + "' \ 563 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 558 564 AND batch_type != 'IN' \ 559 565 AND processed = 1" … … 579 585 WHERE stage_id = " + str(stage_id) + " \ 580 586 AND batch_type = '" + batchType + "' \ 581 AND timestamp > '" + self. config.epoch + "' \582 AND dvo_db = '" + self. config.dvoLabel + "' \587 AND timestamp > '" + self.skychunk.epoch + "' \ 588 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 583 589 AND processed = -1" 584 590 … … 602 608 FROM batch \ 603 609 WHERE batch_type = '" + batchType + "' \ 604 AND timestamp > '" + self. config.epoch + "' \605 AND dvo_db = '" + self. config.dvoLabel + "' \610 AND timestamp > '" + self.skychunk.epoch + "' \ 611 AND dvo_db = '" + self.skychunk.dvoLabel + "' \ 606 612 AND processed = -1 \ 607 613 GROUP BY stage_id HAVING numoccur >= " + str(self.MAX_FAILS) … … 634 640 batchID = -1; 635 641 636 if self. config.force or \642 if self.skychunk.force or \ 637 643 (not self.alreadyProcessed(batchType, stageID) \ 638 644 and not self.processingNow(batchType, stageID) \ … … 650 656 '" + batchType + "', \ 651 657 " + str(stageID) + ", \ 652 '" + self. config.survey + "', \653 '" + self. config.dvoLabel + "', \654 '" + self. config.datastoreProduct + "' \658 '" + self.skychunk.survey + "', \ 659 '" + self.skychunk.dvoLabel + "', \ 660 '" + self.skychunk.datastoreProduct + "' \ 655 661 )" 656 662 self.logger.infoPair("heather:","sql") … … 749 755 750 756 ''' 751 Sets the configfield for this client752 ''' 753 def set ConfigForThisClient(self, config, host, pid):754 755 self.execute("UPDATE clients SET config = '" + config+ "' \757 Sets the skychunk field for this client 758 ''' 759 def setSkychunkForThisClient(self, skychunk, host, pid): 760 761 self.execute("UPDATE clients SET skychunk = '" + skychunk + "' \ 756 762 WHERE host = '" + host + "' \ 757 763 AND pid = " + str(pid)) 758 ''' 759 Sets the config field for a set of loader clients 760 ''' 761 def setConfigForLoaders(self, config, ids): 764 765 ''' 766 Sets the skychunk field for a set of loader clients 767 ''' 768 def setSkychunkForLoaders(self, skychunk, ids): 762 769 763 770 for id in ids: 764 self.execute("UPDATE clients SET config = '" + config+ "' \771 self.execute("UPDATE clients SET skychunk = '" + skychunk + "' \ 765 772 WHERE type = 'loader.py' \ 766 773 AND id = " + str(id)) … … 796 803 ''' 797 804 def insertClient(self, type, host, pid): 798 self.execute("INSERT INTO clients (timestamp, type, host, pid, config) VALUES (now(), '" + type + "', '" + host + "', " + str(pid) + ", '" + self.config.name + "')")805 self.execute("INSERT INTO clients (timestamp, type, host, pid, skychunk) VALUES (now(), '" + type + "', '" + host + "', " + str(pid) + ", '" + self.skychunk.name + "')") 799 806 800 807 ''' … … 831 838 try: 832 839 rs = self.executeQuery(sql) 833 rs.first()840 if rs.first() is False: return False 834 841 if rs.getInt(1) == 1: return True 835 842 else: return False … … 840 847 841 848 ''' 842 Returns a list of available configs843 ''' 844 def getActive ConfigList(self):849 Returns a list of available skychunks 850 ''' 851 def getActiveSkychunkList(self): 845 852 846 sql = "SELECT DISTINCT name FROM configWHERE active = 1 ORDER BY name"847 848 configs = []849 try: 850 rs = self.executeQuery(sql) 851 while (rs.next()): configs.append(rs.getString(1))852 except: 853 self.logger.errorPair("Can't get confignames", sql)853 sql = "SELECT DISTINCT name FROM skychunk WHERE active = 1 ORDER BY name" 854 855 skychunks = [] 856 try: 857 rs = self.executeQuery(sql) 858 while (rs.next()): skychunks.append(rs.getString(1)) 859 except: 860 self.logger.errorPair("Can't get skychunk names", sql) 854 861 finally: 855 862 rs.close() 856 863 857 return configs858 859 ''' 860 Prompts user for info about a new or existing configand lets them neter the various details861 ''' 862 def edit Config(self):864 return skychunks 865 866 ''' 867 Prompts user for info about a new or existing skychunk and lets them neter the various details 868 ''' 869 def editSkychunk(self): 863 870 864 871 print " ********************************************************************" 865 print " * Configeditor"872 print " * Skychunk editor" 866 873 print " *" 867 response = raw_input(" * Name for new config, or existing configto edit? ")874 response = raw_input(" * Name for new skychunk, or existing skychunk to edit? ") 868 875 if response == "": return 869 self. config.name = response870 871 # attempt to insert new config, if it already exists then carry on with update872 sql = "INSERT INTO config (name) VALUES ('" + self.config.name + "')"876 self.skychunk.name = response 877 878 # attempt to insert new skychunk, if it already exists then carry on with update 879 sql = "INSERT INTO skychunk (name) VALUES ('" + self.skychunk.name + "')" 873 880 try: 874 881 self.execute(sql) 875 882 except: pass 876 883 877 # for each column in the configtable878 sql = "SHOW COLUMNS FROM config"884 # for each column in the skychunk table 885 sql = "SHOW COLUMNS FROM skychunk" 879 886 rs = self.executeQuery(sql) 880 887 while (rs.next()): … … 887 894 if field == 'timestamp': continue 888 895 if field == 'name': continue 896 if field == 'ingested_det': continue 897 if field == 'ingested_obj': continue 889 898 890 899 # get current value for this field, if any 891 900 try: 892 rs2 = self.executeQuery("SELECT " + field + " FROM config WHERE name = '" + self.config.name + "'")901 rs2 = self.executeQuery("SELECT " + field + " FROM skychunk WHERE name = '" + self.skychunk.name + "'") 893 902 rs2.first() 894 903 default = rs2.getString(1) … … 907 916 if type.find("varchar") != -1 or type.find("timestamp") != -1: quotes = "'" 908 917 else: quotes = "" 909 self.execute("UPDATE config SET " + field + " = " + quotes + response + quotes + " WHERE name = '" + self.config.name + "'")918 self.execute("UPDATE skychunk SET " + field + " = " + quotes + response + quotes + " WHERE name = '" + self.skychunk.name + "'") 910 919 911 920 print " *" … … 913 922 914 923 ''' 915 Returns configfor this client916 ''' 917 def get ConfigForThisClient(self, host, pid):918 919 sql = "SELECT config\924 Returns skychunk for this client 925 ''' 926 def getSkychunkForThisClient(self, host, pid): 927 928 sql = "SELECT skychunk \ 920 929 FROM clients \ 921 930 WHERE host = '" + host + "' \ … … 925 934 rs = self.executeQuery(sql) 926 935 rs.first() 927 self. config.name = rs.getString(1)928 except: 929 self.logger.errorPair("No configset for", "%s (pid=%d)" % (host, pid))930 self. config.isLoaded = False936 self.skychunk.name = rs.getString(1) 937 except: 938 self.logger.errorPair("No skychunk set for", "%s (pid=%d)" % (host, pid)) 939 self.skychunk.isLoaded = False 931 940 return False 932 941 … … 934 943 935 944 ''' 936 Reads config from the database and populates Configobject937 ''' 938 def read Config(self, host, pid):939 940 # first get configdefined for this client941 if not self.get ConfigForThisClient(host, pid): return False942 943 # now load that config945 Reads skychunk from the database and populates Skychunk object 946 ''' 947 def readSkychunk(self, host, pid): 948 949 # first get skychunk defined for this client 950 if not self.getSkychunkForThisClient(host, pid): return False 951 952 # now load that skychunk 944 953 sql = "SELECT \ 945 954 datastore_product \ … … 964 973 ,queue_ST \ 965 974 ,queue_OB \ 966 FROM config \ 967 WHERE name = '" + self.config.name + "'" 968 969 self.config.batchTypes = [] 970 try: 971 rs = self.executeQuery(sql) 975 ,parallel \ 976 FROM skychunk \ 977 WHERE name = '" + self.skychunk.name + "'" 978 979 self.skychunk.batchTypes = [] 980 try: 981 rs = self.executeQuery(sql) 982 972 983 rs.first() 973 self. config.datastoreProduct = rs.getString(1)974 self. config.datastoreType = rs.getString(2)975 if rs.getInt(3) == 1: self. config.datastorePublishing = True976 else: self. config.datastorePublishing = False977 self. config.dvoLabel = rs.getString(4)984 self.skychunk.datastoreProduct = rs.getString(1) 985 self.skychunk.datastoreType = rs.getString(2) 986 if rs.getInt(3) == 1: self.skychunk.datastorePublishing = True 987 else: self.skychunk.datastorePublishing = False 988 self.skychunk.dvoLabel = rs.getString(4) 978 989 979 990 # if dvoLabel is null is can break queries, so set to something 980 if not self.config.dvoLabel: self.config.dvoLabel = "none" 981 self.config.dvoLocation = rs.getString(5) 982 self.config.minRa = rs.getDouble(6) 983 self.config.maxRa = rs.getDouble(7) 984 self.config.minDec = rs.getDouble(8) 985 self.config.maxDec = rs.getDouble(9) 986 987 self.config.boxSize = rs.getDouble(10) 988 self.config.halfBox = self.config.boxSize/2.0 989 self.config.boxSizeWithBorder = self.config.boxSize + (self.config.BORDER * 2) 990 991 self.config.basePath = rs.getString(11) 992 self.config.dataRelease = rs.getInt(12) 993 self.config.deleteLocal = rs.getInt(13) 994 self.config.deleteDatastore = rs.getInt(14) 995 self.config.deleteDxLayer = rs.getInt(15) 996 self.config.epoch = rs.getString(16) 997 self.config.survey = rs.getString(17) 998 self.config.pspsSurvey = rs.getString(18) 999 if rs.getInt(19) == 1: self.config.batchTypes.append("P2") 1000 if rs.getInt(20) == 1: self.config.batchTypes.append("ST") 1001 if rs.getInt(21) == 1: self.config.batchTypes.append("OB") 1002 self.config.force = False # TODO 1003 self.config.test = False # TODO 1004 self.config.isLoaded = True 1005 except: 1006 self.logger.errorPair("Could not read config with name", self.config.name) 1007 self.config.isLoaded = False 1008 1009 return self.config.isLoaded 991 if not self.skychunk.dvoLabel: self.skychunk.dvoLabel = "none" 992 self.skychunk.dvoLocation = rs.getString(5) 993 self.skychunk.minRa = rs.getDouble(6) 994 self.skychunk.maxRa = rs.getDouble(7) 995 self.skychunk.minDec = rs.getDouble(8) 996 self.skychunk.maxDec = rs.getDouble(9) 997 998 self.skychunk.boxSize = rs.getDouble(10) 999 self.skychunk.halfBox = self.skychunk.boxSize/2.0 1000 self.skychunk.boxSizeWithBorder = self.skychunk.boxSize + (self.skychunk.BORDER * 2) 1001 1002 self.skychunk.basePath = rs.getString(11) 1003 self.skychunk.dataRelease = rs.getInt(12) 1004 1005 self.skychunk.deleteLocal = rs.getInt(13) 1006 self.skychunk.deleteDatastore = rs.getInt(14) 1007 self.skychunk.deleteDxLayer = rs.getInt(15) 1008 1009 self.skychunk.epoch = rs.getString(16) 1010 1011 self.skychunk.survey = rs.getString(17) 1012 self.skychunk.pspsSurvey = rs.getString(18) 1013 1014 if rs.getInt(19) == 1: self.skychunk.batchTypes.append("P2") 1015 if rs.getInt(20) == 1: self.skychunk.batchTypes.append("ST") 1016 if rs.getInt(21) == 1: self.skychunk.batchTypes.append("OB") 1017 1018 self.skychunk.force = True # TODO 1019 self.skychunk.parallel = False # TODO 1020 1021 if rs.getInt(22) == 1: self.skychunk.parallel = True 1022 1023 if self.skychunk.parallel: print "USING parallel" 1024 self.skychunk.isLoaded = True 1025 except: 1026 self.logger.errorPair("Could not read skychunk with name", self.skychunk.name) 1027 self.skychunk.isLoaded = False 1028 1029 return self.skychunk.isLoaded 1010 1030 1011 1031 ''' … … 1015 1035 1016 1036 sql = "SELECT id FROM box \ 1017 WHERE config = '" + self.config.name + "' \1037 WHERE skychunk = '" + self.skychunk.name + "' \ 1018 1038 AND ra_center = " + str(ra) + " \ 1019 1039 AND dec_center = " + str(dec) + " \ 1020 AND box_side = " + str(self. config.boxSize)1040 AND box_side = " + str(self.skychunk.boxSize) 1021 1041 1022 1042 id = -1 … … 1034 1054 ''' 1035 1055 def removeAllBoxes(self): 1036 self.execute("DELETE FROM box WHERE config = '" + self.config.name + "'")1056 self.execute("DELETE FROM box WHERE skychunk = '" + self.skychunk.name + "'") 1037 1057 1038 1058 ''' … … 1047 1067 1048 1068 sql = "INSERT INTO box \ 1049 ( config, ra_center, dec_center, box_side) \1069 (skychunk, ra_center, dec_center, box_side) \ 1050 1070 VALUES \ 1051 ('" + self. config.name + "', " + str(ra) + ", " + str(dec) + ", " + str(self.config.boxSize) + ")"1071 ('" + self.skychunk.name + "', " + str(ra) + ", " + str(dec) + ", " + str(self.skychunk.boxSize) + ")" 1052 1072 1053 1073 self.execute(sql) … … 1055 1075 1056 1076 return id 1077 1078 ''' 1079 Inserts new box into box table. If it already exisits, it returns existing box id 1080 ''' 1081 def isBoxIngested(self, id): 1082 1083 # set the field 'ingested' to 1 for this box 1084 sql = "select ingested from box where id = " + str(id) 1085 try: 1086 rs = self.executeQuery(sql) 1087 if not rs.next(): 1088 print "no matching boxes for ", str(id) 1089 raise 1090 status = rs.getInt(1) 1091 except: 1092 print "failed to set box ", str(id), "as ingested" 1093 raise 1094 1095 return status 1096 ''' 1097 Inserts new box into box table. If it already exisits, it returns existing box id 1098 ''' 1099 def setIngestedBox(self, id): 1100 1101 # set the field 'ingested' to 1 for this box 1102 sql = "update box set ingested = 1 where id = " + str(id) 1103 try: 1104 self.execute(sql) 1105 except: 1106 print "failed to set box ", str(id), "as ingested" 1107 raise 1108 1109 ''' 1110 Inserts new box into box table. If it already exisits, it returns existing box id 1111 ''' 1112 def clearIngestedBoxes(self): 1113 1114 # set the field 'ingested' to 1 for this box 1115 sql = "update box set ingested = 0" 1116 try: 1117 self.execute(sql) 1118 except: 1119 print "failed to clear boxes as ingested" 1120 raise 1057 1121 1058 1122 ''' … … 1088 1152 FROM box \ 1089 1153 JOIN pending ON (id = box_id) \ 1090 WHERE config = '" + self.config.name + "' \1154 WHERE skychunk = '" + self.skychunk.name + "' \ 1091 1155 AND batch_type = '" + batchType + "' \ 1092 1156 AND ra_center NOT IN \ 1093 1157 (SELECT ra_center \ 1094 1158 FROM stripe \ 1095 WHERE config = '" + self.config.name + "') \1159 WHERE skychunk = '" + self.skychunk.name + "') \ 1096 1160 GROUP BY ra_center LIMIT 1" 1161 1162 # XXX print "sql: ", sql 1097 1163 1098 1164 try: … … 1106 1172 FROM box \ 1107 1173 JOIN pending ON (id = box_id) \ 1108 WHERE config = '" + self.config.name + "' \1174 WHERE skychunk = '" + self.skychunk.name + "' \ 1109 1175 AND batch_type = '" + batchType + "' \ 1110 1176 GROUP BY ra_center \ … … 1126 1192 WHERE ra_center = " + str(raCenter) + " \ 1127 1193 AND batch_type = '" + batchType + "' \ 1128 AND config = '" + self.config.name + "' \1194 AND skychunk = '" + self.skychunk.name + "' \ 1129 1195 ORDER BY dec_center DESC" 1130 1196 … … 1159 1225 # now insert new stripe entry 1160 1226 sql = "INSERT INTO stripe \ 1161 (client_id, config, ra_center) \1162 SELECT clients.id, clients. config, " + str(raCenter) + " \1227 (client_id, skychunk, ra_center) \ 1228 SELECT clients.id, clients.skychunk, " + str(raCenter) + " \ 1163 1229 FROM clients \ 1164 1230 WHERE host = '" + host + "' \ … … 1188 1254 1189 1255 ''' 1190 Returns ids for pending items for this config1256 Returns ids for pending items for this skychunk 1191 1257 ''' 1192 1258 def getPendingIds(self, batchType): … … 1195 1261 FROM pending \ 1196 1262 JOIN box ON (box_id = id) \ 1197 WHERE config = '" + self.config.name + "' \1263 WHERE skychunk = '" + self.skychunk.name + "' \ 1198 1264 AND batch_type = '" + batchType + "'" 1199 1265 … … 1204 1270 rs.close() 1205 1271 except: 1206 self.logger.errorPair("Can't get pending ids for this config", sql)1272 self.logger.errorPair("Can't get pending ids for this skychunk", sql) 1207 1273 1208 1274 return ids … … 1235 1301 WHERE stage_id = " + str(stageID) + " \ 1236 1302 AND batch_type = '" + batchType + "' \ 1237 AND config = '" + self.config.name + "'"1303 AND skychunk = '" + self.skychunk.name + "'" 1238 1304 1239 1305 self.execute(sql) 1240 1306 1241 1307 ''' 1242 Writes density-plot data to file for pending stuff over sky for given config1308 Writes density-plot data to file for pending stuff over sky for given skychunk 1243 1309 ''' 1244 1310 def createPendingDensityPlotData(self, batchType, DATFILE): … … 1246 1312 sql = "SELECT id, ra_center, dec_center \ 1247 1313 FROM box \ 1248 WHERE config = '" + self.config.name + "' \1314 WHERE skychunk = '" + self.skychunk.name + "' \ 1249 1315 ORDER BY ra_center, dec_center" 1250 1316 … … 1299 1365 def getItemsInThisThisBox(self, ra, dec): 1300 1366 1301 halfSide = self. config.boxSize/2.01367 halfSide = self.skychunk.boxSize/2.0 1302 1368 minRa = ra-halfSide 1303 1369 maxRa = ra+halfSide … … 1328 1394 FROM stripe \ 1329 1395 JOIN clients ON (client_id = id) \ 1330 WHERE clients. config = '" + self.config.name + "' \1396 WHERE clients.skychunk = '" + self.skychunk.name + "' \ 1331 1397 ORDER BY host, started" 1332 1398
Note:
See TracChangeset
for help on using the changeset viewer.
