- Timestamp:
- Jan 31, 2013, 4:13:09 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121219/ippToPsps/jython/dvo.py
r35063 r35076 33 33 34 34 ''' 35 def __init__(self, logger, config, s cratchDbName=None):35 def __init__(self, logger, config, skychunk, scratchDbName=None): 36 36 37 37 # set up logging 38 38 self.logger = logger 39 39 self.config = config 40 self.skychunk = skychunk 40 41 41 42 # set up empty lists … … 57 58 58 59 # decide if we are using the right DVO for this scratchDb 59 self.correctDvo = self.scratchDb.isCorrectDvo(self. config.dvoLocation)60 self.correctDvo = self.scratchDb.isCorrectDvo(self.skychunk.dvoLocation) 60 61 61 62 # this scratch Db either has no DVO info ingested, or a different DVO ingested. Prompt user 62 63 if not self.correctDvo: 63 64 print "*******************************************************************************" 64 self.logger.warning("Wrong or no DVO in use. Do you want to reset and use '" + self. config.dvoLocation + "'?")65 self.logger.warning("Wrong or no DVO in use. Do you want to reset and use '" + self.skychunk.dvoLocation + "'?") 65 66 response = raw_input("(y/n) ") 66 67 if response == "y": … … 104 105 105 106 # check if we have up-to-date version 106 path = self. config.dvoLocation + "/Photcodes.dat"107 path = self.skychunk.dvoLocation + "/Photcodes.dat" 107 108 if self.scratchDb.alreadyImportedThisDvoTable(path): 108 109 self.logger.debugPair("DVO Photcodes.dat file", "up-to-date") … … 129 130 130 131 # check if we have up-to-date version 131 path = self. config.dvoLocation + "/Images.dat"132 path = self.skychunk.dvoLocation + "/Images.dat" 132 133 if self.scratchDb.alreadyImportedThisDvoTable(path): 133 134 self.logger.debugPair("DVO Images.dat file", "up-to-date") … … 154 155 if not self.correctDvo: return False 155 156 156 path = self. config.dvoLocation + "/SkyTable.fits"157 path = self.skychunk.dvoLocation + "/SkyTable.fits" 157 158 if self.scratchDb.alreadyImportedThisDvoTable(path): 158 159 self.logger.debugPair("DVO SkyTable.fits file", "up-to-date") … … 185 186 cmd += " -dbuser " + self.scratchDb.dbUser 186 187 cmd += " -dbpass " + self.scratchDb.dbPass 187 cmd += " -D CATDIR " + self. config.dvoLocation188 cmd += " -D CATDIR " + self.skychunk.dvoLocation 188 189 189 190 self.logger.infoPair("Running dvopsps", cmd) … … 196 197 197 198 self.scratchDb.setImportedThisDvoTable(path) 198 self.logger.infoPair("Finished importing SkyTable at", self. config.dvoLocation)199 self.logger.infoPair("Finished importing SkyTable at", self.skychunk.dvoLocation) 199 200 200 201 return True … … 259 260 paths = [] 260 261 for fileType in self.ingestFileTypes: 261 paths.append(self. config.dvoLocation + "/" + regionPath + "." + fileType)262 paths.append(self.skychunk.dvoLocation + "/" + regionPath + "." + fileType) 262 263 263 264 # check for the existence of all interested file types … … 332 333 # go no further if we've already partly ingested a different DVO 333 334 if not self.correctDvo: 334 self.logger.infoPair("Wrong DVO in use", self. config.dvoLocation)335 self.logger.infoPair("Wrong DVO in use", self.skychunk.dvoLocation) 335 336 return 336 337 … … 418 419 # get combined size of all interested files 419 420 for fileType in self.ingestFileTypes: 420 size = size + self.getDiskSize(self. config.dvoLocation + "/" + region + "." + fileType)421 size = size + self.getDiskSize(self.skychunk.dvoLocation + "/" + region + "." + fileType) 421 422 # EAM TEST I/O 422 423 self.logger.infoPair(fileType, size) … … 570 571 def nativeIngestDetections(self, raCenter, decCenter, boxSize): 571 572 572 # XXX put the chunk below in a separate method573 # XXX put the skychunk below in a separate method 573 574 574 575 # drop detections table … … 610 611 cmd += " -dbuser " + self.scratchDb.dbUser 611 612 cmd += " -dbpass " + self.scratchDb.dbPass 612 cmd += " -D CATDIR " + self. config.dvoLocation613 cmd += " -D CATDIR " + self.skychunk.dvoLocation 613 614 cmd += " -region " 614 615 cmd += " " + str(raCenter-halfSize) … … 617 618 cmd += " " + str(decCenter+halfSize) 618 619 619 if self. config.parallel:620 if self.skychunk.parallel: 620 621 cmd += " -parallel" 621 622
Note:
See TracChangeset
for help on using the changeset viewer.
