Skip to content

Commit

Permalink
Add deferrecCharge test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Broughton committed Jan 6, 2025
1 parent 0127f0a commit 4063c76
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pipelines/_ingredients/cpCti.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ tasks:
class: lsst.cp.pipe.CpCtiSolveTask
config:
connections.inputMeasurements: "cpCtiStatistics"
connections.outputCalib: "cpCtiCalib"
connections.outputCalib: "cpCti"
contracts:
- cpCtiSolve.connections.inputMeasurements == cpCtiIsr.connections.outputStatistics
2 changes: 1 addition & 1 deletion pipelines/_ingredients/cpCtiLSST.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ tasks:
class: lsst.cp.pipe.CpCtiSolveTask
config:
connections.inputMeasurements: "cpCtiStatistics"
connections.outputCalib: "cpCtiCalib"
connections.outputCalib: "cpCti"
contracts:
- cpCtiSolve.connections.inputMeasurements == cpCtiIsr.connections.outputStatistics
16 changes: 16 additions & 0 deletions tests/test_deferredCharge.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"""Test cases for lsst.cp.pipe.deferredCharge."""

import unittest
import numpy

import lsst.utils
import lsst.utils.tests
Expand Down Expand Up @@ -277,6 +278,11 @@ def test_task(self):
results = self.task.run(self.inputMeasurements, self.camera, self.inputDims)

calib = results.outputCalib

# Check that the signals array is sorted
for ampName in calib.signals.keys():
assert numpy.all(numpy.diff(calib.signals[ampName]) > 0)

# Check that the result matches expectation.
self.assertAlmostEqual(calib.globalCti['C:0,0'], 1.0e-7, 4)
self.assertAlmostEqual(calib.driftScale['C:0,0'], 1.8105e-4, 4)
Expand All @@ -287,6 +293,16 @@ def test_task(self):
self.assertEqual(calib.globalCti['C:0,0'], calib.globalCti[ampName])
self.assertEqual(calib.driftScale['C:0,0'], calib.driftScale[ampName])
self.assertEqual(calib.decayTime['C:0,0'], calib.decayTime[ampName])
self.assertEqual(calib.signals[ampName][-2], calib.serialCtiTurnoff[ampName])
self.assertEqual(calib.signals[ampName][-1], calib.parallelCtiTurnoff[ampName])
self.assertEqual(
(calib.signals[ampName][-1] - calib.signals[ampName][-3]) / 2.0,
calib.serialCtiTurnoffSamplingErr[ampName],
)
self.assertEqual(
calib.signals[ampName][-1] - calib.signals[ampName][-2],
calib.parallelCtiTurnoffSamplingErr[ampName],
)


class TestMemory(lsst.utils.tests.MemoryTestCase):
Expand Down

0 comments on commit 4063c76

Please sign in to comment.