IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34441 for trunk


Ignore:
Timestamp:
Sep 14, 2012, 12:17:39 PM (14 years ago)
Author:
heather
Message:

changes for SA9 - mostly filling in empty columns and fixing known broken stuff

Location:
trunk/ippToPsps/jython
Files:
3 edited

Legend:

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

    r34290 r34441  
    124124                   ," + filter[1] + "StackPSFFlux = FLUX_PSF \
    125125                   ," + filter[1] + "StackPSFFluxErr = FLUX_PSF_ERR \
    126                    ," + filter[1] + "StackKronMag = -2.5 * log10(FLUX_KRON) -8.9 \
     126                   ," + filter[1] + "StackKronMag = -2.5 * log10(FLUX_KRON) + 8.9 \
    127127                   ," + filter[1] + "StackKronMagErr = FLUX_KRON_ERR / FLUX_KRON \
    128128                   ," + filter[1] + "20pct = MAG_20/1000 \
    129129                   ," + filter[1] + "80pct = MAG_80/1000 \
    130                    "
     130                   ," + filter[1] + "Flags = FLAGS " 
     131                   
    131132           
    132133            self.scratchDb.execute(sql)
     
    141142                   WHERE " + filter[1] + "MeanPSFMagErr > " + str(cut)
    142143            self.scratchDb.execute(sql)
     144
     145        self.logger.infoPair("Setting to NULL all x20pct =", "32.767" )
     146        for filter in filters:
     147            sql  = "UPDATE Object \
     148                   SET " + filter[1] + "20pct = null \
     149                   WHERE " + filter[1] + "20pct > 32.766"
     150            self.scratchDb.execute(sql)
     151        self.logger.infoPair("Setting to NULL all x80pct =", "32.767" )
     152        for filter in filters:
     153            sql  = "UPDATE Object \
     154                    SET " + filter[1] + "80pct = null \
     155                    WHERE " + filter[1] + "80pct > 32.766"
     156            self.scratchDb.execute(sql)
     157
     158
     159
    143160
    144161    '''
     
    187204               ,decErr \
    188205               ,nDetections \
     206               ,extra \
     207               ,sgSep \
    189208               ,dataRelease \
    190209               ) \
     
    200219               ,DEC_ERR \
    201220               ,NMEASURE \
     221               ,PSF_QF_PERF \
     222               ,STARGAL_SEP \
    202223               , " + str(self.config.dataRelease) + "\
    203224               FROM " + cptTableName
  • trunk/ippToPsps/jython/scratchdb.py

    r34173 r34441  
    391391        except:
    392392            self.logger.error("Unable to create DVO detection database table")
    393 
     393        self.makeColumnUnique("dvoDetection", "objID")
    394394
    395395    '''
  • trunk/ippToPsps/jython/stackbatch.py

    r34165 r34441  
    374374               ,PSF_THETA \
    375375               ,psfLikelihood(EXT_NSIGMA) \
    376                ,FLAGS << 32 | FLAGS2 \
     376               ,FLAGS2 << 32 | FLAGS \
    377377               ,PSF_QF \
    378378               ,MOMENTS_XX \
     
    389389               ,KRON_FLUX / " + str(self.expTime) + " \
    390390               ,KRON_FLUX_ERR / " + str(self.expTime) + " \
    391                , NULL \
     391               , MOMENTS_R1 * 2.5 \
    392392               , NULL \
    393393               ,N_FRAMES \
     
    395395               ," + self.historyModNum + " \
    396396               FROM SkyChip_psf"
    397 
    398         self.scratchDb.execute(sql)
     397        self.scratchDb.execute(sql)
     398       
    399399        #it is possible to drop some detections from dvo (that are present in the cmf). when that happens we get a 0 for objid
    400400        #we drop those...
     
    402402        self.scratchDb.execute(sql)
    403403        self.logger.infoPair("Deleting", "entries with StackDetection.objID = 0")
    404 
     404       
    405405        self.scratchDb.updateAllRows("StackDetection", "surveyID", str(self.surveyID))
     406       
    406407        self.scratchDb.updateFilterID("StackDetection", self.filter)
     408       
    407409        self.scratchDb.updateAllRows("StackDetection", "dataRelease", str(self.config.dataRelease))
     410       
    408411        self.scratchDb.updateAllRows("StackDetection", "primaryF", "0")
     412       
    409413        self.scratchDb.updateAllRows("StackDetection", "activeFlag", "0")
     414       
    410415        self.updateStackMetaID("StackDetection")
     416       
    411417        self.updateStackTypeID("StackDetection")
     418       
    412419        self.updateDvoIDs("StackDetection")
     420       
    413421        sql = "ALTER IGNORE TABLE StackDetection ADD PRIMARY KEY (objID)"
     422       
    414423        self.scratchDb.execute(sql)
    415424 
     
    422431                   AND a.ippDetectID = b.IPP_IDET  \
    423432                   AND b.PSF_INST_FLUX_SIG IS NOT NULL"
     433           
    424434            self.scratchDb.execute(sql)
    425435           
     436       
    426437        self.scratchDb.reportAndDeleteRowsWithNULLS("StackDetection", "instFlux")
     438       
    427439        self.scratchDb.reportAndDeleteRowsWithNULLS("StackDetection", "objID")
     440       
    428441        sql="DELETE FROM StackDetection where objID = 0"
    429         self.scratchDb.execute(sql)
    430         self.logger.infoPair("Deleting", "entries with StackDetection.objID = 0")
    431 
     442       
     443        self.scratchDb.execute(sql)
     444        self.logger.infoPair("Delleting", "entries with StackDetection.objID = 0")
     445       
    432446
    433447    '''
     
    600614
    601615        self.logger.debug("Altering PSPS tables")
     616        # heather uncommented the unique line -- well that no worky
    602617        #self.scratchDb.makeColumnUnique("StackDetection", "objID")
    603618        self.scratchDb.createIndex("StackDetection", "ippDetectID")
     
    624639    '''
    625640    def updateDvoIDs(self, table):
    626 
     641        self.logger.infoPair("getting","imageID")
    627642        imageID = self.scratchDb.getImageIDFromExternID(self.header['IMAGEID'])
     643        self.logger.infoPair("obtained","imageID")
    628644        self.logger.debug("Updating table '" + table + "' with DVO IDs...")
    629645        sql = "UPDATE " + table + " AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \
     
    633649               WHERE a.ippDetectID = b.ippDetectID \
    634650               AND b.imageID = " + str(imageID)
    635         self.scratchDb.execute(sql)
    636 
     651       
     652        self.scratchDb.execute(sql)
     653       
    637654    '''
    638655    Does the processing, i.e. pulling stuff from IPP tables into PSPS tables
Note: See TracChangeset for help on using the changeset viewer.