Skip to content

Commit

Permalink
Added unit test for gain >= 0
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertLuptonTheGood committed Feb 2, 2018
1 parent a0451c4 commit 2ffccc9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_flatAndIlluminationCorrection.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,30 @@ def testIllum2(self):
def testIllum3(self):
self.doIllum(scaling=3.7)

def testGainAndReadnoise(self):
import lsst.afw.image as afwImage
from lsst.afw.cameraGeom.testUtils import DetectorWrapper
from lsst.ip.isr import IsrTask

isrTask = IsrTask()

detector = DetectorWrapper().detector
raw = afwImage.ExposureF(detector.getBBox())

level = 10
readNoise = 1
raw.image.set(level)

amp = detector[0]
amp.setReadNoise(readNoise)

for gain in [-1, 0, 0.1, 1]:
amp.setGain(gain)
isrTask.updateVariance(raw, amp)
if gain <= 0:
gain = 1

self.assertEqual(raw.variance.get(0, 0), level/gain + readNoise**2)

class MemoryTester(lsst.utils.tests.MemoryTestCase):
pass
Expand Down

0 comments on commit 2ffccc9

Please sign in to comment.