IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 31, 2012, 11:54:39 AM (14 years ago)
Author:
bills
Message:

Changes to PSPS table definitions for SA 10.
Detection tables contain all fluxes
Object table contains all magnitudes
Populate DetectionCalib and StackDetectinCalib

File:
1 edited

Legend:

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

    r34615 r34630  
    452452               ,MOMENTS_XY \
    453453               ,MOMENTS_YY \
    454                ,AP_MAG \
     454               ,POW(10.0, -0.4 *AP_MAG) / " + self.header['EXPTIME'] + " \
    455455               ,KRON_FLUX / " + self.header['EXPTIME'] + " \
    456456               ,KRON_FLUX_ERR / " + self.header['EXPTIME'] + " \
     
    458458               ,PSF_CHISQ \
    459459               ,FLAGS2 << 32 | FLAGS\
    460                ,SKY \
    461                ,SKY_SIGMA \
     460               ,SKY  / " + self.header['EXPTIME'] + " \
     461               ,SKY_SIGMA  / " + self.header['EXPTIME'] + " \
    462462               ,EXT_NSIGMA \
    463463               , 0 \
     
    466466               , " + str(self.config.dataRelease) + "\
    467467               FROM " + ippTableName
    468         # SA10 todo
    469         # need to correct formulas for psfFlux/psfFluxErr
    470         # need to correct apMag apFlux
    471         # need to correct unites kronFlux/Err to correct units
    472         # need to change psfqfperfect -> psfqfperfect PSF_QF_PERFECT?
    473         # need to change psfchisq  PSF_CHI_SQ?
    474         # need to change unites of sky/skyErr to adu/s/pixel
    475         # need formula for sgsep/psflikelhood
    476468        # self.logger.info(sql)
    477469        self.scratchDb.execute(sql)
     
    557549               FROM Detection_" + ota
    558550        self.scratchDb.execute(sql)
    559         #SA10 TODO
    560         # insert ra/dec/calstuff into Table
    561         # heather discovered dec is called 'dec_'
    562         sql = "UPDATE " + tableName + " SET ra = -999, dec_ =-999, raErr = -999, decErr = -999, zp = -999, zpErr = -999, expTime = -999, airMass = -999"
     551
     552        # insert calibration information from dvoDetections into the Table
     553        sql = "UPDATE " + tableName + " AS a, "  + self.scratchDb.dvoDetectionTable + " AS b \
     554            SET a.ra = b.ra, \
     555            a.dec_ = b.dec_, \
     556            a.raErr = b.raErr, \
     557            a.decErr = b.decErr, \
     558            a.zp = b.zp, \
     559            a.zpErr = b.zpErr, \
     560            a.expTime = b.expTime, \
     561            a.airMass = b.airMass   \
     562            WHERE a.objID = b.objID AND a.detectID = b.detectID"
    563563        self.scratchDb.execute(sql)
    564564        self.scratchDb.updateAllRows(tableName, "dataRelease", str(self.config.dataRelease))
Note: See TracChangeset for help on using the changeset viewer.