Example #1
0
    def _configWepController(self, isrDir):
        """Configure the WEP controller.

        WEP: wavefront estimation pipeline.

        Parameters
        ----------
        isrDir : str
            ISR directory. This directory path will have the input and output
            that the data butler needs.

        Returns
        -------
        WepController
            Configured WEP controller.
        """

        dataCollector = CamDataCollector(isrDir)
        isrWrapper = CamIsrWrapper(isrDir)
        sourSelc = self._configSourceSelector()
        sourProc = self._configSourceProcessor()
        wfsEsti = self._configWfEstimator()
        wepCntlr = WepController(dataCollector, isrWrapper, sourSelc, sourProc,
                                 wfsEsti)

        return wepCntlr
Example #2
0
    def _ingestImages(cls):

        # Generate the camera mapper
        camDataCollector = CamDataCollector(cls.dataDir.name)
        camDataCollector.genPhoSimMapper()

        # Ingest the E image
        imgFilesEimg = os.path.join(
            getModulePath(),
            "tests",
            "testData",
            "repackagedFiles",
            "lsst_e_9006001_f1_R22_S00_E000.fits.gz",
        )
        camDataCollector.ingestEimages(imgFilesEimg)

        # Ingest the amplifier image
        imgFilesRaw = os.path.join(
            getModulePath(),
            "tests",
            "testData",
            "repackagedFiles",
            "lsst_a_20_f5_R00_S22_E000.fits",
        )
        camDataCollector.ingestImages(imgFilesRaw)
    def setUp(self):

        self.modulePath = getModulePath()
        self.dataDir = os.path.join(self.modulePath, "tests", "tmp")
        self.isrDir = os.path.join(self.dataDir, "input")
        self.opdDir = os.path.join(self.modulePath, "tests", "testData",
                                   "opdOutput", "9005000")

        self._makeDir(self.isrDir)

        # Configurate the WEP components
        dataCollector = CamDataCollector(self.isrDir)
        isrWrapper = CamIsrWrapper(self.isrDir)
        sourSelc = self._configSourceSelector()
        sourProc = self._configSourceProcessor()
        wfsEsti = self._configWfEstimator()

        # Instantiate the WEP controller
        self.wepCntlr = WepController(dataCollector, isrWrapper, sourSelc,
                                      sourProc, wfsEsti)

        # Intemediate data used in the test
        self.filter = FilterType.REF

        self.neighborStarMap = dict()
        self.starMap = dict()
        self.wavefrontSensors = dict()

        self.wfsImgMap = dict()
        self.donutMap = dict()
        self.masterDonutMap = dict()
    def setUp(self):

        self.modulePath = getModulePath()

        testDir = os.path.join(self.modulePath, "tests")
        self.dataDir = tempfile.TemporaryDirectory(dir=testDir)
        self.butlerInput = tempfile.TemporaryDirectory(dir=self.dataDir.name)
        self.opdDir = os.path.join(
            self.modulePath, "tests", "testData", "opdOutput", "9005000"
        )

        # Configurate the WEP components
        dataCollector = CamDataCollector(self.butlerInput.name)
        sourSelc = self._configSourceSelector()
        sourProc = SourceProcessor()
        wfEsti = self._configWfEstimator()

        # Instantiate the WEP controller
        self.wepCntlr = WepController(dataCollector, None, sourSelc, sourProc, wfEsti)

        # Intemediate data used in the test
        self.filter = FilterType.REF

        self.neighborStarMap = dict()
        self.starMap = dict()
        self.wavefrontSensors = dict()

        self.wfsImgMap = dict()
        self.donutMap = dict()
        self.masterDonutMap = dict()
Example #5
0
    def _configWepController(self, camType, settingFileName):
        """Configure the WEP controller.

        WEP: wavefront estimation pipeline.

        Parameters
        ----------
        camType : enum 'CamType'
            Camera type.
        settingFileName : str
            Setting file name.

        Returns
        -------
        WepController
            Configured WEP controller.
        """

        dataCollector = CamDataCollector(self.isrDir)
        isrWrapper = CamIsrWrapper(self.isrDir)

        bscDbType = self._getBscDbType()
        sourSelc = self._configSourceSelector(camType, bscDbType, settingFileName)

        sourProc = SourceProcessor(settingFileName=settingFileName)
        wfsEsti = self._configWfEstimator(camType)

        wepCntlr = WepController(dataCollector, isrWrapper, sourSelc, sourProc, wfsEsti)

        return wepCntlr
Example #6
0
    def testDoIsr(self):

        # Generate the camera mapper
        camDataCollector = CamDataCollector(self.isrDir)
        camDataCollector.genPhoSimMapper()

        # Generate the fake flat images
        fakeFlatDir = os.path.join(self.dataDir, "fake_flats")
        self._makeDir(fakeFlatDir)

        detector = "R00_S22"
        self._genFakeFlat(fakeFlatDir, detector)

        # Ingest the calibration images
        calibFiles = os.path.join(fakeFlatDir, "*")
        camDataCollector.ingestCalibs(calibFiles)

        # Ingest the raw images
        imgFiles = os.path.join(getModulePath(), "tests", "testData",
                                "repackagedFiles",
                                "lsst_a_20_f5_R00_S22_E000.fits")
        camDataCollector.ingestImages(imgFiles)

        # Do the ISR configuration
        self._doIsrConfig()

        # Do the ISR
        rerunName = "run1"
        self.camIsrWrapper.doISR(self.isrDir, rerunName=rerunName)

        # Check the condition
        postIsrCcdDir = os.path.join(self.isrDir, "rerun", rerunName,
                                     "postISRCCD")
        self.assertTrue(os.path.exists(postIsrCcdDir))
    def setUp(self):

        self.dataDir = os.path.join(getModulePath(), "tests", "tmp")
        self.isrDir = os.path.join(self.dataDir, "input")
        self._makeDir(self.isrDir)

        self.camDataCollector = CamDataCollector(self.isrDir)
Example #8
0
    def setUp(self):

        testDir = os.path.join(getModulePath(), "tests")
        self.dataDir = tempfile.TemporaryDirectory(dir=testDir)

        self.isrDir = tempfile.TemporaryDirectory(dir=self.dataDir.name)

        self.camDataCollector = CamDataCollector(self.isrDir.name)
Example #9
0
    def _getCamDataCollectorAndIngestCalibs(self, detector):

        # Generate the camera mapper
        camDataCollector = CamDataCollector(self.isrDir.name)
        camDataCollector.genPhoSimMapper()

        # Generate the fake flat images
        fakeFlatDir = tempfile.TemporaryDirectory(dir=self.dataDir.name)

        self._genFakeFlat(fakeFlatDir.name, detector)

        # Ingest the calibration images
        calibFiles = os.path.join(fakeFlatDir.name, "*")
        camDataCollector.ingestCalibs(calibFiles)

        return camDataCollector