Ejemplo n.º 1
0
    def _checkSkySourceColumnExistence(self, doSkySources):
        """Implements sky_source column checking.

        Parameters
        ----------
        doSkySource : `bool`
            Value of the config flag determining whether to insert sky sources.
        """
        charImConfig = CharacterizeImageConfig()
        charImConfig.measurePsf.psfDeterminer = 'piff'
        charImConfig.measurePsf.psfDeterminer['piff'].spatialOrder = 0
        charImTask = CharacterizeImageTask(config=charImConfig)
        charImResults = charImTask.run(self.exposure)
        calibConfig = CalibrateConfig()
        calibConfig.doAstrometry = False
        calibConfig.doPhotoCal = False
        calibConfig.doSkySources = doSkySources
        calibTask = CalibrateTask(config=calibConfig)
        calibResults = calibTask.run(charImResults.exposure)
        if doSkySources:
            self.assertTrue('sky_source' in calibResults.outputCat.schema.getNames())
        else:
            self.assertFalse('sky_source' in calibResults.outputCat.schema.getNames())