IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31405 for trunk/ippToPsps


Ignore:
Timestamp:
Apr 28, 2011, 3:56:55 PM (15 years ago)
Author:
rhenders
Message:

removed some log messages; added abstract alterPspsTables() method to be implemented by subclasses; now uses either 'full' dvo tables or on-the-fly

File:
1 edited

Legend:

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

    r31352 r31405  
    3232    "../config/2/tables.vot"
    3333    '''
    34     def __init__(self, logger, batchType, inputFitsPath="", survey=""):
     34    def __init__(self, logger, batchType, inputFitsPath="", survey="", useFullTables=False):
    3535
    3636        # set up logging
    3737        self.logger = logger
     38        self.logger.info("-------------------------------------------------------------------------------")
    3839        self.logger.debug("Batch class constructor")
    3940
    … …  
    4344        self.inputFitsPath = inputFitsPath
    4445        self.survey = survey
     46        self.useFullTables = useFullTables
    4547
    4648        # TODO
    … …  
    5355        self.gpc1Db = Gpc1Db(self.logger)
    5456        self.ippToPspsDb = IppToPspsDb(logger)
    55         self.scratchDb = ScratchDb(logger)
     57        self.scratchDb = ScratchDb(logger, self.useFullTables)
    5658
    5759        if self.survey != "":
    … …  
    9294            # TODO close file?
    9395
    94         # create DVO table
    95         self.scratchDb.createDvoTables()
     96        # create DVO tables if accessing DVO directly
     97        if not self.useFullTables: self.scratchDb.createDvoTables()
    9698
    9799    '''
    … …  
    315317             self.tablesToExport.append(table.name)
    316318
    317          self.indexPspsTables()
     319         self.alterPspsTables();
    318320
    319321    '''
    … …  
    323325        self.logger.warn("indexIppTables not implemented")
    324326
    325     '''
    326     Subclass should implement this to index PSPS tables
     327
     328    '''
     329    Alter PSPS tables
    327330    '''   
    328     def indexPspsTables(self):
    329         self.logger.warn("indexPspsTables not implemented")
     331    def alterPspsTables(self):
     332        self.logger.warn("alterPspsTables not implemented")
    330333
    331334    '''
    … …  
    370373    def exportPspsTablesToFits(self, regex="(.*)"):
    371374
    372         self.logger.info("Exporting all PSPS tables to FITS")
     375        self.logger.info("Replacing NULLs with -999 then exporting all PSPS tables to FITS")
    373376        _tables = []
    374377
    … …  
    381384           # get everything from table
    382385           _table = stilts.tread(self.scratchDb.url + '#SELECT * FROM ' + table)
    383 
    384            self.logger.info("   Replacing NULLs with weird PSPS -999 constant for " + table)
    385386
    386387           # replace nulls and empty fields with weird PSPS -999 pseudo-null
Note: See TracChangeset for help on using the changeset viewer.