Changeset 39764
- Timestamp:
- Oct 15, 2016, 10:01:32 AM (10 years ago)
- Location:
- trunk/ippToPsps/jython
- Files:
-
- 5 edited
-
dvo.py (modified) (1 diff)
-
fits.py (modified) (1 diff)
-
gpc1db.py (modified) (1 diff)
-
ipptopspsdb.py (modified) (1 diff)
-
stackbatch.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/dvo.py
r39467 r39764 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 -
trunk/ippToPsps/jython/fits.py
r39694 r39764 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 -
trunk/ippToPsps/jython/gpc1db.py
r39544 r39764 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 ''' -
trunk/ippToPsps/jython/ipptopspsdb.py
r39158 r39764 1177 1177 if rs.getInt(23) == 1: self.skychunk.batchTypes.append("DO") 1178 1178 if rs.getInt(24) == 1: self.skychunk.batchTypes.append("FW") 1179 if rs.getInt(25) == 1: self.skychunk.batchTypes.append("FG") 1179 ### if rs.getInt(25) == 1: self.skychunk.batchTypes.append("FG") fix this when P2 is done 1180 1180 if rs.getInt(25) == 1: self.skychunk.batchTypes.append("FO") 1181 1181 -
trunk/ippToPsps/jython/stackbatch.py
r39728 r39764 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 … … 1180 1183 # search the words for the o....g....o part 1181 1184 for j in range(len(words)): 1182 match = re.search('o\d\d\d\dg\d\d\d\d\o', words[j]) 1183 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): 1184 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] 1185 1199 break 1186 1200 # did we find it? if so, are there are least 2 more elements past the ogo? … … 1188 1202 1189 1203 if ogo > -1: 1190 if (ogo + 1) < len(words):1204 if (ogo +2) < len(words): #this was the mistake before 1191 1205 # there is a o....g....o element, and the next 2 exist 1192 1206 frameID = words[ogo+1] 1193 1207 1194 else: 1195 self.logger.infoPair("unable to find exp_id from", inputName) 1196 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 1197 1219 # and then raise an error and stop the program. I expect this to mostly work fine 1198 1220 # for the extra long label (?) - can probably get it from just the o g o (if exp_id … … 1226 1248 1227 1249 self.tablesToExport.append("StackToFrame") 1250 return True 1228 1251 1229 1252 ''' … … 1506 1529 if self.stackIDs[filter] > 0: 1507 1530 self.populateStackMeta(filter) 1508 1531 1509 1532 self.populateStackObjectThin() 1510 1533 … … 1539 1562 self.logger.infoPair("populating","StackToImage") 1540 1563 self.populateStackToImage() 1541 1564 1565 1566 1542 1567 self.logger.infoPair("populating","StackToFrame") 1543 self.populateStackToFrame() 1568 1569 # self.populateStackToFrame() 1570 if not self.populateStackToFrame(): 1571 self.logger.errorPair("can't populate"," stack to frame") 1572 return False 1544 1573 self.logger.infoPair("removing frameID"," duplicates") 1545 1574 self.scratchDb.execute("ALTER IGNORE TABLE StackToFrame ADD UNIQUE INDEX(frameID)")
Note:
See TracChangeset
for help on using the changeset viewer.
