Ejemplo n.º 1
0
    def setupCharConfig(self, doCmodel=False):
        '''
        create the config for CaracterizeImageTask. Set up appropriate
        configurations for galsim data
        '''
        charConfig = CharacterizeImageConfig()
        # switch these off for simulated data
        charConfig.doMeasurePsf = False
        charConfig.doApCorr = False
        charConfig.repair.doCosmicRay = False
        charConfig.doDeblend = True

        # threshold detection
        charConfig.detection.thresholdValue = self.threshold
        charConfig.detection.includeThresholdMultiplier = 1.0
        charConfig.detection.minPixels = 1

        # these are parameters Lee set
        charConfig.installSimplePsf.fwhm = 5
        charConfig.installSimplePsf.width = 55

        if self.doCModel:
            charConfig.measurement.plugins.names |= ["ext_shapeHSM_HsmSourceMoments"]
            charConfig.measurement.plugins.names |= ["modelfit_DoubleShapeletPsfApprox", "modelfit_CModel"]
            charConfig.measurement.slots.modelFlux = 'modelfit_CModel'

        return charConfig
isrConfig.doBias = False
isrConfig.doDark = False
isrConfig.doFlat = False
isrConfig.doFringe = False
isrConfig.doDefect = False
isrConfig.doAddDistortionModel = False
isrConfig.doWrite = True
isrConfig.doAssembleCcd = True
isrConfig.expectWcs = False
isrConfig.doLinearize = False

charConfig = CharacterizeImageConfig()
charConfig.installSimplePsf.fwhm = 0.05
charConfig.doMeasurePsf = False
charConfig.doApCorr = False
charConfig.doDeblend = False
charConfig.repair.doCosmicRay = False
charConfig.repair.doInterpolate = False      
charConfig.detection.background.binSize = 128
charConfig.detection.minPixels = 5

# Now we characterize the spot sizes
if not spots_already_done:
    if new_spot_repo:
        step1 = Popen("rm -rf %s"%SPOTS_REPO_DIR, shell=True)
        Popen.wait(step1)
        step2 = Popen("mkdir -p %s/rerun/test/plots"%SPOTS_REPO_DIR, shell=True)
        Popen.wait(step2)
        step3 = Popen('echo "lsst.obs.lsst.ucd.UcdMapper" > %s/_mapper'%SPOTS_REPO_DIR, shell=True)
        Popen.wait(step3)