- Timestamp:
- Dec 3, 2015, 4:14:24 PM (11 years ago)
- Location:
- branches/eam_branches/ipp-20151113
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20151113
- Property svn:mergeinfo changed
/trunk (added) merged: 39137-39165,39167-39181,39186,39189,39191-39192,39209-39210,39216-39217
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20151113/ippToPsps
- Property svn:ignore
-
old new 14 14 install-sh 15 15 Doxyfile 16 compile
-
- Property svn:ignore
-
branches/eam_branches/ipp-20151113/ippToPsps/jython/dvo.py
r38995 r39224 72 72 # response = raw_input("(y/n) ") 73 73 # if response == "y": 74 self.resetAllTables() 74 self.resetAllTables() ## called if we need to change DVOs 75 75 76 76 ''' … … 95 95 self.correctDvo = True 96 96 if not self.loadSkyTable(): 97 self.correctDvo = False 98 return 99 if not self.loadPhotcodes(): 100 self.correctDvo = False 101 return 102 if not self.loadImages(): 97 103 self.correctDvo = False 98 104 return … … 298 304 return False 299 305 300 # update the two meta tables, Images andSkyTable301 self.loadSkyTable() 306 # update the SkyTable 307 self.loadSkyTable() ## in setSkyArea 302 308 303 309 # set bounding-box coords … … 508 514 def sync(self): 509 515 510 # go no further if we've already partly ingested a different DVO 511 if not self.correctDvo: return False 512 513 # check we have something to do 514 if len(self.regionsToPurge) < 1 and len(self.regionsToIngest) < 1: 515 self.logger.infoPair("Nothing to ingest or purge", "finished ingest") 516 return True 517 518 # make sure we have an up-to-date Images table 519 self.loadImages() 520 521 # purge stuff 522 self.purgeRegions(self.regionsToPurge) 523 524 totalRegions = len(self.regionsToIngest) 525 if totalRegions > 0: self.logger.infoSeparator() 526 527 # now loop through all regions and ingest to MySQL 528 ingestedRegionsCount = 0 529 regionCount = 1 530 for region in self.regionsToIngest: 531 532 self.logger.infoTitle("Region %d of %d: %s" % (regionCount, totalRegions, region)) 533 if self.ingestRegion(region): ingestedRegionsCount += 1 534 regionCount += 1 535 536 self.logger.infoSeparator() 537 self.logger.infoPair("Ingested", "%d DVO regions (out of %d)" % (ingestedRegionsCount, len(self.regionsToIngest))) 538 539 # update lists after attempted sync 540 self.setSkyArea(self.minRa, self.maxRa, self.minDec, self.maxDec) 541 self.printSummary() 516 print "---- sync is disabled ----" 517 os._exit(3) 518 519 ### XXX # go no further if we've already partly ingested a different DVO 520 ### XXX if not self.correctDvo: return False 521 ### XXX 522 ### XXX # check we have something to do 523 ### XXX if len(self.regionsToPurge) < 1 and len(self.regionsToIngest) < 1: 524 ### XXX self.logger.infoPair("Nothing to ingest or purge", "finished ingest") 525 ### XXX return True 526 ### XXX 527 ### XXX # make sure we have an up-to-date Images table 528 ### XXX self.loadImages() 529 ### XXX 530 ### XXX # purge stuff 531 ### XXX self.purgeRegions(self.regionsToPurge) 532 ### XXX 533 ### XXX totalRegions = len(self.regionsToIngest) 534 ### XXX if totalRegions > 0: self.logger.infoSeparator() 535 ### XXX 536 ### XXX # now loop through all regions and ingest to MySQL 537 ### XXX ingestedRegionsCount = 0 538 ### XXX regionCount = 1 539 ### XXX for region in self.regionsToIngest: 540 ### XXX 541 ### XXX self.logger.infoTitle("Region %d of %d: %s" % (regionCount, totalRegions, region)) 542 ### XXX if self.ingestRegion(region): ingestedRegionsCount += 1 543 ### XXX regionCount += 1 544 ### XXX 545 ### XXX self.logger.infoSeparator() 546 ### XXX self.logger.infoPair("Ingested", "%d DVO regions (out of %d)" % (ingestedRegionsCount, len(self.regionsToIngest))) 547 ### XXX 548 ### XXX # update lists after attempted sync 549 ### XXX self.setSkyArea(self.minRa, self.maxRa, self.minDec, self.maxDec) 550 ### XXX self.printSummary() 542 551 543 552 return True … … 667 676 includes purging detections outside sky area 668 677 ''' 669 def nativeIngestDetections(self, boxId, boxDim ):678 def nativeIngestDetections(self, boxId, boxDim, myBatchType): 670 679 671 680 # clear the 'ingested' field for all boxes owned by this host … … 688 697 689 698 # make sure we have an up-to-date Images table 690 self.loadImages() 699 self.loadImages() # this is in nativeIngestDetections (remove?) 691 700 692 701 # the box dimensions are the area used to select the items of … … 695 704 # to grab all detections / objects which are contributed by an 696 705 # item with the center in the given box 697 dR_border = self.skychunk.BORDER / math.cos(math.radians(boxDim['DEC'])) 698 dD_border = self.skychunk.BORDER 699 700 #This is a terrible hack but I'm tired of it taking a decade to ingest the FW skycells. 701 702 #if self.batchType == "ST": 703 # dR_border = .4 / math.cos(math.radians(boxDim['DEC'])) 704 # dD_border = .4 705 #if self.batchType == "FW": 706 # dR_border = .4 / math.cos(math.radians(boxDim['DEC'])) 707 # dD_border = .4 708 709 706 707 # P2 and DF need to use a full GPC1 exposure radius: 708 myBorder = self.skychunk.BORDER_GPC1 709 710 # ST and FW need to use just a skycell 711 if myBatchType == "ST" : 712 myBorder = self.skychunk.BORDER_SKYCELL 713 if myBatchType == "FW" : 714 myBorder = self.skychunk.BORDER_SKYCELL 715 716 dR_border = myBorder / math.cos(math.radians(boxDim['DEC'])) 717 dD_border = myBorder 710 718 711 719 minRA = boxDim['minRA'] - dR_border … … 788 796 else: 789 797 cmd += " -photcode-start 12000 -photcode-end 12500" 790 ## if (useFW == 1): 791 ## if (self.config.camera == "simtest"): 792 ## print "need photcodes for non gpc1 camera" 793 ## else: 794 ## print "need photcode for warp for gpc1 camera, default is no selection, should work, could be slow" 798 799 if (useST + useP2 + useDF + useFW > 1): 800 self.logger.errorPair("multiple batch types in a run", "NOW ILLEGAL") 801 os._exit(5) 795 802 796 803 ## dvopsps can take a very long time. try 2 or 3 times to re-establish communication with the db before proceeding?
Note:
See TracChangeset
for help on using the changeset viewer.
