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/detectionbatch.py

    r35171 r35352  
    212212        )"
    213213
    214         print "frame meta sql: ", sql
     214        # print "frame meta sql: ", sql
    215215
    216216        self.scratchDb.execute(sql)
     
    607607         WHERE b.imageID = " + str(imageID) + \
    608608         " INTO OUTFILE '" + dumpFile + "'"
    609         print "sql: ", sql
    610         self.scratchDb.execute(sql)
     609
     610        try: self.scratchDb.execute(sql)
     611        except:
     612            self.logger.info("failed to select data for detectionCalib")
     613            self.logger.infoPair("sql: ", sql)
     614            raise
    611615
    612616        sql = "LOAD DATA INFILE '" + dumpFile + "' INTO TABLE " + tableName
    613         print "sql: ", sql
    614         self.scratchDb.execute(sql)
     617        try: self.scratchDb.execute(sql)
     618        except:
     619            self.logger.info("failed to load data from infile for detectionCalib")
     620            self.logger.infoPair("sql: ", sql)
     621            raise
    615622       
    616623    '''
     
    655662
    656663        # load corresponding header into memory
    657         header = self.fits.findAndReadHeader(extname)
     664        header = self.fits.findAndReadHeader(extname, self.config.test)
    658665        if not header:
    659             self.logger.errorPair("No header found for chip", chipname)
     666            # XXX There is no way to check if we SHOULD find a given
     667            # chip.  We have to accept the absence of the header as
     668            # information that the chip is not available.  This
     669            # message is too verbose, only print in test mode
     670            if self.config.test: self.logger.errorPair("No header found for chip", chipname)
    660671            return False
    661672       
     
    773784        # this is a bit crude: if the chip is not present, this test will fail and the chip
    774785        # will be (correctly) skipped.  would be better to carry that information explicitly ("chip is missing")
    775         if not self.scratchDb.astrometricSolutionOK(chipname):
    776             self.logger.info("| %5s |            ------------- Bad astrometric solution : rejecting ------------                    |" % chipname)
     786
     787        # XXX keep this in or not?
     788        # if not self.scratchDb.astrometricSolutionOK(chipname):
     789        #     self.logger.info("| %5s |            ------------- Bad astrometric solution : rejecting ------------                    |" % chipname)
     790        #     return False
     791
     792        # does this chip exist in the DVO image table (if NOT, then skip it)
     793        if not self.scratchDb.haveThisChip(self.imageIDs[chipname]):
     794            self.logger.info("| %5s |            ------------- Chip not in DVO : rejecting ------------                    |" % chipname)
    777795            return False
     796
    778797        self.logger.info("populate stuff ");
    779798        # populate remainder of tables
     
    803822        self.totalNullObjID    = self.totalNullObjID + results['NULLOBJID']
    804823        self.totalDetections   = self.totalDetections + rowCount
     824
     825        fractionKept = float(rowCount) / float(results['ORIGINALTOTAL'])
     826        # print "kept ", str(fractionKept), " detections from ", chipname
     827
     828        if fractionKept < 0.8:
     829            # print "Too many rejected detections (", str(fractionKept), ", fail on exposure for", chipname
     830            self.logger.infoPair("Too many rejected detections, fail on exposure for", chipname)
     831            self.skipBatch = True
     832            return False;
     833
    805834        #self.logger.info("updated totals")
    806835        # check we have something in this Detection table TODO add this to table above
    807836        if rowCount < 1:
    808             self.logger.infoPair("Skipping empty table for chipname", chipname)
     837            self.logger.infoPair("Empty table for chip, fail on exposure", chipname)
     838            self.skipBatch = True
    809839            return False;
    810840
     
    849879
    850880        # loop through all OTAs again to update with DVO IDs
     881        self.skipBatch = False
    851882        self.validChips = []   
    852883        self.tablesToExport = []   
     
    872903
    873904                if self.populatePspsTablesChip(ota, x, y, results, tables): otaCount = otaCount + 1
     905                if self.skipBatch:
     906                    self.logger.error("fatal problem for exposure, skipping")
     907                    return False
    874908
    875909        if self.populatePspsTablesChip("Chip", 0, 0, results, tables): otaCount = otaCount + 1
     910
     911        if self.skipBatch:
     912            self.logger.error("fatal problem for exposure, skipping")
     913            return False
    876914
    877915        # print totals
Note: See TracChangeset for help on using the changeset viewer.