IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 28, 2014, 6:20:27 AM (12 years ago)
Author:
eugene
Message:

dropping options for stilts dvo import methods; fixing a number of previously ignored errors (eg, dropping non-existent tables); allowing queue questions to strip leading and trailing spaces (so we can read from an input file); echo back the response so input from a file is clearer; re-write big sql blocks with new sql utility code; updating names in MeanObject, ObjectThin to be more consistent; add a new test code program; update detection fields to match new schema; drop the code for the old now-unused tables (detecitonCalib, SkinnyObject, etc)

Location:
branches/eam_branches/ipp-20140717/ippToPsps
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140717/ippToPsps

  • branches/eam_branches/ipp-20140717/ippToPsps/jython/dvo.py

    r36447 r37129  
    5050        self.regionsIngestedButOutOfDate = []
    5151       
    52         # we have (still) 3 modes of ingest from dvo cpt/cps/cpm files
    53         # 1) dvograbber (useFullTables == FALSE),
     52        # we USED TO have 3 modes of ingest from dvo cpt/cps/cpm files
     53        # 1) dvograbber (useStilts == TRUE, useFullTables == FALSE),
    5454        # 2) jython/stilts (useStilts == TRUE, useFullTables == TRUE)
    55         # 3) dvopsps (useStilts == FALSE, useFullTables == TRUE)
     55        # 3) dvopsps (useStilts == FALSE, useFullTables == FALSE)
    5656        # my goal (EAM, 2013/01/31) is to migrate to only dvopsps
    5757
    58         self.useStilts = 0
    59         self.scratchDb.setUseFullTables(True)
     58        self.scratchDb.setDvoTableNames()
    6059
    6160        # decide if we are using the right DVO for this scratchDb
     
    105104        if not self.correctDvo: return
    106105
     106        if (self.skychunk.dvoLocation == 'none'):
     107            print "do not load Photcodes for place-holder DVO " + self.skychunk.dvoLocation
     108            return False
     109
    107110        # check if we have up-to-date version
    108111        path = self.skychunk.dvoLocation + "/Photcodes.dat"
     
    156159        if not self.correctDvo: return False
    157160
     161        if (self.skychunk.dvoLocation == 'none'):
     162            print "do not load SkyTable for place-holder DVO " + self.skychunk.dvoLocation
     163            return False
     164
    158165        path =  self.skychunk.dvoLocation + "/SkyTable.fits"
    159166        if self.scratchDb.alreadyImportedThisDvoTable(path):
     
    164171        self.logger.infoPair("DVO SkyTable.fits file", "NOT up-to-date")       
    165172
    166         if self.useStilts:
    167             self.importFits(
    168                 path,
    169                 "R_MIN R_MAX D_MIN D_MAX INDEX NAME",
    170                 self.scratchDb.dvoSkyTable)
    171         else:
    172            
    173             # create dvoSkyTable
    174             sql = "drop TABLE dvoSkyTable"
    175             try:
    176                 self.scratchDb.execute(sql)
    177             except: pass
    178 
    179             # create dvoSkyTable
    180             sql = "CREATE TABLE dvoSkyTable (R_MIN REAL, R_MAX REAL, D_MIN REAL, D_MAX REAL, INDEX_ INT, NAME CHAR(18))"
    181             self.scratchDb.execute(sql)
    182 
    183             # TODO path to DVO prog hardcoded temporarily
    184             cmd = "dvopsps skytable"
    185             cmd += " -dbhost " + self.scratchDb.dbHost
    186             cmd += " -dbname " + self.scratchDb.dbName
    187             cmd += " -dbuser " + self.scratchDb.dbUser
    188             cmd += " -dbpass " + self.scratchDb.dbPass
    189             cmd += " -D CATDIR " + self.skychunk.dvoLocation
    190 
    191             self.logger.infoPair("Running dvopsps", cmd)
    192             p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
    193             p.wait()
    194             if p.returncode != 0:
    195                 self.logger.errorPair("dvopsps failed on SkyTable.fits for ", self.skychunk.dvoLocation)
    196                 raise
     173        # drop dvoSkyTable (if it exists)
     174        sql = "drop TABLE dvoSkyTable"
     175        try: self.scratchDb.execute(sql)
     176        except: pass
     177
     178        # create dvoSkyTable
     179        sql = "CREATE TABLE dvoSkyTable (R_MIN REAL, R_MAX REAL, D_MIN REAL, D_MAX REAL, INDEX_ INT, NAME CHAR(18))"
     180        self.scratchDb.execute(sql)
     181
     182        # TODO path to DVO prog hardcoded temporarily
     183        cmd = "dvopsps skytable"
     184        cmd += " -dbhost " + self.scratchDb.dbHost
     185        cmd += " -dbname " + self.scratchDb.dbName
     186        cmd += " -dbuser " + self.scratchDb.dbUser
     187        cmd += " -dbpass " + self.scratchDb.dbPass
     188        cmd += " -D CATDIR " + self.skychunk.dvoLocation
     189
     190        self.logger.infoPair("Running dvopsps", cmd)
     191        p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
     192        p.wait()
     193        if p.returncode != 0:
     194            self.logger.errorPair("dvopsps failed on SkyTable.fits for ", self.skychunk.dvoLocation)
     195            raise
    197196
    198197        self.logger.infoPair("Adding index to", self.scratchDb.dvoSkyTable)
Note: See TracChangeset for help on using the changeset viewer.