Beispiel #1
0
    def setUp(self):
        """Generate a mock exposure/camera to test."""
        config = isrMock.IsrMockConfig()
        config.isTrimmed = True
        config.doGenerateImage = True
        config.doAddFringe = False
        config.doAddSource = False
        config.doAddSky = True
        config.doAddOverscan = False
        config.doAddCrosstalk = False
        config.doAddBias = False
        config.doAddDark = False
        config.doAddFlat = False
        config.doAddFringe = False

        config.skyLevel = 1000
        config.rngSeed = 12345
        self.inputExp = isrMock.IsrMock(config=config).run()

        # These are simulated defects
        self.inputExp.getImage().getArray()[0, 0] = -1.0 * self.defectFlux
        self.inputExp.getImage().getArray()[40, 50] = self.defectFlux
        self.inputExp.getImage().getArray()[75, 50] = np.nan

        updateMockExp(self.inputExp, addCR=False)

        self.inputExp.getMask().getArray()[0, 0] = 1
        self.inputExp.getMask().getArray()[40, 50] = 1
        self.inputExp.getMask().getArray()[75, 50] = 1

        self.camera = isrMock.IsrMock().getCamera()
Beispiel #2
0
    def test_edgeCases(self):
        """Test that improperly specified configurations do not return data.
        """
        config = isrMock.IsrMockConfig()
        self.assertIsNone(isrMock.IsrMock(config=config).run())

        with self.assertRaises(RuntimeError):
            config.doGenerateData = True
            isrMock.IsrMock(config=config).run()
Beispiel #3
0
    def setUp(self):
        self.config = IsrTaskConfig()
        self.config.qa = IsrQaConfig()
        self.task = IsrTask(config=self.config)
        self.dataRef = isrMock.DataRefMock()
        self.camera = isrMock.IsrMock().getCamera()

        self.inputExp = isrMock.TrimmedRawMock().run()
        self.amp = self.inputExp.getDetector()[0]
        self.mi = self.inputExp.getMaskedImage()
    def test_addDistortionModel(self):
        """Expect RuntimeError if no model supplied, or incomplete exposure information.
        """
        camera = isrMock.IsrMock().getCamera()
        ipIsr.addDistortionModel(self.inputExp, camera)

        with self.assertRaises(RuntimeError):
            ipIsr.addDistortionModel(self.inputExp, None)

            self.inputExp.setDetector(None)
            ipIsr.addDistortionModel(self.inputExp, camera)

            self.inputExp.setWcs(None)
            ipIsr.addDistortionModel(self.inputExp, camera)
Beispiel #5
0
    def setUp(self):
        self.config = IsrTaskConfig()
        self.config.qa = IsrQaConfig()
        self.task = IsrTask(config=self.config)

        self.mockConfig = isrMock.IsrMockConfig()
        self.mockConfig.isTrimmed = False
        self.doGenerateImage = True
        self.dataRef = isrMock.DataRefMock(config=self.mockConfig)
        self.camera = isrMock.IsrMock(config=self.mockConfig).getCamera()

        self.inputExp = isrMock.RawMock(config=self.mockConfig).run()
        self.amp = self.inputExp.getDetector()[0]
        self.mi = self.inputExp.getMaskedImage()
Beispiel #6
0
    def setUp(self):
        """Generate a mock exposure/camera to test."""
        config = isrMock.IsrMockConfig()
        config.isTrimmed = True
        config.rngSeed = 12345
        biasExposure = isrMock.BiasMock(config=config).run()

        config.rngSeed = 54321
        fakeBias = isrMock.BiasMock(config=config).run()

        self.inputExp = biasExposure.clone()
        mi = self.inputExp.getMaskedImage()
        mi.scaledMinus(1.0, fakeBias.getMaskedImage())
        updateMockExp(self.inputExp)

        self.camera = isrMock.IsrMock().getCamera()
Beispiel #7
0
    def setUp(self):
        """Generate a mock exposure/camera to test."""
        config = isrMock.IsrMockConfig()
        config.isTrimmed = True
        config.rngSeed = 12345
        darkExposure = isrMock.DarkMock(config=config).run()

        config.rngSeed = 54321
        fakeDark = isrMock.DarkMock(config=config).run()

        self.inputExp = darkExposure.clone()
        mi = self.inputExp.getMaskedImage()
        mi.scaledMinus(1.0, fakeDark.getMaskedImage())
        updateMockExp(self.inputExp)

        # Use this to test the metadataStats code, as this is the case
        # it's designed to fix.
        metadataContents = TaskMetadata()
        metadataContents["RESIDUAL STDEV C:0,0"] = 12.0
        metadataContents["RESIDUAL STDEV"] = 24.0
        self.metadata = TaskMetadata()
        self.metadata["subGroup"] = metadataContents

        self.camera = isrMock.IsrMock().getCamera()
Beispiel #8
0
    def setUp(self):
        """Generate a mock exposure/camera to test."""
        self.inputExp = isrMock.CalibratedRawMock().run()
        self.camera = isrMock.IsrMock().getCamera()

        updateMockExp(self.inputExp)