Skip to content

Commit

Permalink
Add tests for overscan-corrected image stdev.
Browse files Browse the repository at this point in the history
  • Loading branch information
czwa committed Jan 30, 2023
1 parent 0f27932 commit 0d12d53
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_overscanCorrection.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,13 @@ def test_parallelOverscanCorrection(self):
# Test the output value for the serial and parallel overscans
self.assertEqual(oscanResults.overscanMean[0], 2.0)
self.assertEqual(oscanResults.overscanMean[1], 4.5)
if fitType != 'MEDIAN':
# The ramp that has been inserted should be fully
# removed by the overscan fit, removing all of the
# signal. This isn't true of the constant fit, so do
# not test that here.
self.assertLess(statAfter[1], statBefore[1])
self.assertEqual(statAfter[1], 0.0)

def test_bleedParallelOverscanCorrection(self):
"""Expect that this should reduce the image variance with a full fit.
Expand Down Expand Up @@ -450,6 +457,10 @@ def test_bleedParallelOverscanCorrection(self):
self.assertAlmostEqual(exposureCopy.image.array[5][0],
0.5 * (exposureCopy.image.array[5][4]
+ exposureCopy.image.array[5][5]), delta=0.3)
# These fits should also reduce the image stdev, as
# they are modeling the ramp.
self.assertLess(statAfter[1], statBefore[1])


def test_bleedParallelOverscanCorrectionFailure(self):
"""Expect that this should reduce the image variance with a full fit.
Expand Down Expand Up @@ -510,6 +521,11 @@ def test_bleedParallelOverscanCorrectionFailure(self):
# instead of 4.5:
self.assertAlmostEqual(oscanResults.overscanMean[1], 6.5, delta=0.001)
else:
# This is not correcting the bleed, so it will be printed
# onto the image, making the stdev after correction worse
# than before.
self.assertGreater(statAfter[1], statBefore[1])

# Check that the median overscan value matches the
# constant fit:
self.assertAlmostEqual(oscanResults.overscanMedian[1], 6.5, delta=0.001)
Expand Down

0 comments on commit 0d12d53

Please sign in to comment.