Beispiel #1
0
    def testRun(self):
        """Test LsstSimIsrTask on amp-sized images in tests/data/

        Do not assembleCcd.
        """
        config = LsstSimIsrTask.ConfigClass()
        config.doDark = False
        config.doFringe = False
        config.doAssembleCcd = False
        config.doSnapCombine = False
        lsstIsrTask = LsstSimIsrTask(config=config)
        ampExp = self.ampRef.get('raw')
        camera = self.ampRef.get("camera")
        isrData = lsstIsrTask.readIsrData(self.ampRef, ampExp)
        postIsrExp = lsstIsrTask.run(ampExp,
                                     camera=camera,
                                     **isrData.getDict()).exposure
        self.assertAlmostEqual(ampExp.getMetadata().get('GAIN'),
                               postIsrExp.getMetadata().get('GAIN'))
        self.assertAlmostEqual(ampExp.getDimensions()[0],
                               postIsrExp.getDimensions()[0])
        self.assertAlmostEqual(ampExp.getDimensions()[1],
                               postIsrExp.getDimensions()[1])
        self.assertAlmostEqual(afwMath.makeStatistics(
            postIsrExp.getMaskedImage(), afwMath.MEAN).getValue(),
                               2.855780,
                               places=3)
    def testRunDataRef(self):
        """Test LsstSimIsrTask on amp-sized images in tests/data/

        applyToSensorRef is not intended to take single amp-sized exposures, but will
        run if the doAssembleCcd config parameter is False.
        However, the exposure is not trimmed, and gain not reset.
        """
        config = LsstSimIsrTask.ConfigClass()
        config.doDark = False
        config.doFringe = False
        config.doAssembleCcd = False
        config.doSnapCombine = False
        lsstIsrTask = LsstSimIsrTask(config=config)
        exposure = lsstIsrTask.runDataRef(self.ampRef).exposure
        self.assertAlmostEqual(afwMath.makeStatistics(exposure.getMaskedImage(), afwMath.MEAN).getValue(),
                               2.855780, places=3)
    def testRun(self):
        """Test LsstSimIsrTask on amp-sized images in tests/data/

        Do not assembleCcd.
        """
        config = LsstSimIsrTask.ConfigClass()
        config.doDark = False
        config.doFringe = False
        config.doAssembleCcd = False
        config.doSnapCombine = False
        lsstIsrTask = LsstSimIsrTask(config=config)
        ampExp = self.ampRef.get('raw')
        isrData = lsstIsrTask.readIsrData(self.ampRef, ampExp)
        postIsrExp = lsstIsrTask.run(ampExp, **isrData.getDict()).exposure
        self.assertAlmostEqual(ampExp.getMetadata().get('GAIN'), postIsrExp.getMetadata().get('GAIN'))
        self.assertAlmostEqual(ampExp.getDimensions()[0], postIsrExp.getDimensions()[0])
        self.assertAlmostEqual(ampExp.getDimensions()[1], postIsrExp.getDimensions()[1])
        self.assertAlmostEqual(afwMath.makeStatistics(postIsrExp.getMaskedImage(), afwMath.MEAN).getValue(),
                               2.855780, places = 3)