IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33675


Ignore:
Timestamp:
Apr 3, 2012, 4:29:08 PM (14 years ago)
Author:
rhenders
Message:

simplified overriden ingestRegion() method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/dvoobjects.py

    r33599 r33675  
    2020    Constructor
    2121    '''
    22     def __init__(self, logger, config, scratchDbName):
     22    def __init__(self, logger, config, scratchDbName=None):
    2323
    2424        super(DvoObjects, self).__init__(logger, config, scratchDbName)
    25         self.ingestFileTypes = ['cps','cpt']
     25
     26        # declare DVO file types of interest
     27        self.ingestFileTypes = ['cpt', 'cps']
     28        self.loadPhotcodes()
    2629
    2730    '''
    28     Ingests detections for this region
     31    Ingests object files for this region
    2932    '''
    3033    def ingestRegion(self, region):
    3134
    32        cpsPath = self.config.dvoLocation + "/" + region + ".cps"
    33        cptPath = self.config.dvoLocation + "/" + region + ".cpt"
     35       self.logger.infoPair("Ingesting objects for", region)
    3436
    35        cpsTableName = self.scratchDb.getDbFriendlyTableName(region + ".cps")
    36        cptTableName = self.scratchDb.getDbFriendlyTableName(region + ".cpt")
     37       for fileType in self.ingestFileTypes:
    3738
    38        self.importFits(cpsPath, "*", cpsTableName)
    39        self.importFits(cptPath, "*", cptTableName)
     39           path = self.config.dvoLocation + "/" + region + "." + fileType
     40           tableName = self.scratchDb.getDbFriendlyTableName(region + "." + fileType)
    4041
    41        # we can now report that we have imported this table
    42        self.scratchDb.setImportedThisDvoTable(cpsPath, region)
    43        self.scratchDb.setImportedThisDvoTable(cptPath, region)
     42           self.importFits(path, "*", tableName)
    4443
    45        #self.logger.infoPair("Dropping tables", "%s and %s" % (cpsTableName, cptTableName))
    46        #self.scratchDb.dropTable(cpsTableName)
    47        #self.scratchDb.dropTable(cptTableName)
     44           self.scratchDb.setImportedThisDvoTable(path, region)
    4845
    4946       return True
Note: See TracChangeset for help on using the changeset viewer.