- Timestamp:
- Jan 11, 2012, 11:19:21 PM (15 years ago)
- Location:
- branches/meh_branches/ppsub_test
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippToPsps/jython/gpc1db.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppsub_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppsub_test/ippToPsps/jython/gpc1db.py
r32018 r33098 32 32 33 33 ''' 34 TODO 35 ''' 36 def getIDsInThisDVODbForThisStageFudge(self): 37 38 sql = "SELECT staticskyRun.sky_id \ 39 FROM staticskyInput, staticskyRun, stackRun, staticskyResult \ 40 WHERE staticskyRun.sky_id = staticskyInput.sky_id \ 41 AND staticskyInput.stack_id = stackRun.stack_id \ 42 AND staticskyInput.sky_id = staticskyResult.sky_id \ 43 AND staticskyRun.label like 'MD04.staticsky' \ 44 AND stackRun.filter like 'i%'" 45 46 try: 47 rs = self.executeQuery(sql) 48 except: 49 self.logger.exception("Can't query for ids in DVO") 50 51 ids = [] 52 while (rs.next()): 53 ids.append(rs.getInt(1)) 54 55 rs.close() 56 57 self.logger.debug("Found %d items in DVO database '" % (len(ids))) 58 59 return ids 60 61 ''' 62 Gets a list of ids in this DVO database for this stage, could be cam or staticsky (so far) 63 ''' 64 def getIDsInThisDVODbForThisStage(self, dvoDb, batchType): 34 Gets a list of ids in this DVO database for this stage, could be cam or staticsky, and a box can be defined with equatorial coordinates 35 ''' 36 def getIDsInThisDVODbForThisStage(self, dvoDb, batchType, minRA=-999, maxRA=999, minDec=-999, maxDec=999): 65 37 66 38 if batchType == "P2": # TODO define these someplace … … 71 43 JOIN minidvodbRun USING(minidvodb_name) \ 72 44 JOIN minidvodbProcessed USING(minidvodb_id) \ 45 JOIN camRun ON (stage_id = cam_id) \ 46 JOIN chipRun USING (chip_id) \ 47 JOIN rawExp USING (exp_id) \ 73 48 WHERE minidvodbRun.minidvodb_group = '" + dvoDb + "' \ 74 49 AND minidvodbRun.state = 'merged' \ 75 50 AND minidvodbProcessed.fault = 0 \ 76 51 AND addRun.stage = '" + stage + "' \ 77 AND addRun.state = 'full'" 52 AND addRun.state = 'full' \ 53 AND decl BETWEEN RADIANS(" + str(minDec) + ") AND RADIANS(" + str(maxDec) + ") \ 54 AND ra BETWEEN RADIANS(" + str(minRA) + ") AND RADIANS(" + str(maxRA) + ")" 78 55 79 56 elif batchType == "ST": 80 57 81 58 stage = "staticsky" 82 sql = "SELECT DISTINCT stack_id \ 83 FROM staticskyInput \ 59 sql = "SELECT DISTINCT stack_id FROM staticskyInput \ 84 60 JOIN addRun ON(staticskyInput.sky_id = addRun.stage_id) \ 85 61 JOIN minidvodbRun USING(minidvodb_name) \ … … 90 66 AND addRun.stage = '" + stage + "' \ 91 67 AND addRun.state = 'full'" 92 68 93 69 try: 94 70 rs = self.executeQuery(sql) … … 154 130 rs = self.executeQuery(sql) 155 131 rs.first() 132 except: 133 self.logger.errorPair("Can't query for", "stack meta data") 134 135 try: 156 136 meta.append(rs.getString(1)) 157 137 meta.append(rs.getString(2)) 158 138 meta.append(rs.getString(3)) 159 139 except: 160 self.logger.e xception("Can't query for stack meta")161 140 self.logger.errorPair("getStackStageMeta()", "empty meta data") 141 162 142 return meta 163 143 … … 178 158 rs = self.executeQuery(sql) 179 159 rs.first() 160 except: 161 self.logger.errorPair("Can't query for", "camera meta data") 162 163 try: 180 164 meta.append(rs.getInt(1)) 181 165 meta.append(rs.getString(2)) … … 185 169 meta.append(rs.getString(6)) 186 170 except: 187 self.logger.e xception("Can't query for camera meta")171 self.logger.errorPair("getCameraStageMeta()", "empty meta data") 188 172 189 173 return meta … … 205 189 rs.first() 206 190 except: 207 self.logger.exception("Can't query for camera smfs") 208 191 self.logger.errorPair("Can't query for smf file for cam_id", str(camID)) 192 return None 193 194 try: 209 195 # get path to base dir of cmf files 210 path = rs.getString(1) 211 path = path[0:path.rfind("/")] 196 path = rs.getString(1) 197 path = path[0:path.rfind("/")] 198 except: 199 self.logger.errorPair("No smf files found for cam_id", str(camID) ) 200 return None 212 201 213 202 # list all smf files if a neb path
Note:
See TracChangeset
for help on using the changeset viewer.
