=================================== FAILURES ===================================
|
_____________________ DipoleAlgorithmTest.testPsfDipoleFit _____________________
|
|
self = <testDipole.DipoleAlgorithmTest testMethod=testPsfDipoleFit>
|
scaling = 100.0
|
|
def testPsfDipoleFit(self, scaling=100.):
|
psf, psfSum, exposure, s = createDipole(self.w, self.h, self.xc, self.yc, scaling=scaling)
|
source = self.measureDipole(s, exposure)
|
# Recreate the simultaneous joint Psf fit in python
|
fp = source.getFootprint()
|
peaks = fp.getPeaks()
|
speaks = [(p.getPeakValue(), p) for p in peaks]
|
speaks.sort()
|
dpeaks = [speaks[0][1], speaks[-1][1]]
|
|
negCenter = afwGeom.Point2D(dpeaks[0].getFx(), dpeaks[0].getFy())
|
posCenter = afwGeom.Point2D(dpeaks[1].getFx(), dpeaks[1].getFy())
|
|
fneg, negPsfSum, fpos, posPsfSum, residIm = self._makeModel(exposure, psf, fp, negCenter, posCenter)
|
|
# Should be close to the same as the inputs; as fracOffset
|
# gets smaller this will be worse. This works for scaling =
|
# 100.
|
self.assertAlmostEqual(1e-2*scaling, -1e-2*fneg, 2)
|
> self.assertAlmostEqual(1e-2*scaling, 1e-2*fpos, 2)
|
E AssertionError: 1.0 != 1.008598744756823 within 2 places
|
|
tests/testDipole.py:293: AssertionError
|
The skipping worked fine, but when I run all of the tests together testDipole fails in line 293: AssertionError: 1.0 != 1.008598744756823 within 2 places. Any ideas why the rounding would be less accurate in an aggregate test but when running it as a single test? Full error:
_____________________ DipoleAlgorithmTest.testPsfDipoleFit _____________________
speaks.sort()