- Timestamp:
- Sep 14, 2012, 12:17:39 PM (14 years ago)
- Location:
- trunk/ippToPsps/jython
- Files:
-
- 3 edited
-
objectbatch.py (modified) (4 diffs)
-
scratchdb.py (modified) (1 diff)
-
stackbatch.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/objectbatch.py
r34290 r34441 124 124 ," + filter[1] + "StackPSFFlux = FLUX_PSF \ 125 125 ," + filter[1] + "StackPSFFluxErr = FLUX_PSF_ERR \ 126 ," + filter[1] + "StackKronMag = -2.5 * log10(FLUX_KRON) -8.9 \126 ," + filter[1] + "StackKronMag = -2.5 * log10(FLUX_KRON) + 8.9 \ 127 127 ," + filter[1] + "StackKronMagErr = FLUX_KRON_ERR / FLUX_KRON \ 128 128 ," + filter[1] + "20pct = MAG_20/1000 \ 129 129 ," + filter[1] + "80pct = MAG_80/1000 \ 130 " 130 ," + filter[1] + "Flags = FLAGS " 131 131 132 132 133 self.scratchDb.execute(sql) … … 141 142 WHERE " + filter[1] + "MeanPSFMagErr > " + str(cut) 142 143 self.scratchDb.execute(sql) 144 145 self.logger.infoPair("Setting to NULL all x20pct =", "32.767" ) 146 for filter in filters: 147 sql = "UPDATE Object \ 148 SET " + filter[1] + "20pct = null \ 149 WHERE " + filter[1] + "20pct > 32.766" 150 self.scratchDb.execute(sql) 151 self.logger.infoPair("Setting to NULL all x80pct =", "32.767" ) 152 for filter in filters: 153 sql = "UPDATE Object \ 154 SET " + filter[1] + "80pct = null \ 155 WHERE " + filter[1] + "80pct > 32.766" 156 self.scratchDb.execute(sql) 157 158 159 143 160 144 161 ''' … … 187 204 ,decErr \ 188 205 ,nDetections \ 206 ,extra \ 207 ,sgSep \ 189 208 ,dataRelease \ 190 209 ) \ … … 200 219 ,DEC_ERR \ 201 220 ,NMEASURE \ 221 ,PSF_QF_PERF \ 222 ,STARGAL_SEP \ 202 223 , " + str(self.config.dataRelease) + "\ 203 224 FROM " + cptTableName -
trunk/ippToPsps/jython/scratchdb.py
r34173 r34441 391 391 except: 392 392 self.logger.error("Unable to create DVO detection database table") 393 393 self.makeColumnUnique("dvoDetection", "objID") 394 394 395 395 ''' -
trunk/ippToPsps/jython/stackbatch.py
r34165 r34441 374 374 ,PSF_THETA \ 375 375 ,psfLikelihood(EXT_NSIGMA) \ 376 ,FLAGS << 32 | FLAGS2\376 ,FLAGS2 << 32 | FLAGS \ 377 377 ,PSF_QF \ 378 378 ,MOMENTS_XX \ … … 389 389 ,KRON_FLUX / " + str(self.expTime) + " \ 390 390 ,KRON_FLUX_ERR / " + str(self.expTime) + " \ 391 , NULL\391 , MOMENTS_R1 * 2.5 \ 392 392 , NULL \ 393 393 ,N_FRAMES \ … … 395 395 ," + self.historyModNum + " \ 396 396 FROM SkyChip_psf" 397 398 self.scratchDb.execute(sql)397 self.scratchDb.execute(sql) 398 399 399 #it is possible to drop some detections from dvo (that are present in the cmf). when that happens we get a 0 for objid 400 400 #we drop those... … … 402 402 self.scratchDb.execute(sql) 403 403 self.logger.infoPair("Deleting", "entries with StackDetection.objID = 0") 404 404 405 405 self.scratchDb.updateAllRows("StackDetection", "surveyID", str(self.surveyID)) 406 406 407 self.scratchDb.updateFilterID("StackDetection", self.filter) 408 407 409 self.scratchDb.updateAllRows("StackDetection", "dataRelease", str(self.config.dataRelease)) 410 408 411 self.scratchDb.updateAllRows("StackDetection", "primaryF", "0") 412 409 413 self.scratchDb.updateAllRows("StackDetection", "activeFlag", "0") 414 410 415 self.updateStackMetaID("StackDetection") 416 411 417 self.updateStackTypeID("StackDetection") 418 412 419 self.updateDvoIDs("StackDetection") 420 413 421 sql = "ALTER IGNORE TABLE StackDetection ADD PRIMARY KEY (objID)" 422 414 423 self.scratchDb.execute(sql) 415 424 … … 422 431 AND a.ippDetectID = b.IPP_IDET \ 423 432 AND b.PSF_INST_FLUX_SIG IS NOT NULL" 433 424 434 self.scratchDb.execute(sql) 425 435 436 426 437 self.scratchDb.reportAndDeleteRowsWithNULLS("StackDetection", "instFlux") 438 427 439 self.scratchDb.reportAndDeleteRowsWithNULLS("StackDetection", "objID") 440 428 441 sql="DELETE FROM StackDetection where objID = 0" 429 self.scratchDb.execute(sql) 430 self.logger.infoPair("Deleting", "entries with StackDetection.objID = 0") 431 442 443 self.scratchDb.execute(sql) 444 self.logger.infoPair("Delleting", "entries with StackDetection.objID = 0") 445 432 446 433 447 ''' … … 600 614 601 615 self.logger.debug("Altering PSPS tables") 616 # heather uncommented the unique line -- well that no worky 602 617 #self.scratchDb.makeColumnUnique("StackDetection", "objID") 603 618 self.scratchDb.createIndex("StackDetection", "ippDetectID") … … 624 639 ''' 625 640 def updateDvoIDs(self, table): 626 641 self.logger.infoPair("getting","imageID") 627 642 imageID = self.scratchDb.getImageIDFromExternID(self.header['IMAGEID']) 643 self.logger.infoPair("obtained","imageID") 628 644 self.logger.debug("Updating table '" + table + "' with DVO IDs...") 629 645 sql = "UPDATE " + table + " AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \ … … 633 649 WHERE a.ippDetectID = b.ippDetectID \ 634 650 AND b.imageID = " + str(imageID) 635 self.scratchDb.execute(sql) 636 651 652 self.scratchDb.execute(sql) 653 637 654 ''' 638 655 Does the processing, i.e. pulling stuff from IPP tables into PSPS tables
Note:
See TracChangeset
for help on using the changeset viewer.
