- Timestamp:
- Jun 27, 2018, 3:31:55 PM (8 years ago)
- Location:
- branches/czw_branch/20170908
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippToPsps/jython/forcedwarpbatch.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20170908
- Property svn:mergeinfo changed
-
branches/czw_branch/20170908/ippToPsps/jython/forcedwarpbatch.py
r40011 r40483 424 424 # self.selectDvoObjIDs() 425 425 self.logger.infoPair("inserting dvo info: find imageID", "from externID") 426 imageID = self.scratchDb.getImageIDFromExternIDandPhotcodeRange(self.warpSkyFileID[num],12000,12500) 427 self.logger.infoPair("I don't like this", "it is hardwired to gpc1") 426 427 # get the imageID: this code has cases for simtest vs gpc1 cameras 428 # if self.config.test: 429 self.logger.infoPair("current camera is", self.config.camera) 430 if self.config.camera == "gpc1": 431 self.logger.infoPair("I don't like this", "it is hardwired to gpc1") 432 imageID = self.scratchDb.getImageIDFromExternIDandPhotcodeRange(self.warpSkyFileID[num],12000,12500) 433 if self.config.camera == "simtest": 434 imageID = self.scratchDb.getImageIDFromExternIDandPhotcodeRange(self.warpSkyFileID[num],15100,15500) 435 if imageID == 0: 436 self.logger.infoPair ("failed to get imageID for", str(num)) 437 raise 438 428 439 self.logger.infoPair("updating", pspsTableName) 429 440 … … 433 444 sqlLine.group("a.ippObjID", "b.ippObjID") 434 445 sqlLine.group("a.dvoRegionID","b.catID") 435 sqlLine.group("a.zp", "b.zp ")446 sqlLine.group("a.zp", "b.zpPSF") 436 447 sqlLine.group("a.telluricExt","b.telluricExt") 437 448 sqlLine.group("a.airmass", "b.airmass") 438 449 sqlLine.group("a.FinfoFlag3", "b.flags") 439 450 440 sqlLine.group("a.FpsfFlux", "a.FpsfFlux * b.zpFactor ")441 sqlLine.group("a.FpsfFluxErr", "a.FpsfFluxErr * b.zpFactor ")442 sqlLine.group("a.FapFlux", "a.FapFlux * b.zpFactor ")443 sqlLine.group("a.FapFluxErr", "a.FapFluxErr * b.zpFactor ")444 sqlLine.group("a.FkronFlux", "a.FkronFlux * b.zpFactor ")445 sqlLine.group("a.FkronFluxErr", "a.FkronFluxErr * b.zpFactor ")446 sqlLine.group("a.Fsky", "a.Fsky * b.zpFactor ")447 sqlLine.group("a.FskyErr", "a.FskyErr * b.zpFactor ")451 sqlLine.group("a.FpsfFlux", "a.FpsfFlux * b.zpFactorPSF") 452 sqlLine.group("a.FpsfFluxErr", "a.FpsfFluxErr * b.zpFactorPSF") 453 sqlLine.group("a.FapFlux", "a.FapFlux * b.zpFactorAPER") 454 sqlLine.group("a.FapFluxErr", "a.FapFluxErr * b.zpFactorAPER") 455 sqlLine.group("a.FkronFlux", "a.FkronFlux * b.zpFactorAPER") 456 sqlLine.group("a.FkronFluxErr", "a.FkronFluxErr * b.zpFactorAPER") 457 sqlLine.group("a.Fsky", "a.Fsky * b.zpFactorAPER") 458 sqlLine.group("a.FskyErr", "a.FskyErr * b.zpFactorAPER") 448 459 449 460 sql = sqlLine.makeEquals("WHERE a.ippDetectID = b.ippDetectID AND b.imageID = " +str( imageID)) … … 457 468 self.logger.infoPair("row count of ForcedWarpMeasurement after cull of null objID ", rowCountAfter) 458 469 if rowCountAfter == 0: 459 self.skipBatch = True 460 self.logger.infoPair ("skip this batch", "it is bad") 461 return False 470 if self.haveLensPSF[num] ==0: 471 self.logger.infoPair("skipping this table", "no lenspsf and no dvo, run this:") 472 self.logger.infoPair("update addRun join addProcessedExp using (add_id) set fault = 43 where add_id = ",str(self.number[num])) 473 self.skipBatch = True 474 return False 475 else: 476 self.skipBatch = True 477 self.logger.infoPair ("skip this batch", "it is bad") 478 return False 479 480 462 481 463 482 self.logger.infoPair("Adding 'row' columns to", pspsTableName) … … 557 576 558 577 sqlLine = sqlUtility("UPDATE " + pspsTableName + " as a, " + self.scratchDb.dvoDetectionTable + " as b SET ") 559 sqlLine.group("a.flxR5", "a.flxR5 * b.zpFactor ")560 sqlLine.group("a.flxR5Err", "a.flxR5Err * b.zpFactor ")561 sqlLine.group("a.flxR5Std", "a.flxR5Std * b.zpFactor ")562 563 sqlLine.group("a.flxR6", "a.flxR6 * b.zpFactor ")564 sqlLine.group("a.flxR6Err", "a.flxR6Err * b.zpFactor ")565 sqlLine.group("a.flxR6Std", "a.flxR6Std * b.zpFactor ")566 567 sqlLine.group("a.flxR7", "a.flxR7 * b.zpFactor ")568 sqlLine.group("a.flxR7Err", "a.flxR7Err * b.zpFactor ")569 sqlLine.group("a.flxR7Std", "a.flxR7Std * b.zpFactor ")578 sqlLine.group("a.flxR5", "a.flxR5 * b.zpFactorAPER") 579 sqlLine.group("a.flxR5Err", "a.flxR5Err * b.zpFactorAPER") 580 sqlLine.group("a.flxR5Std", "a.flxR5Std * b.zpFactorAPER") 581 582 sqlLine.group("a.flxR6", "a.flxR6 * b.zpFactorAPER") 583 sqlLine.group("a.flxR6Err", "a.flxR6Err * b.zpFactorAPER") 584 sqlLine.group("a.flxR6Std", "a.flxR6Std * b.zpFactorAPER") 585 586 sqlLine.group("a.flxR7", "a.flxR7 * b.zpFactorAPER") 587 sqlLine.group("a.flxR7Err", "a.flxR7Err * b.zpFactorAPER") 588 sqlLine.group("a.flxR7Std", "a.flxR7Std * b.zpFactorAPER") 570 589 571 590 sql = sqlLine.makeEquals("WHERE a.ippDetectID = b.ippDetectID AND b.imageID = " +str( imageID)) … … 657 676 # each of the "populate*" methods below add their tables to the list: 658 677 self.tablesToExport=[] 678 tables = [] # list of tables to calculate min/max objid on... 659 679 660 680 for num in self.number: … … 671 691 self.logger.infoPair("Populating", myTable) 672 692 if not self.populateForcedWarpMeasurement(num): 673 self.logger.infoPair (" skipppingForcedWarpMeasurement", str(num))693 self.logger.infoPair ("failed on ForcedWarpMeasurement", str(num)) 674 694 #continue 675 695 raise 676 696 self.tablesToExport.append(myTable) 677 678 self.logger.infoPair("setting min/max objid from", myTable) 679 self.setMinMaxObjID([myTable]) 697 tables.append(myTable) 698 #self.logger.infoPair("setting min/max objid from", myTable) 699 700 #self.setMinMaxObjID([myTable]) 680 701 681 702 # populateForcedWarpMeasurement also populates ForcedWarpMasked (from ForcedWarpMeasurement) … … 697 718 self.populateForcedWarpToImage(num) 698 719 self.tablesToExport.append(myTable) 720 self.logger.infoPair("setting min/max objid from", "all the fw tables") 721 self.setMinMaxObjID(tables) 722 self.logger.infoPair("finishing","populatePspsTables") 723 699 724 700 self.logger.infoPair("finishing","populatePspsTables")701 702 725 703 726 return True … … 762 785 self.haveLensPSF[num] = 0 763 786 self.haveLensing[num] = 0 787 764 788 for table in tables: 765 789 # check for AP_NPIX columns: missing for SAS39
Note:
See TracChangeset
for help on using the changeset viewer.
