Changeset 38921
- Timestamp:
- Oct 21, 2015, 8:51:41 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/forcedwarpbatch.py (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/forcedwarpbatch.py
r38902 r38921 84 84 self.skycellID = {} 85 85 self.projectionID = {} 86 self.tessID = {} 86 87 87 88 #I give a number to the forcedwarp stuff, I am not sure if this is the best way but it might work … … 131 132 self.logger.infoPair("found tess_id",self.tessName[num]) 132 133 133 # tessName = self.getKeyValue(self.header, 'TESS_ID') 134 # self.tessID = self.scratchDb.getTessID(tessName) 134 self.tessID[num] = self.scratchDb.getTessID(self.tessName[num]) 135 135 136 136 # As the database doesn't have the software_ver entry, pull the photometry version as the analysis version. … … 160 160 self.logger.infoPair("skycell found", self.skycellID[num]) 161 161 self.dropTableVerbose("ForcedWarpMeasurement"+"_"+str(forcedWarpID)) 162 self.dropTableVerbose("ForcedWarpMasked"+"_"+str(forcedWarpID)) 162 163 self.dropTableVerbose("ForcedWarpExtended"+"_"+str(forcedWarpID)) 163 164 self.dropTableVerbose("ForcedWarpMeta"+"_"+str(forcedWarpID)) … … 166 167 if not self.config.retry: 167 168 self.scratchDb.dropTable("ForcedWarpMeasurement"+"_"+str(forcedWarpID)) 169 self.scratchDb.dropTable("ForcedWarpMasked"+"_"+str(forcedWarpID)) 168 170 self.scratchDb.dropTable("ForcedWarpExtended"+"_"+str(forcedWarpID)) 169 171 self.scratchDb.dropTable("ForcedWarpMeta"+"_"+str(forcedWarpID)) … … 255 257 256 258 sqlLine.group("forcedWarpID", str(forcedWarpID)) 259 sqlLine.group("tessID", str(self.tessID[num])) 257 260 sqlLine.group("projectionID", str(self.projectionID[num])) 258 261 sqlLine.group("skyCellID", str(self.skycellID[num])) … … 336 339 337 340 ''' 338 Populates the ForcedWarpMeasurement table341 Populates the ForcedWarpMeasurement and ForcedWarpMasked tables 339 342 ''' 340 343 def populateForcedWarpMeasurement(self,num): … … 361 364 sqlLine.group("filterID", str(self.filterID[num])) 362 365 sqlLine.group("surveyID", str(self.surveyID)) 366 sqlLine.group("tessID", str(self.tessID[num])) 367 sqlLine.group("projectionID", str(self.projectionID[num])) 363 368 sqlLine.group("skycellID", str(self.skycellID[num])) 364 369 sqlLine.group("expTime", str(self.expTime[num])) … … 447 452 self.logger.infoPair("Dropping row column from", "ForcedWarpMeasurement_"+forcedWarpID+" table") 448 453 self.scratchDb.dropColumn("ForcedWarpMeasurement_"+forcedWarpID, "row") 454 455 # now move the rows with no data to ForcedWarpMasked 456 self.logger.infoPair("Procesing table", "ForcedWarpMasked_"+forcedWarpID) 457 sql = "CREATE TABLE ForcedWarpMasked_"+forcedWarpID+" LIKE ForcedWarpMasked" 458 try: self.scratchDb.execute(sql) 459 except: pass 460 461 # This is the definition of a "masked measurement". 462 # Do we have NULL columns at this point or are they already -999? This test catches them either way 463 maskedCondition = "FpsfQfPerfect < .0001 OR FpsfQfPerfect is NULL" 464 465 sql = "INSERT INTO ForcedWarpMasked_"+forcedWarpID+" \ 466 SELECT objID, uniquePspsFWid, ippObjID, ippDetectID, filterID, surveyID, \ 467 forcedSummaryID, forcedWarpID, randomWarpID, tessID, projectionID, \ 468 skyCellID, dvoRegionID, obsTime \ 469 FROM ForcedWarpMeasurement_"+forcedWarpID+" WHERE "+maskedCondition 470 try: self.scratchDb.execute(sql) 471 except: pass 472 473 sql = "DELETE FROM ForcedWarpMeasurement_"+forcedWarpID+" WHERE "+maskedCondition 474 try: self.scratchDb.execute(sql) 475 except: pass 449 476 450 477 # add indexes ForcedWarpMeasurement 451 478 self.scratchDb.createIndex("ForcedWarpMeasurement_"+forcedWarpID, "objID") 452 479 self.scratchDb.createIndex("ForcedWarpMeasurement_"+forcedWarpID, "ippDetectID") 480 481 # add indexes ForcedWarpMasked 482 self.scratchDb.createIndex("ForcedWarpMasked_"+forcedWarpID, "objID") 483 self.scratchDb.createIndex("ForcedWarpMasked_"+forcedWarpID, "ippDetectID") 453 484 454 485 ''' … … 617 648 self.populateForcedWarpMeasurement(num) 618 649 self.tablesToExport.append("ForcedWarpMeasurement_"+forcedWarpID) 650 self.tablesToExport.append("ForcedWarpMasked_"+forcedWarpID) 619 651 620 652 self.logger.infoPair("Populating","ForcedWarpExtended_"+forcedWarpID)
Note:
See TracChangeset
for help on using the changeset viewer.
