IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 31, 2013, 4:13:09 PM (13 years ago)
Author:
eugene
Message:

split out config (static info) and skychunk (area being processed)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20121219/ippToPsps/jython/dvo.py

    r35063 r35076  
    3333
    3434    '''
    35     def __init__(self, logger, config, scratchDbName=None):
     35    def __init__(self, logger, config, skychunk, scratchDbName=None):
    3636
    3737        # set up logging
    3838        self.logger = logger
    3939        self.config = config
     40        self.skychunk = skychunk
    4041
    4142        # set up empty lists
     
    5758
    5859        # 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)
    6061
    6162        # this scratch Db either has no DVO info ingested, or a different DVO ingested. Prompt user
    6263        if not self.correctDvo:
    6364            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 + "'?")
    6566            response = raw_input("(y/n) ")
    6667            if response == "y":
     
    104105
    105106        # check if we have up-to-date version
    106         path = self.config.dvoLocation + "/Photcodes.dat"
     107        path = self.skychunk.dvoLocation + "/Photcodes.dat"
    107108        if self.scratchDb.alreadyImportedThisDvoTable(path):
    108109            self.logger.debugPair("DVO Photcodes.dat file", "up-to-date")
     
    129130
    130131        # check if we have up-to-date version
    131         path = self.config.dvoLocation + "/Images.dat"
     132        path = self.skychunk.dvoLocation + "/Images.dat"
    132133        if self.scratchDb.alreadyImportedThisDvoTable(path):
    133134            self.logger.debugPair("DVO Images.dat file", "up-to-date")
     
    154155        if not self.correctDvo: return False
    155156
    156         path =  self.config.dvoLocation + "/SkyTable.fits"
     157        path =  self.skychunk.dvoLocation + "/SkyTable.fits"
    157158        if self.scratchDb.alreadyImportedThisDvoTable(path):
    158159            self.logger.debugPair("DVO SkyTable.fits file", "up-to-date")       
     
    185186            cmd += " -dbuser " + self.scratchDb.dbUser
    186187            cmd += " -dbpass " + self.scratchDb.dbPass
    187             cmd += " -D CATDIR " + self.config.dvoLocation
     188            cmd += " -D CATDIR " + self.skychunk.dvoLocation
    188189
    189190            self.logger.infoPair("Running dvopsps", cmd)
     
    196197       
    197198        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)
    199200
    200201        return True
     
    259260           paths = []
    260261           for fileType in self.ingestFileTypes:
    261                paths.append(self.config.dvoLocation + "/" + regionPath + "." + fileType)
     262               paths.append(self.skychunk.dvoLocation + "/" + regionPath + "." + fileType)
    262263
    263264           # check for the existence of all interested file types
     
    332333        # go no further if we've already partly ingested a different DVO
    333334        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)
    335336            return
    336337
     
    418419             # get combined size of all interested files
    419420             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)
    421422                 # EAM TEST I/O
    422423                 self.logger.infoPair(fileType, size)
     
    570571    def nativeIngestDetections(self, raCenter, decCenter, boxSize):
    571572
    572         # XXX put the chunk below in a separate method
     573        # XXX put the skychunk below in a separate method
    573574       
    574575        # drop detections table
     
    610611        cmd += " -dbuser " + self.scratchDb.dbUser
    611612        cmd += " -dbpass " + self.scratchDb.dbPass
    612         cmd += " -D CATDIR " + self.config.dvoLocation
     613        cmd += " -D CATDIR " + self.skychunk.dvoLocation
    613614        cmd += " -region "
    614615        cmd += " " + str(raCenter-halfSize)
     
    617618        cmd += " " + str(decCenter+halfSize)
    618619
    619         if self.config.parallel:
     620        if self.skychunk.parallel:
    620621            cmd += " -parallel"
    621622
Note: See TracChangeset for help on using the changeset viewer.