- Timestamp:
- Nov 29, 2012, 2:15:01 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120905
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120905
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippToPsps
- Property svn:mergeinfo changed
/trunk/ippToPsps merged: 34615,34629-34631,34633,34638-34641,34649,34661,34723
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippToPsps/jython/objectbatch.py
r34466 r34735 114 114 for filter in filters: 115 115 116 sql = "UPDATE Object \ 117 JOIN " + cpsTable + " AS cps ON (cps.row = (Object.row*" + str(filterCount) + ")-(" + str(filterCount) + " - " + str(filter[0]) + ")) \ 116 filterID = self.scratchDb.getFilterID(filter[1]) 117 118 # NOTE: Manipulation of FLAGS from cpsTable is to move ID_SECF_OBJ_EXT flag (0x01000000) 119 # from bit 24 to bit 13 so that it fits into the SMALLINT Object.Flags 120 121 sql = "UPDATE Object JOIN \ 122 " + cpsTable + " AS cps ON (cps.row = (Object.row* " + str(filterCount) + ")-(" + str(filterCount) + " - " + str(filter[0]) + ")) \ 118 123 SET \ 119 124 n" + filter[1] + " = NCODE \ … … 122 127 ," + filter[1] + "MeanKronMag = MAG_KRON \ 123 128 ," + filter[1] + "MeanKronMagErr = MAG_KRON_ERR \ 124 ," + filter[1] + "StackPSF Flux = FLUX_PSF\125 ," + filter[1] + "StackPSF FluxErr = FLUX_PSF_ERR\129 ," + filter[1] + "StackPSFMag = -2.5 * log10(FLUX_PSF) + 8.9 \ 130 ," + filter[1] + "StackPSFMagErr = FLUX_PSF_ERR / FLUX_PSF \ 126 131 ," + filter[1] + "StackKronMag = -2.5 * log10(FLUX_KRON) + 8.9 \ 127 132 ," + filter[1] + "StackKronMagErr = FLUX_KRON_ERR / FLUX_KRON \ 128 133 ," + filter[1] + "20pct = MAG_20/1000 \ 129 134 ," + filter[1] + "80pct = MAG_80/1000 \ 130 ," + filter[1] + "Flags = FLAGS " 131 135 ," + filter[1] + "Flags = (0x7fff & FLAGS) | ((FLAGS >> 11) & 0x2000) \ 136 ," + filter[1] + "StackDetectID = STACK_DETECT_ID + " + str(filterID) 137 138 #self.logger.info(sql) 139 self.scratchDb.execute(sql) 140 141 self.logger.infoPair("Calculating nDetections from", "n[filters]") 142 for filter in filters: 143 # now do a sum of n[filters], but do not include the ones with -999 144 sql = "UPDATE Object \ 145 SET nDetections = nDetections + n" + filter[1] + " \ 146 WHERE n" + filter[1] + " != -999" 147 self.scratchDb.execute(sql) 132 148 133 self.scratchDb.execute(sql) 149 150 134 151 135 152 # now set to null all MeanMagErr values > 0.5 (cut set by Gene, 2012-04-12) … … 189 206 cpsTableName = self.scratchDb.getDbFriendlyTableName(self.region + ".cps") 190 207 191 self.logger.infoPair("Populating", "Object") 208 self.logger.infoPair("setting to null > 1e-38 and < 1e-38 in", "cps FLUX_KRON_ERR") 209 sql = "UPDATE " + cpsTableName + " set FLUX_KRON_ERR = NULL where FLUX_KRON_ERR < 1e-37 AND FLUX_KRON_ERR > -1e-37 " 210 211 try: 212 self.scratchDb.execute(sql) 213 except: 214 self.logger.errorPair("Couldn't squash out of range stuff", sql) 215 return False 216 217 self.logger.infoPair("setting to null > 1e-38 and < 1e-38 in", "cps FLUX_KRON") 218 sql = "UPDATE " + cpsTableName + " set FLUX_KRON = NULL where FLUX_KRON < 1e-37 AND FLUX_KRON > -1e-37 " 219 220 try: 221 self.scratchDb.execute(sql) 222 except: 223 self.logger.errorPair("Couldn't squash out of range stuff", sql) 224 return False 225 226 227 228 229 230 self.logger.infoPair("Populating", "Object s") 192 231 self.logger.infoPair("Inserting objects from", "cpt file") 193 232 … … 204 243 ,decErr \ 205 244 ,nDetections \ 206 , extra\245 ,qfPerfect \ 207 246 ,sgSep \ 208 247 ,dataRelease \
Note:
See TracChangeset
for help on using the changeset viewer.
