IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 10, 2015, 12:40:44 PM (11 years ago)
Author:
eugene
Message:

make code less forgiving: sql execute aborts on failures; deal with various hidden problems: add IF EXISTS to drop table operations to avoid raising unneeded error, make sure tables exist before trying to add indexes, test for existence of the stack _xsrc, _xfit, etc tables (and skip if missing); fix sqlLine.group to cast inputs to string before performing string ops; getKeyFloat now returns a float value which is safe with sqlLine.group, but can be used in a math expression; use python math. operators as needed (sqrt, fabs); fulltest.sh runs for camera, stack, object stages; update dvoSkyTable to use REGION_ID instead of special word INDEX; add existsClient method (avoid using mysql failure as a test for table existence); no need to test for exceptions to sql.execute since we abort on failure; replace esoteric SQL with dropTable calls; trap errors in stilts.treads in setupScratchdb; drop StackObjecThin and StackDetOffMeta along with other stack scratch tables

File:
1 edited

Legend:

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

    r38365 r38837  
    167167            return False
    168168
    169         self.logger.infoSeparator()
    170         self.logger.infoPair("DVO SkyTable.fits file", "NOT up-to-date")       
    171 
    172         # drop dvoSkyTable (if it exists)
    173         sql = "drop TABLE dvoSkyTable"
    174         try: self.scratchDb.execute(sql)
    175         except: pass
     169        # self.logger.infoSeparator()
     170        # self.logger.infoPair("DVO SkyTable.fits file", "NOT up-to-date")       
     171        # print "--- go"
     172
     173        self.scratchDb.dropTable("dvoSkyTable")
    176174
    177175        # create dvoSkyTable
    178         sql = "CREATE TABLE dvoSkyTable (R_MIN REAL, R_MAX REAL, D_MIN REAL, D_MAX REAL, INDEX_ INT, NAME CHAR(18))"
     176        sql = "CREATE TABLE dvoSkyTable (R_MIN REAL, R_MAX REAL, D_MIN REAL, D_MAX REAL, REGION_ID INT, NAME CHAR(18))"
    179177        self.scratchDb.execute(sql)
    180178
     
    196194        self.logger.infoPair("Adding index to", self.scratchDb.dvoSkyTable)
    197195
    198         self.scratchDb.createIndex(self.scratchDb.dvoSkyTable, "INDEX")
     196        self.scratchDb.createIndex(self.scratchDb.dvoSkyTable, "REGION_ID")
    199197       
    200198        self.scratchDb.setImportedThisDvoTable(path)
     
    580578        self.ippToPspsDb.clearIngestedBoxes(self.scratchDb.dbHost)
    581579       
    582         if True:
    583             print "*******************************************************************************"
     580        if False:
    584581            self.logger.warning("about to delete detection table and re-ingest; is this correct?")
    585             #response = raw_input("(y/n) ")
    586             #if response != "y":
    587             #    raise
    588             #self.logger.warning("Are you ABSOLUTELY sure you want to do this?")
    589             #response = raw_input("(y/n) ")
    590             #if response != "y":
    591             #    raise
     582            response = raw_input("(y/n) ")
     583            if response != "y":
     584                raise
     585            self.logger.warning("Are you ABSOLUTELY sure you want to do this?")
     586            response = raw_input("(y/n) ")
     587            if response != "y":
     588                raise
    592589
    593590        # blow away existing dvoDetection table & re-crate
Note: See TracChangeset for help on using the changeset viewer.