IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39518


Ignore:
Timestamp:
Apr 8, 2016, 2:23:30 PM (10 years ago)
Author:
watersc1
Message:

Change to normalize forcedWarpExtended aperture fluxes to janskys.

File:
1 edited

Legend:

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

    r39467 r39518  
    501501        fMeasTableName = "ForcedWarpMeasurement_" + str(num)
    502502
     503        expTimeString = str(self.expTime[num])
     504
    503505        sql = "CREATE TABLE " + pspsTableName + " LIKE ForcedWarpExtended"
    504506        self.scratchDb.execute(sql)
     
    508510        sqlLine = sqlUtility("INSERT INTO " + pspsTableName + " (")
    509511        sqlLine.group("ippDetectID",     "IPP_IDET")
    510         sqlLine.group("flxR5",           "APER_FLUX_3")
    511         sqlLine.group("flxR5Err",        "APER_FLUX_ERR_3" )
    512         sqlLine.group("flxR5Std",        "APER_FLUX_STDEV_3")
     512        sqlLine.group("flxR5",           "APER_FLUX_3 / " + expTimeString)
     513        sqlLine.group("flxR5Err",        "APER_FLUX_ERR_3 / " + expTimeString)
     514        sqlLine.group("flxR5Std",        "APER_FLUX_STDEV_3 / " + expTimeString)
    513515        sqlLine.group("flxR5Fill",       "APER_FILL_3")
    514         sqlLine.group("flxR6",           "APER_FLUX_4")
    515         sqlLine.group("flxR6Err",        "APER_FLUX_ERR_4" )
    516         sqlLine.group("flxR6Std",        "APER_FLUX_STDEV_4")
     516        sqlLine.group("flxR6",           "APER_FLUX_4 / " + expTimeString)
     517        sqlLine.group("flxR6Err",        "APER_FLUX_ERR_4 / " + expTimeString)
     518        sqlLine.group("flxR6Std",        "APER_FLUX_STDEV_4 / " + expTimeString)
    517519        sqlLine.group("flxR6Fill",       "APER_FILL_4")
    518         sqlLine.group("flxR7",           "APER_FLUX_5")
    519         sqlLine.group("flxR7Err",        "APER_FLUX_ERR_5" )
    520         sqlLine.group("flxR7Std",        "APER_FLUX_STDEV_5")
     520        sqlLine.group("flxR7",           "APER_FLUX_5 / " + expTimeString)
     521        sqlLine.group("flxR7Err",        "APER_FLUX_ERR_5 / " + expTimeString)
     522        sqlLine.group("flxR7Std",        "APER_FLUX_STDEV_5 / " + expTimeString)
    521523        sqlLine.group("flxR7Fill",       "APER_FILL_5")
    522524
     
    543545        self.scratchDb.execute(sql)
    544546       
     547        # Normalize by zpFactor by joining our table against the dvoDetectionTable
     548        self.logger.infoPair("inserting dvo info: find imageID", "from externID")
     549        imageID = self.scratchDb.getImageIDFromExternID(self.warpSkyFileID[num])
     550        self.logger.infoPair("updating", pspsTableName)
     551
     552        sqlLine = sqlUtility("UPDATE " + pspsTableName + " as a, " + self.scratchDb.dvoDetectionTable + " as b SET ")
     553        sqlLine.group("a.flxR5",     "a.flxR5     * b.zpFactor")
     554        sqlLine.group("a.flxR5Err",  "a.flxR5Err  * b.zpFactor")
     555        sqlLine.group("a.flxR5Std",  "a.flxR5Std  * b.zpFactor")
     556
     557        sqlLine.group("a.flxR6",     "a.flxR6     * b.zpFactor")
     558        sqlLine.group("a.flxR6Err",  "a.flxR6Err  * b.zpFactor")
     559        sqlLine.group("a.flxR6Std",  "a.flxR6Std  * b.zpFactor")
     560
     561        sqlLine.group("a.flxR7",     "a.flxR7     * b.zpFactor")
     562        sqlLine.group("a.flxR7Err",  "a.flxR7Err  * b.zpFactor")
     563        sqlLine.group("a.flxR7Std",  "a.flxR7Std  * b.zpFactor")
     564
     565        sql = sqlLine.makeEquals("WHERE a.ippDetectID = b.ippDetectID AND b.imageID = " +str( imageID))
     566        self.scratchDb.execute(sql)
     567
    545568        # cull bad entris
    546569        self.logger.infoPair("need to cull"," nulls objid")
Note: See TracChangeset for help on using the changeset viewer.