IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 3, 2013, 12:52:33 PM (13 years ago)
Author:
eugene
Message:

changed dvoDetectionFull mysql engine to 'MEMORY' to improve ingest speed

handle errrors in calls to dvopsps (only in detectionbatch.py)

removed a lot of excess verbosity used for debugging / testing

determine the mysql major version number via mysql query

added test option -realgpc to use test ipptopsps databases with a real gpc1 dataset

add version-dependent call to 'set session old_alter_table' to allow
the ALTER IGNORE statements to work on mysql v5.5 machines (like our
desktops).

raise an exception in case the load infile operations fail

remove unneeded 'killLastConnectionID'

extend logging time to milliseconds

allow an exposure to be skipped without aborting loader

check that a P2 image exists in the dvoImage table (otherwise skip the chip)

change the mysql floating point types for the dvoDetection table to use FLOAT/DOUBLE instead of REAL/FLOAT

remove the old test for valid astrometry of a chip (NASTRO >= 50)

this test was crude and not really the right test. it was also used
to verify that an image should / should not be included. now we check
against dvoImages to see if the chip should be loaded or not (DVO
rejects input images for bad astrometry)

skip an exposure if too many detections have been rejected. this is a sign of a problem and should require more attention

File:
1 edited

Legend:

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

    r35223 r35352  
    591591    def nativeIngestDetections(self, boxId, boxDim):
    592592
    593         # XXX put the chunk below in a separate method
    594         # blow away existing dvoDetection table
    595 
    596593        # clear the 'ingested' field for all boxes owned by this host
    597594        self.ippToPspsDb.clearIngestedBoxes(self.scratchDb.dbHost)
     
    607604        ##     raise
    608605
    609         # drop detections table
    610         self.logger.infoPair("Dropping table", self.scratchDb.dvoDetectionTable)
    611         self.scratchDb.dropTable(self.scratchDb.dvoDetectionTable)
    612        
    613         # create detections table
    614         self.logger.infoPair("Creating table", self.scratchDb.dvoDetectionTable)
    615         sql = "CREATE TABLE " + self.scratchDb.dvoDetectionTable + " LIKE dvoDetection"
    616         try: self.scratchDb.execute(sql)
    617         except:
    618             self.logger.errorPair("Unable to create table", self.scratchDb.dvoDetectionTable)
     606        # blow away existing dvoDetection table & re-crate
     607        if not self.scratchDb.resetDvoDetectionTable():
     608            self.logger.errorPair("Unable to reset scratch table", "DvoDetectionFull")
    619609            return False
    620         self.scratchDb.changeEngineToInnoDB(self.scratchDb.dvoDetectionTable)
    621        
    622         # add fileID column
    623         sql = "ALTER TABLE " + self.scratchDb.dvoDetectionTable + " ADD fileID INT NOT NULL"
    624         try: self.scratchDb.execute(sql)
    625         except:
    626             self.logger.errorPair("Unable to add fileID column to ", self.scratchDb.dvoDetectionTable)
    627             return False
    628 
    629         # add an index to the fileID column
    630         self.scratchDb.createIndex(self.scratchDb.dvoDetectionTable, "fileID")
    631610
    632611        # make sure we have an up-to-date Images table
     
    665644        p = Popen(cmd, shell=True, stdout=PIPE)
    666645        p.wait()
     646        if p.returncode != 0:
     647            self.logger.errorPair("dvopsps failed on ", self.scratchDb.dvoDetectionTable)
     648            raise
    667649
    668650        ## dvopsps can take a very long time. try 2 or 3 times to re-establish communication with the db before proceeding?
     
    670652        self.ippToPspsDb.setIngestedBox(boxId, self.scratchDb.dbHost)
    671653
    672         # add fileID column
     654        # run 'ANALYZE' to get indexes up-to-snuff
    673655        sql = "ANALYZE TABLE " + self.scratchDb.dvoDetectionTable
    674656        try: self.scratchDb.execute(sql)
Note: See TracChangeset for help on using the changeset viewer.