Changeset 33760 for trunk/ippToPsps
- Timestamp:
- Apr 11, 2012, 11:56:08 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/objectbatch.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/objectbatch.py
r33746 r33760 78 78 def alterPspsTables(self): 79 79 80 # index objID column 80 81 self.scratchDb.makeColumnUnique("Object", "objID") 81 82 83 # dec is reserved in MySQL, so STILTS replaces if with dec_, which PSPS doesn't like. so, force it back again 84 self.scratchDb.execute("ALTER TABLE Object CHANGE dec_ `dec` double") 85 82 86 return True 83 87 … … 97 101 98 102 # list of all filters we are interested in 99 allFilters = ['g', 'r', 'i', 'z', 'y' ]103 allFilters = ['g', 'r', 'i', 'z', 'y', ] 100 104 101 105 # this loop looks into the DVO Photcodes tables and gets the 'CODE' for each the filters above that are listed … … 148 152 self.logger.errorPair("Couldn't calculate colors", sql) 149 153 150 151 ''' 152 Does the processing, i.e. pulling stuff from IPP tables into PSPS tables 153 ''' 154 def populatePspsTables(self): 154 ''' 155 Populates the Object table 156 ''' 157 def populateObjectTable(self): 155 158 156 159 cptTableName = self.scratchDb.getDbFriendlyTableName(self.region + ".cpt") 157 160 cpsTableName = self.scratchDb.getDbFriendlyTableName(self.region + ".cps") 158 161 159 self.logger.infoPair("Inserting objects from", "cpt") 162 self.logger.infoPair("Populating", "ObjectCalColor") 163 self.logger.infoPair("Inserting objects from", "cpt file") 160 164 sql = "INSERT IGNORE INTO Object (\ 161 165 objID \ … … 164 168 ,surveyID \ 165 169 ,ra \ 166 , dec_\170 ,`dec` \ 167 171 ,raErr \ 168 172 ,decErr \ 169 173 ,nDetections \ 174 ,dataRelease \ 170 175 ) \ 171 176 SELECT \ … … 179 184 ,DEC_ERR \ 180 185 ,NMEASURE \ 186 , " + str(self.config.dataRelease) + "\ 181 187 FROM " + cptTableName 182 188 … … 185 191 except: 186 192 self.logger.errorPair("Couldn't populate Object table", sql) 193 return False 194 187 195 188 196 # add row count columns so we can perform joins to get colors … … 206 214 return True 207 215 216 ''' 217 Populates the ObjectCalColor table 218 ''' 219 def populateObjectCalColorTable(self): 220 221 self.logger.infoPair("Populating", "ObjectCalColor") 222 223 sql = "INSERT INTO ObjectCalColor ( \ 224 objID \ 225 ,ippObjID \ 226 ,dataRelease \ 227 ) \ 228 SELECT \ 229 objID \ 230 ,ippObjID \ 231 ,dataRelease \ 232 FROM Object" 233 try: 234 self.scratchDb.execute(sql) 235 except: 236 self.logger.errorPair("Couldn't populate ObjectCalColor table", sql) 237 return False 238 239 return True 240 241 ''' 242 Does the processing, i.e. pulling stuff from IPP tables into PSPS tables 243 ''' 244 def populatePspsTables(self): 245 246 if not self.populateObjectTable(): return False 247 #if not self.populateObjectCalColorTable(): return False 248 249 return True 250
Note:
See TracChangeset
for help on using the changeset viewer.
