Skip to content

Commit

Permalink
Fix PhotoCal error calculation to use inverse variance weighting.
Browse files Browse the repository at this point in the history
Previous versions used the uncertainty as the weight, which is completely
backwards.
  • Loading branch information
TallJimbo committed Aug 5, 2015
1 parent 15b6f2a commit fe09c0d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/lsst/pipe/tasks/photoCal.py
Expand Up @@ -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),
)

0 comments on commit fe09c0d

Please sign in to comment.