Changeset 39922
- Timestamp:
- Jan 6, 2017, 11:16:30 AM (10 years ago)
- Location:
- branches/czw_branch/20160809/ippToPsps
- Files:
-
- 19 edited
- 3 copied
-
config/Makefile.am (modified) (1 diff)
-
config/changes.txt (modified) (1 diff)
-
config/ippToPspsDbSchema.sql (modified) (2 diffs)
-
config/schema_browser.vot (modified) (1 diff)
-
config/settings.xml (modified) (1 diff)
-
config/tables.GO.vot (copied) (copied from trunk/ippToPsps/config/tables.GO.vot )
-
jython/Makefile.am (modified) (2 diffs)
-
jython/batch.py (modified) (1 diff)
-
jython/cleanup.py (modified) (1 diff)
-
jython/dvo.py (modified) (1 diff)
-
jython/dvogaiaobjects.py (copied) (copied from trunk/ippToPsps/jython/dvogaiaobjects.py )
-
jython/fits.py (modified) (1 diff)
-
jython/gaiaobjectbatch.py (copied) (copied from trunk/ippToPsps/jython/gaiaobjectbatch.py )
-
jython/gpc1db.py (modified) (1 diff)
-
jython/insert.dvodb.info.py (modified) (1 diff)
-
jython/ipptopspsdb.py (modified) (4 diffs)
-
jython/loader.py (modified) (2 diffs)
-
jython/metrics.py (modified) (4 diffs)
-
jython/plotter.py (modified) (1 diff)
-
jython/pollOdm.py (modified) (2 diffs)
-
jython/queue.py (modified) (1 diff)
-
jython/stackbatch.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20160809/ippToPsps/config/Makefile.am
r39010 r39922 10 10 tables.FO.vot \ 11 11 tables.FG.vot \ 12 tables.GO.vot \ 12 13 settings.xml 13 14 -
branches/czw_branch/20160809/ippToPsps/config/changes.txt
r36201 r39922 9 9 10 10 -- not yet alter table batch add column smf_version varchar(16) after comment; 11 12 alter table skychunk add column queue_FG tinyint after queue_FO; 13 alter table skychunk add column queue_GO tinyint after queue_FG; 14 15 alter table skychunk change column queue_FG queue_FG tinyint(1); 16 alter table skychunk change column queue_GO queue_GO tinyint(1); 17 alter table skychunk change column queue_GO queue_GO tinyint(1) default 0; 18 alter table skychunk change column queue_FO queue_FO tinyint(1) default 0; 19 alter table skychunk change column queue_FG queue_FG tinyint(1) default 0; -
branches/czw_branch/20160809/ippToPsps/config/ippToPspsDbSchema.sql
r38823 r39922 111 111 `queue_FW` tinyint(1) default '0', 112 112 `queue_FO` tinyint(1) default '0', 113 `queue_FG` tinyint(1) default '0', 114 `queue_GO` tinyint(1) default '0', 113 115 `active` tinyint(1) default '1', 114 116 `parallel` tinyint(1) default '0', … … 217 219 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 218 220 SET character_set_client = @saved_cs_client; 221 -- 222 -- Table structure for table `forcedgalobject` 223 -- 224 DROP TABLE IF EXISTS `forcedgalobject`; 225 SET @saved_cs_client = @@character_set_client; 226 SET character_set_client = utf8; 227 CREATE TABLE `forcedgalobject` ( 228 `batch_id` bigint(20) unsigned NOT NULL, 229 `region` varchar(50) default NULL, 230 KEY `batch_id` (`batch_id`), 231 CONSTRAINT `forcedgalobject_fk_1` FOREIGN KEY (`batch_id`) REFERENCES `batch` (`batch_id`) 232 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 233 SET character_set_client = @saved_cs_client; 234 235 236 237 -- 238 -- Table structure for table `gaiaobject` 239 -- 240 DROP TABLE IF EXISTS `gaiaobject`; 241 SET @saved_cs_client = @@character_set_client; 242 SET character_set_client = utf8; 243 CREATE TABLE `gaiaobject` ( 244 `batch_id` bigint(20) unsigned NOT NULL, 245 `region` varchar(50) default NULL, 246 KEY `batch_id` (`batch_id`), 247 CONSTRAINT `gaiaobject_fk_1` FOREIGN KEY (`batch_id`) REFERENCES `batch` (`batch_id`) 248 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 249 SET character_set_client = @saved_cs_client; 250 219 251 220 252 -- -
branches/czw_branch/20160809/ippToPsps/config/schema_browser.vot
r39210 r39922 171 171 <RESOURCE name="Derived Data Products"> 172 172 <DESCRIPTION>These tables contain values that are derived from the fundamantal data products.</DESCRIPTION> 173 <TABLE name="GaiaFrameCoordinate"> </TABLE> 174 173 175 <TABLE name="pcsAnnZ"> </TABLE> 174 176 <TABLE name="pcsPhotoZ"> </TABLE> -
branches/czw_branch/20160809/ippToPsps/config/settings.xml
r39644 r39922 819 819 <!-- ippToPsps Db section (REAL version) --> 820 820 <ipptopspsdatabase> 821 <name>ipptopsps 2</name>821 <name>ipptopsps3</name> 822 822 <host>ipp006</host> 823 823 <user>dvo</user> -
branches/czw_branch/20160809/ippToPsps/jython/Makefile.am
r39007 r39922 19 19 dvoforcedgalaxy.py \ 20 20 dvoobjects.py \ 21 dvogaiaobjects.py \ 21 22 dvo.py \ 22 23 dxlayer.py \ … … 25 26 forcedwarpbatch.py \ 26 27 forcedgalaxybatch.py \ 28 gaiaobjectbatch.py \ 27 29 gpc1db.py \ 28 30 initbatch.py \ -
branches/czw_branch/20160809/ippToPsps/jython/batch.py
r39315 r39922 700 700 # for OB, this imports object data from DVO 701 701 if not self.importIppTables(): 702 if (self.batchType == "OB" or self.batchType =="DO" or self.batchType =="FO" or self.batchType =="FG" ):702 if (self.batchType == "OB" or self.batchType =="DO" or self.batchType =="FO" or self.batchType =="FG" or self.batchType =="GO"): 703 703 self.logger.errorPair("skipping this batch", "no dvo tables for this region") 704 704 self.ippToPspsDb.updateProcessed(self.batchID, 1) -
branches/czw_branch/20160809/ippToPsps/jython/cleanup.py
r39154 r39922 51 51 self.clean("FO") 52 52 self.clean("FG") 53 self.clean("GO") 53 54 54 55 self.checkClientStatus() -
branches/czw_branch/20160809/ippToPsps/jython/dvo.py
r39467 r39922 152 152 self.scratchDb.execute("ALTER TABLE " + self.scratchDb.dvoImagesTable + " ADD PRIMARY KEY (IMAGE_ID, EXTERN_ID)") 153 153 154 self.scratchDb.execute("CREATE INDEX externID_index ON dvoImagesFull (EXTERN_ID)") 154 155 self.scratchDb.setImportedThisDvoTable(path) 155 156 return True -
branches/czw_branch/20160809/ippToPsps/jython/fits.py
r39719 r39922 147 147 148 148 if False: 149 self.logger.infoPair("running findAndReadHeaderRaw",name) 149 150 status = self.findAndReadHeaderRaw(name, VERBOSE) 150 151 return status 151 152 self.logger.infoPair("running findAndReadHeaderOhana",name) 152 153 status = self.findAndReadHeaderOhana(name, VERBOSE) 153 154 return status -
branches/czw_branch/20160809/ippToPsps/jython/gpc1db.py
r39544 r39922 659 659 660 660 661 ''' 662 Gets the exp_id from teh exp_name 663 ''' 664 def getExpIdFromExpName(self, expName): 665 sql = "SELECT exp_id from rawExp where exp_name = '"+expName+"'" 666 try: 667 rs = self.executeQuery(sql) 668 except: 669 self.logger.infoPair("failed sql:",sql) 670 self.logger.exception("Can't query for imageIDs") 671 672 673 expIDs = [] 674 while (rs.next()): 675 expIDs.append(rs.getString(1)) 676 rs.close() 677 expID = expIDs[0] 678 return expID 679 680 681 682 661 683 662 684 ''' -
branches/czw_branch/20160809/ippToPsps/jython/insert.dvodb.info.py
r38884 r39922 83 83 # XXX : need to fix 'dvo.setSkyArea' or this may not return the full list for a parallel dvo 84 84 #for object-like batches, info comes from dvo 85 if (batchType == "OB" or batchType =="DO" or batchType =="FO" ):85 if (batchType == "OB" or batchType =="DO" or batchType =="FO" or batchType == "FG" or batchType == "GO"): 86 86 self.dvoObjects.setSkyArea( 87 87 self.skychunk.minRa, -
branches/czw_branch/20160809/ippToPsps/jython/ipptopspsdb.py
r39158 r39922 819 819 820 820 sql = "INSERT INTO diffobject ( \ 821 batch_id \ 822 ,region \ 823 ) VALUES ( \ 824 " + str(batchID) + " \ 825 ,'" + region + "' \ 826 )" 827 828 self.execute(sql) 829 830 ''' 831 Inserts some gaiaobject metadata for this batch ID 832 ''' 833 def insertGaiaObjectMeta(self, batchID, region): 834 835 sql = "INSERT INTO gaiaobject ( \ 821 836 batch_id \ 822 837 ,region \ … … 1104 1119 ,queue_FW \ 1105 1120 ,queue_FO \ 1121 ,queue_FG \ 1122 ,queue_GO \ 1106 1123 ,parallel \ 1107 1124 ,P2_smf_version \ … … 1177 1194 if rs.getInt(23) == 1: self.skychunk.batchTypes.append("DO") 1178 1195 if rs.getInt(24) == 1: self.skychunk.batchTypes.append("FW") 1179 if rs.getInt(25) == 1: self.skychunk.batchTypes.append("FG") 1196 ### if rs.getInt(25) == 1: self.skychunk.batchTypes.append("FG") fix this when P2 is done 1180 1197 if rs.getInt(25) == 1: self.skychunk.batchTypes.append("FO") 1198 if rs.getInt(26) == 1: self.skychunk.batchTypes.append("FG") 1199 if rs.getInt(27) == 1: self.skychunk.batchTypes.append("GO") 1200 1181 1201 1182 1202 self.skychunk.force = True # TODO 1183 1203 self.skychunk.parallel = False # TODO 1184 1204 1185 if rs.getInt(2 6) == 1: self.skychunk.parallel = True1186 self.skychunk.P2_smf_version = rs.getString(2 7)1205 if rs.getInt(28) == 1: self.skychunk.parallel = True 1206 self.skychunk.P2_smf_version = rs.getString(29) 1187 1207 # options: "use_new", "not_reproc", "use_original" 1188 1208 1189 self.skychunk.ST_cmf_version = rs.getString( 28)1209 self.skychunk.ST_cmf_version = rs.getString(30) 1190 1210 # options: not used? 1191 1211 … … 1212 1232 # print "typename: " + rsmd.getColumnTypeName(16) 1213 1233 1214 self.skychunk.trange_start = rs.getString( 29)1234 self.skychunk.trange_start = rs.getString(31) 1215 1235 # options: "YYYY-MM-DD,HH:MM:SS" or "0000-00-00 00:00:00" 1216 1236 1217 self.skychunk.trange_end = rs.getString(3 0)1237 self.skychunk.trange_end = rs.getString(32) 1218 1238 # options: "YYYY-MM-DD,HH:MM:SS" or "0000-00-00 00:00:00" 1219 1239 -
branches/czw_branch/20160809/ippToPsps/jython/loader.py
r39507 r39922 30 30 from forcedobjectbatch import ForcedObjectBatch 31 31 from forcedgalaxybatch import ForcedGalaxyBatch 32 from gaiaobjectbatch import GaiaObjectBatch 33 32 34 # 33 35 # … … 302 304 id, 303 305 batchID) 306 elif batchType == "GO": 307 batch = GaiaObjectBatch(self.logger, 308 self.config, 309 self.skychunk, 310 self.gpc1Db, 311 self.ippToPspsDb, 312 self.scratchDb, 313 id, 314 batchID) 304 315 305 316 batch.run() -
branches/czw_branch/20160809/ippToPsps/jython/metrics.py
r38969 r39922 53 53 rateFO = self.printStats("FO") 54 54 rateFG = self.printStats("FG") 55 rateGO = self.printStats("GO") 55 56 self.logger.info("+----+------------------+---------------+-------------------+------------------+----------------+") 56 57 … … 76 77 pendFOProcessed = self.printTableRow(stages, "FO") 77 78 pendFGProcessed = self.printTableRow(stages, "FG") 79 pendGOProcessed = self.printTableRow(stages, "GO") 78 80 self.writeTableSeparator(colCount) 79 81 … … 93 95 try: self.logger.infoPair("Estimated time for FOs", "%.1f hours" % (pendFOProcessed / rateFO)) 94 96 except: pass 95 try: self.logger.infoPair("Estimated time for FGs", "%.1f hours" % (pendFGProcessed / rateFG)) 97 try: self.logger.infoPair("Estimated time for FGs", "%.1f hours" % (pendFGProcessed / rateFG)) 98 try: self.logger.infoPair("Estimated time for GOs", "%.1f hours" % (pendGOProcessed / rateGO)) 96 99 except: pass 97 100 … … 107 110 self.plot.createDensityPlot("FO", True) 108 111 self.plot.createDensityPlot("FG", True) 112 self.plot.createDensityPlot("GO", True) 113 109 114 # some clean-up before going to sleep 110 115 self.ippToPspsDb.purgeDeadClients() -
branches/czw_branch/20160809/ippToPsps/jython/plotter.py
r36697 r39922 32 32 self.plot.createDensityPlot("FW") 33 33 self.plot.createDensityPlot("FO") 34 self.plot.createDensityPlot("FG") 35 self.plot.createDensityPlot("GO") 36 34 37 35 38 ''' -
branches/czw_branch/20160809/ippToPsps/jython/pollOdm.py
r38969 r39922 42 42 else: self.stages = [self.STAGE] 43 43 44 if self.BATCHTYPE == "all": self.batchTypes = ['IN', 'P2', 'ST', 'OB', 'DF', 'DO', 'FW', 'FO', 'FG' ]44 if self.BATCHTYPE == "all": self.batchTypes = ['IN', 'P2', 'ST', 'OB', 'DF', 'DO', 'FW', 'FO', 'FG', 'GO'] 45 45 else: self.batchTypes = [self.BATCHTYPE] 46 46 … … 126 126 ''' 127 127 def printUsage(self): 128 super(PollOdm, self).printUsage("<IN|P2|ST|OB|DF|DO|FW|FO|FG| all> <unloaded|unmergeworthy|unmerged|all> [hours]")128 super(PollOdm, self).printUsage("<IN|P2|ST|OB|DF|DO|FW|FO|FG|GO|all> <unloaded|unmergeworthy|unmerged|all> [hours]") 129 129 130 130 -
branches/czw_branch/20160809/ippToPsps/jython/queue.py
r39159 r39922 73 73 74 74 # for object-like batches, info comes from dvo 75 if (batchType == "OB" or batchType =="DO" or batchType =="FO" or batchType == "FG" ):75 if (batchType == "OB" or batchType =="DO" or batchType =="FO" or batchType == "FG" or batchType == "GO"): 76 76 self.dvoObjects.setSkyArea( 77 77 self.skychunk.minRa, -
branches/czw_branch/20160809/ippToPsps/jython/stackbatch.py
r39649 r39922 129 129 self.zpImage[filter] = self.getKeyFloat(header, "%.8f", 'ZPT_OBS') 130 130 self.zpError[filter] = self.getKeyFloat(header, "%.8f", 'ZPT_ERR') 131 132 deteffHeader = self.fits[filter].findAndReadHeader("SkyChip.deteff", self.config.test) 133 if not deteffHeader: 134 if self.config.test: self.logger.errorPair("No header found for Skychip.deteff for", filter) 135 return False 136 137 self.magref[filter] = self.getKeyFloat(deteffHeader, "%.8f", 'DETEFF.MAGREF') 138 self.nInjected[filter] = int(self.getKeyInt(deteffHeader, 0, 'DETEFF.NUM')) 131 hasdeteff = 1 132 try: deteffHeader = self.fits[filter].findAndReadHeader("SkyChip.deteff", self.config.test) 133 except: 134 hasdeteff = 0 135 #if not deteffHeader: 136 # if self.config.test: self.logger.errorPair("No header found for Skychip.deteff for", filter) 137 # return False 138 139 if hasdeteff == 1: 140 self.magref[filter] = self.getKeyFloat(deteffHeader, "%.8f", 'DETEFF.MAGREF') 141 self.nInjected[filter] = int(self.getKeyInt(deteffHeader, 0, 'DETEFF.NUM')) 139 142 140 143 ## MEH -- md5sum test … … 733 736 # sersic fit has an extra parameter 734 737 if (ippModelType == "PS_MODEL_SERSIC"): 735 sqlLine.group("a." + filter + model + "Nu", "1 / (2.0 * b.EXT_PAR_07)") 736 sqlLine.group("a." + filter + model + "NuErr", "'0.1'") # this is not measured at the moment 738 testSQL = 'show columns FROM rSkyChip_xfit LIKE "EXT_PAR_07"' 739 have_ext_par_07 = 1 740 try: 741 rs = self.scratchDb.execute(sql) 742 except: 743 have_ext_par_07 = 0 744 if have_ext_par_07 == 1: 745 sqlLine.group("a." + filter + model + "Nu", "1 / (2.0 * b.EXT_PAR_07)") 746 sqlLine.group("a." + filter + model + "NuErr", "'0.1'") # this is not measured at the moment 747 748 ### I think, if ippModelType = PS_MODEL_SERSIC, and EXT_PAR_07 does not exist, then Nu, Nerr = null 749 737 750 738 751 # missing these two fields? … … 1170 1183 # search the words for the o....g....o part 1171 1184 for j in range(len(words)): 1172 match = re.search('o\d\d\d\dg\d\d\d\d\o', words[j]) 1173 if (match != None): 1185 match1 = re.search('^\d\d\d\dg\d\d\d\d\o', words[j]) #remove leading o: then ones with borked no os and cs will work now 1186 match2 = re.search('\o\d\d\d\dg\d\d\d\d\o', words[j]) #remove leading o: then ones with borked no os and cs will work now 1187 match3 = re.search('\c\d\d\d\dg\d\d\d\d\o', words[j]) #remove leading o: then ones with borked no os and cs will work now 1188 if (match1 != None): 1174 1189 ogo=j 1190 ogoname = 'o'+words[ogo] 1191 break 1192 if (match2 != None): 1193 ogo=j 1194 ogoname = words[ogo] 1195 break 1196 if (match3 != None): 1197 ogo=j 1198 ogoname = words[ogo] 1175 1199 break 1176 1200 # did we find it? if so, are there are least 2 more elements past the ogo? … … 1178 1202 1179 1203 if ogo > -1: 1180 if (ogo + 1) < len(words):1204 if (ogo +2) < len(words): #this was the mistake before 1181 1205 # there is a o....g....o element, and the next 2 exist 1182 1206 frameID = words[ogo+1] 1183 1207 1184 else: 1185 self.logger.infoPair("unable to find exp_id from", inputName) 1186 raise 1208 else: 1209 #ogoname = "o"+words[ogo] 1210 try: frameID = self.gpc1Db.getExpIdFromExpName(ogoname) 1211 except: 1212 self.logger.error("cant get expid") 1213 raise 1214 1215 # frameID = str(rs.getInt(1)) 1216 1217 # self.logger.infoPair("unable to find exp_id from", inputName) 1218 # raise 1187 1219 # and then raise an error and stop the program. I expect this to mostly work fine 1188 1220 # for the extra long label (?) - can probably get it from just the o g o (if exp_id … … 1216 1248 1217 1249 self.tablesToExport.append("StackToFrame") 1250 return True 1218 1251 1219 1252 ''' … … 1496 1529 if self.stackIDs[filter] > 0: 1497 1530 self.populateStackMeta(filter) 1498 1531 1499 1532 self.populateStackObjectThin() 1500 1533 … … 1529 1562 self.logger.infoPair("populating","StackToImage") 1530 1563 self.populateStackToImage() 1531 1564 1565 1566 1532 1567 self.logger.infoPair("populating","StackToFrame") 1533 self.populateStackToFrame() 1534 1568 1569 # self.populateStackToFrame() 1570 if not self.populateStackToFrame(): 1571 self.logger.errorPair("can't populate"," stack to frame") 1572 return False 1573 self.logger.infoPair("removing frameID"," duplicates") 1574 self.scratchDb.execute("ALTER IGNORE TABLE StackToFrame ADD UNIQUE INDEX(frameID)") 1575 1535 1576 self.setMinMaxObjID(["StackObjectThin"]) 1536 1577
Note:
See TracChangeset
for help on using the changeset viewer.
