From fe09c0d214a29526543faf94a0ffc657a4e98967 Mon Sep 17 00:00:00 2001 From: Jim Bosch Date: Thu, 23 Jul 2015 14:13:06 -0400 Subject: [PATCH] Fix PhotoCal error calculation to use inverse variance weighting. Previous versions used the uncertainty as the weight, which is completely backwards. --- python/lsst/pipe/tasks/photoCal.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/lsst/pipe/tasks/photoCal.py b/python/lsst/pipe/tasks/photoCal.py index e50f993d3..83418ba47 100644 --- a/python/lsst/pipe/tasks/photoCal.py +++ b/python/lsst/pipe/tasks/photoCal.py @@ -810,8 +810,10 @@ def getZeroPoint(self, src, ref, srcErr=None, zp0=None): dmag = dmag[good] dmagErr = dmagErr[good] + zp, weightSum = np.average(dmag, weights=1/dmagErr**2, returned=True) + sigma = np.sqrt(1.0/weightSum) return pipeBase.Struct( - zp = np.average(dmag, weights=dmagErr), - sigma = np.std(dmag, ddof=1), + zp = zp, + sigma = sigma, ngood = len(dmag), )