IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38954


Ignore:
Timestamp:
Oct 23, 2015, 3:37:32 PM (11 years ago)
Author:
eugene
Message:

fillFactor calculated based on apRadius (not apRadius - 0.5); handle case of image not in dvo db (and zpImage not valid); fix unit conversion for stack momentRH; fix units for model fit phiErr (deg, not radians); apply platescale to model Radius, RadiusErr, as well as petRadius and related

Location:
trunk/ippToPsps/jython
Files:
4 edited

Legend:

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

    r38951 r38954  
    504504            sqlLine.group("apFlux",       "AP_FLUX / " + expTimeString)
    505505            sqlLine.group("apFluxErr",    "AP_FLUX_SIG / " + expTimeString)
    506             sqlLine.group("apFillF",      "AP_NPIX / (3.14159265359 * POW(AP_MAG_RADIUS - 0.5, 2))")
     506            sqlLine.group("apFillF",      "AP_NPIX / (3.14159265359 * AP_MAG_RADIUS * AP_MAG_RADIUS)")
    507507        sqlLine.group("apRadius",         "AP_MAG_RADIUS * abs(PLTSCALE)")
    508508        sqlLine.group("kronFlux",         "KRON_FLUX / " + expTimeString)
  • trunk/ippToPsps/jython/diffbatch.py

    r38928 r38954  
    321321            sqlLine.group("DapFlux",          "AP_FLUX / " + expTimeString)
    322322            sqlLine.group("DapFluxErr",       "AP_FLUX_SIG / " + expTimeString)
    323 #           sqlLine.group("DapFillF",         "AP_NPIX / (3.14159265359 * POW(AP_MAG_RADIUS - 0.5, 2))")
     323#           sqlLine.group("DapFillF",         "AP_NPIX / (3.14159265359 * AP_MAG_RADIUS * AP_MAG_RADIUS)")
    324324#       sqlLine.group("DapRadius",        "AP_MAG_RADIUS")
    325325        sqlLine.group("DkronFlux",        "KRON_FLUX / " + expTimeString)
  • trunk/ippToPsps/jython/forcedwarpbatch.py

    r38951 r38954  
    400400        sqlLine.group("FapFlux",           "AP_FLUX / " + expTimeString)
    401401        sqlLine.group("FapFluxErr",        "AP_FLUX_SIG / " + expTimeString)
    402         sqlLine.group("FapFillF",          "AP_NPIX / (3.14159265359 * POW(AP_MAG_RADIUS - 0.5, 2))")
     402        sqlLine.group("FapFillF",          "AP_NPIX / (3.14159265359 * AP_MAG_RADIUS * AP_MAG_RADIUS)")
    403403        sqlLine.group("FapRadius",         "AP_MAG_RADIUS")
    404404        sqlLine.group("FkronFlux",         "KRON_FLUX / " + expTimeString)
  • trunk/ippToPsps/jython/stackbatch.py

    r38951 r38954  
    261261        zpErr   = self.getKeyFloat(header, "%.8f", 'ZPT_ERR')
    262262
     263        # zp correction should comes from DVO (unless image is not in DVO)
    263264        zpImage = self.scratchDb.getImageZeroPoint(stackID)
    264 
    265         # XXX zp correction should come from DVO
     265        if zpImage < 0.0:
     266            zpImage = zp
     267
    266268        detectionThreshold = detectionThreshold + zpImage - 2.5 * math.log10(expTime)
    267269       
     
    476478            sqlLine.group("a."+filter+"momentYY",      "b.MOMENTS_YY * PLTSCALE * PLTSCALE")
    477479            sqlLine.group("a."+filter+"momentR1",      "b.MOMENTS_R1 * b.PLTSCALE")
    478             sqlLine.group("a."+filter+"momentRH",      "b.MOMENTS_RH * b.PLTSCALE")
     480            sqlLine.group("a."+filter+"momentRH",      "b.MOMENTS_RH * sqrt(b.PLTSCALE)")
    479481            sqlLine.group("a."+filter+"PSFFlux",       "b.PSF_INST_FLUX / " + expTimeString)
    480482            sqlLine.group("a."+filter+"PSFFluxErr",    "b.PSF_INST_FLUX_SIG / " + expTimeString)
     
    483485            sqlLine.group("a."+filter+"KronFlux",      "b.KRON_FLUX / " + expTimeString)
    484486            sqlLine.group("a."+filter+"KronFluxErr",   "b.KRON_FLUX_ERR / " + expTimeString)
    485             sqlLine.group("a."+filter+"ApFillFac",     "b.AP_NPIX / (3.14159265359 * POW(b.AP_MAG_RADIUS - 0.5, 2))")
     487            sqlLine.group("a."+filter+"ApFillFac",     "b.AP_NPIX / (3.14159265359 * b.AP_MAG_RADIUS * b.AP_MAG_RADIUS)")
    486488            sqlLine.group("a."+filter+"ApRadius",      "b.AP_MAG_RADIUS")
    487489            sqlLine.group("a."+filter+"KronRad",       "b.MOMENTS_R1 * 2.5 * b.PLTSCALE")
     
    662664        sqlLine.group("a." + filter + model + "Phi",       "DEGREES(b.EXT_THETA)")
    663665
    664         sqlLine.group("a." + filter + model + "RadiusErr", "b.EXT_WIDTH_MAJ_ERR") # these are not correctly defined.
    665         sqlLine.group("a." + filter + model + "AbErr",     "b.EXT_WIDTH_MIN_ERR") # these are not correctly defined.
    666         sqlLine.group("a." + filter + model + "PhiErr",    "b.EXT_THETA_ERR") # these are not correctly defined.
     666        sqlLine.group("a." + filter + model + "RadiusErr", "b.EXT_WIDTH_MAJ_ERR")
     667        sqlLine.group("a." + filter + model + "AbErr",     "b.EXT_WIDTH_MIN_ERR")
     668        sqlLine.group("a." + filter + model + "PhiErr",    "DEGREES(b.EXT_THETA_ERR)")
    667669
    668670        sqlLine.group("a." + filter + model + "Chisq",     "b.EXT_CHISQ / b.EXT_NDOF")
     
    703705        # StackObjectAttributes, this is probably faster using that table:
    704706        sqlLine = sqlUtility("UPDATE " + tablename + " AS a, " + self.scratchDb.dvoDetectionTable + " as b SET")
    705         sqlLine.group("a." + filter + model + "Mag",       "a." + filter + model + "Mag + b.zp")
     707
     708        sqlLine.group("a." + filter + model + "Mag",       "a." + filter + model + "Mag       + b.zp")
     709        sqlLine.group("a." + filter + model + "Radius",    "a." + filter + model + "Radius    * b.PLTSCALE")
     710        sqlLine.group("a." + filter + model + "RadiusErr", "a." + filter + model + "RadiusErr * b.PLTSCALE")
     711
    706712        sql = sqlLine.makeEquals("WHERE a.objID = b.objID AND a." + filter + "ippDetectID = b.ippDetectID AND b.imageID = " + str(imageID))
    707713
     
    834840        sqlLine.group("a." + filter + "petRadiusErr", "b.PETRO_RADIUS_ERR")
    835841        sqlLine.group("a." + filter + "petMag",       "b.PETRO_MAG - " + hdrZP) 
    836         sqlLine.group("a." + filter + "petMagErr",    "1.0 / b.PETRO_MAG_ERR") 
     842        sqlLine.group("a." + filter + "petMagErr",    "1.0 / b.PETRO_MAG_ERR")  # still inverted? (yes)
    837843        sqlLine.group("a." + filter + "petR50",       "b.PETRO_RADIUS_50")
    838844        sqlLine.group("a." + filter + "petR50Err",    "b.PETRO_RADIUS_50_ERR")
     
    850856        # modify petMag to apply the zero point
    851857        sqlLine = sqlUtility("UPDATE " + tablename + " AS a, " + self.scratchDb.dvoDetectionTable + " as b SET")
    852         sqlLine.group("a." + filter + "petMag",       "a." + filter + "petMag + b.zp")
     858
     859        sqlLine.group("a." + filter + "petMag",       "a." + filter + "petMag    + b.zp")
     860
     861        sqlLine.group("a." + filter + "petRadius",    "a." + filter + "petRadius * b.PLTSCALE")
     862        sqlLine.group("a." + filter + "petRadiusErr", "a." + filter + "petRadius * b.PLTSCALE")
     863        sqlLine.group("a." + filter + "petR50",       "a." + filter + "petR50    * b.PLTSCALE")
     864        sqlLine.group("a." + filter + "petR50Err",    "a." + filter + "petR50Err * b.PLTSCALE")
     865        sqlLine.group("a." + filter + "petR90",       "a." + filter + "petR90    * b.PLTSCALE")
     866        sqlLine.group("a." + filter + "petR90Err",    "a." + filter + "petR90Err * b.PLTSCALE")
     867
    853868        sql = sqlLine.makeEquals("WHERE a.objID = b.objID AND a." + filter + "ippDetectID = b.ippDetectID AND b.imageID = " + str(imageID))
    854869
Note: See TracChangeset for help on using the changeset viewer.