IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38769 for trunk


Ignore:
Timestamp:
Sep 24, 2015, 4:42:53 PM (11 years ago)
Author:
eugene
Message:

cmfs generated for PV3 has RA and DEC in the xfit table -- update the stackbatch to use these values, apply PlateScale to RaErr,DecErr

File:
1 edited

Legend:

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

    r38767 r38769  
    630630        # This is tricky: RA_EXT is not defined for PS1_SV3 or PS1_V5, but X_EXT is
    631631        # XXX EAM 20140812: for PV3, update cmf output to define RA_EXT, DEC_EXT
    632         sqlLine.group("a." + filter + model + "Ra",        "b.X_EXT")
    633         sqlLine.group("a." + filter + model + "Dec",       "b.Y_EXT")
    634         sqlLine.group("a." + filter + model + "RaErr",     "b.X_EXT_SIG") # need to modify by platescale
    635         sqlLine.group("a." + filter + model + "DecErr",    "b.Y_EXT_SIG")
     632        ## sqlLine.group("a." + filter + model + "Ra",        "b.X_EXT")
     633        ## sqlLine.group("a." + filter + model + "Dec",       "b.Y_EXT")
     634        ## sqlLine.group("a." + filter + model + "RaErr",     "b.X_EXT_SIG") # need to modify by platescale
     635        ## sqlLine.group("a." + filter + model + "DecErr",    "b.Y_EXT_SIG")
     636
     637        # EAM 20150924: PV3 output cmfs were updated to include RA_EXT, DEC_EXT
     638        sqlLine.group("a." + filter + model + "Ra",        "b.RA_EXT")
     639        sqlLine.group("a." + filter + model + "Dec",       "b.DEC_EXT")
     640        sqlLine.group("a." + filter + model + "RaErr",     "b.X_EXT_SIG") # apply plate-scale below
     641        sqlLine.group("a." + filter + model + "DecErr",    "b.Y_EXT_SIG") # apply plate-scale below
    636642
    637643        # sersic fit has an extra parameter
     
    662668            self.logger.errorPair('failed sql',sql)
    663669            raise
    664         # we have (modulo signs):
    665         # gRaExp  = gra  + (X_EXT - gxPos)*gPlateScale / cos(gdec)
    666         # gDecExp = gdec + (Y_EXT - gyPos)*gPlateScale
     670
     671        ## EAM 20150924: this section is now longer needed as the cmf contains RA,DEC
     672        ## # we have (modulo signs):
     673        ## # gRaExp  = gra  + (X_EXT - gxPos)*gPlateScale / cos(gdec)
     674        ## # gDecExp = gdec + (Y_EXT - gyPos)*gPlateScale
     675        ##
     676        ## rawS  = "c." + filter + "PlateScale"
     677        ##
     678        ## extR  = "a." + filter + model + "Ra"
     679        ## rawR  = "b." + filter + "ra"
     680        ## rawX  = "c." + filter + "xPos"
     681        ##
     682        ## extD  = "a." + filter + model + "Dec"
     683        ## rawD  = "b." + filter + "dec"
     684        ## rawY  = "c." + filter + "yPos"
     685        ##
     686        ## # dRA / dX = -PlateScale
     687        ## # b.+filter+ra  - (a.+filter+model+Ra - c.+filter+xPos)*c.+filter+PlateScale / cos(+filter+dec)
     688        ## # extR = rawR - (extR - rawX)*rawS / 3600.0 / cos(rawD)
     689        ##
     690        ## # dDEC / dY = +PlateScale
     691        ## # b.+filter+dec + (a.+filter+model+Dec - c.+filter+xPos)*c.+filter+PlateScale / cos(+filter+dec)
     692        ## # extD = rawD + (extD - rawY)*rawS / 3600.0
     693        ##
     694        ## # insert detection information for each filter based on the DVO contents
     695        ## sqlLine = sqlUtility("UPDATE " + tablename + " AS a, StackObjectThin as b, StackObjectAttributes as c SET ")
     696        ## sqlLine.group(extR, rawR + " - (" + extR + " - " + rawX + ")*" + rawS + " / 3600.0 / cos(radians(" + rawD + "))")
     697        ## sqlLine.group(extD, rawD + " + (" + extD + " - " + rawY + ")*" + rawS + " / 3600.0")
     698        ## field = "a." + filter + model + "RaErr"
     699        ## sqlLine.group(field, field + "*" + rawS)
     700        ## field = "a." + filter + model + "DecErr"
     701        ## sqlLine.group(field, field + "*" + rawS)
     702        ## sql = sqlLine.makeEquals("WHERE a.objID = b.objID AND a.objID = c.objID")
     703        ##
     704        ## try:
     705        ##     self.scratchDb.execute(sql)
     706        ## except:
     707        ##     self.logger.errorPair('failed sql',sql)
     708        ##     raise
     709
     710        # EAM 20150924: update the RA and DEC Errors to be in arcsec, not pixels
     711        # dRA (arcesc) = dRA (pixels) * PlateScale
     712        # dDEC(arcsec) = dDEC(pixels) * PlateScale
    667713
    668714        rawS  = "c." + filter + "PlateScale"
    669 
    670         extR  = "a." + filter + model + "Ra"
    671         rawR  = "b." + filter + "ra"
    672         rawX  = "c." + filter + "xPos"
    673 
    674         extD  = "a." + filter + model + "Dec"
    675         rawD  = "b." + filter + "dec"
    676         rawY  = "c." + filter + "yPos"
    677 
    678         # dRA / dX = -PlateScale
    679         # b.+filter+ra  - (a.+filter+model+Ra - c.+filter+xPos)*c.+filter+PlateScale / cos(+filter+dec)
    680         # extR = rawR - (extR - rawX)*rawS / 3600.0 / cos(rawD)
    681 
    682         # dDEC / dY = +PlateScale
    683         # b.+filter+dec + (a.+filter+model+Dec - c.+filter+xPos)*c.+filter+PlateScale / cos(+filter+dec)
    684         # extD = rawD + (extD - rawY)*rawS / 3600.0
     715        extR  = "a." + filter + model + "RaErr"
     716        extD  = "a." + filter + model + "DecErr"
    685717
    686718        # insert detection information for each filter based on the DVO contents
    687         sqlLine = sqlUtility("UPDATE " + tablename + " AS a, StackObjectThin as b, StackObjectAttributes as c SET ")
    688         sqlLine.group(extR, rawR + " - (" + extR + " - " + rawX + ")*" + rawS + " / 3600.0 / cos(radians(" + rawD + "))")
    689         sqlLine.group(extD, rawD + " + (" + extD + " - " + rawY + ")*" + rawS + " / 3600.0")
    690         field = "a." + filter + model + "RaErr"
    691         sqlLine.group(field, field + "*" + rawS)
    692         field = "a." + filter + model + "DecErr"
    693         sqlLine.group(field, field + "*" + rawS)
    694         sql = sqlLine.makeEquals("WHERE a.objID = b.objID AND a.objID = c.objID")
     719        sqlLine = sqlUtility("UPDATE " + tablename + " AS a, StackObjectAttributes as c SET ")
     720        sqlLine.group(extR, extR + "*" + rawS)
     721        sqlLine.group(extD, extD + "*" + rawS)
     722        sql = sqlLine.makeEquals("WHERE a.objID = c.objID")
    695723
    696724        try:
Note: See TracChangeset for help on using the changeset viewer.