def setDefaults(self):
     Config.setDefaults(self)
     self.detection.reEstimateBackground = False
     self.detection.thresholdPolarity = "both"
     self.detection.doTempLocalBackground = False
     self.detection.thresholdType = "pixel_stdev"
     self.detection.thresholdValue = 3.0
Exemplo n.º 2
0
 def setDefaults(self):
     Config.setDefaults(self)
     self.bgModel2.doSmooth = True
     self.bgModel2.minFrac = 0.5
     self.bgModel2.xSize = 256
     self.bgModel2.ySize = 256
     self.bgModel2.smoothScale = 1.0
Exemplo n.º 3
0
    def setDefaults(self):
        """These defaults are suitable for HSC, but may be useful
        for other cameras if the focus code is employed elsewhere.
        """
        Config.setDefaults(self)
        zemaxBase = os.path.join(os.environ["OBS_SUBARU_DIR"], "hsc", "zemax_config%d_0.0.dat")
        self.zemax = dict([(f, zemaxBase % n) for f,n in [
                    ('g', 9), ('r', 1), ('i', 3), ('z', 5), ('y', 7),
                    ('N921', 5), ('N816', 3), ('N1010', 7), ('N387', 9), ('N515', 9),
                    ]])
        self.load(os.path.join(os.environ["OBS_SUBARU_DIR"], "config", "hsc", "isr.py"))
        self.installPsf.fwhm = 9 # pixels
        self.installPsf.width = 31 # pixels
        self.detectAndMeasure.detection.includeThresholdMultiplier = 3.0
        self.detectAndMeasure.measurement.algorithms.names.add("base_GaussianCentroid")
        self.detectAndMeasure.measurement.slots.centroid = "base_GaussianCentroid"
        # set up simple shape, if available (because focus calibrations are for that)
        # If it's not available, we'll crash later; but we don't want to crash here (brings everything down)!
        if haveSimpleShape:
            self.detectAndMeasure.measurement.algorithms.names.add("ext_simpleShape_SimpleShape")
            self.detectAndMeasure.measurement.algorithms["ext_simpleShape_SimpleShape"].sigma = 5.0 # pixels

        # set up background estimate
        self.background.ignoredPixelMask = ['EDGE', 'NO_DATA', 'DETECTED', 'DETECTED_NEGATIVE', 'BAD']
        self.detectAndMeasure.detection.background.algorithm='LINEAR'
        self.detectAndMeasure.doDeblend = False
        self.starSelector.badFlags = ["base_PixelFlags_flag_edge",
                                      "base_PixelFlags_flag_interpolatedCenter",
                                      "base_PixelFlags_flag_saturatedCenter",
                                      "base_PixelFlags_flag_bad",
                                      ]
        self.starSelector.sourceFluxField = "base_GaussianFlux_flux"
        self.starSelector.widthMax = 20.0
        self.starSelector.widthStdAllowed = 5.0
Exemplo n.º 4
0
 def validate(self):
     Config.validate(self)
     if self.extrapolated:
         if self.primaryBand is None or \
                 self.secondaryBand is None or \
                 self.tertiaryBand is None:
             raise RuntimeError(
                 "extrapolated requires primaryBand, secondaryBand, and "
                 "tertiaryBand are provided.")
Exemplo n.º 5
0
    def setDefaults(self):
        Config.setDefaults(self)
        self.bgModel2.doSmooth = True
        self.bgModel2.minFrac = 0.5
        self.bgModel2.xSize = 256
        self.bgModel2.ySize = 256
        self.bgModel2.smoothScale = 1.0

        self.quantum.dimensions = ("instrument", "visit")
Exemplo n.º 6
0
    def applyConfigOverrides(self, name: str, config: Config) -> None:
        """Apply instrument-specific overrides for a task config.

        Parameters
        ----------
        name : `str`
            Name of the object being configured; typically the _DefaultName
            of a Task.
        config : `lsst.pex.config.Config`
            Config instance to which overrides should be applied.
        """
        for root in self.configPaths:
            path = os.path.join(root, f"{name}.py")
            if os.path.exists(path):
                config.load(path)
Exemplo n.º 7
0
 def setDefaults(self):
     Config.setDefaults(self)
     # Set ISR processing to run up until we would be applying the CT
     # correction.  Applying subsequent stages may corrupt the signal.
     self.isr.doWrite = False
     self.isr.doOverscan = True
     self.isr.doAssembleCcd = True
     self.isr.doBias = True
     self.isr.doVariance = False  # This isn't used in the calculation below.
     self.isr.doLinearize = True  # This is the last ISR step we need.
     self.isr.doCrosstalk = False
     self.isr.doBrighterFatter = False
     self.isr.doDark = False
     self.isr.doStrayLight = False
     self.isr.doFlat = False
     self.isr.doFringe = False
     self.isr.doApplyGains = False
     self.isr.doDefect = True  # Masking helps remove spurious pixels.
     self.isr.doSaturationInterpolation = False
     self.isr.growSaturationFootprintSize = 0  # We want the saturation spillover: it's good signal.
Exemplo n.º 8
0
    def _readFile(self, path: str, pytype: Optional[Type[Any]] = None) -> Any:
        """Read a pex.config.Config instance from the given file.

        Parameters
        ----------
        path : `str`
            Path to use to open the file.
        pytype : `type`, optional
            Class to use to read the config file.

        Returns
        -------
        data : `lsst.pex.config.Config`
            Instance of class ``pytype`` read from config file. `None`
            if the file could not be opened.
        """
        if not os.path.exists(path):
            return None

        # Automatically determine the Config class from the serialized form
        with open(path, "r") as fd:
            config_py = fd.read()
        return Config._fromPython(config_py)
Exemplo n.º 9
0
 def setDefaults(self):
     Config.setDefaults(self)
     self.detection.thresholdType = "pixel_stdev"
     self.detection.isotropicGrow = True
     self.detection.background.undersampleStyle = 'REDUCE_INTERP_ORDER'
Exemplo n.º 10
0
 def setDefaults(self):
     Config.setDefaults(self)
     self.deblend.propagateAllPeaks = True
Exemplo n.º 11
0
 def validate(self):
     Config.validate(self)
     if len(self.priorityList) == 0:
         raise RuntimeError("No priority list provided")
 def setDefaults(self):
     Config.setDefaults(self)
     self.forcedPhotCoadd.references.retarget(MultiBandReferencesTask)
 def validate(self):
     Config.validate(self)
     if self.minSize and self.maxSize and self.minSize > self.maxSize:
         raise RuntimeError("minSize=%s > maxSize=%s" % (self.minSize, self.maxSize))
Exemplo n.º 14
0
 def setDefaults(self):
     Config.setDefaults(self)
     self.skyObjects.avoidMask = [
         "DETECTED"
     ]  # Nothing else is available in our custom mask
Exemplo n.º 15
0
 def setDefaults(self):
     Config.setDefaults(self)
     self.forcedPhotCoadd.references.retarget(MultiBandReferencesTask)
Exemplo n.º 16
0
 def setDefaults(self):
     Config.setDefaults(self)
     self.isr.doWrite = False
     self.isr.growSaturationFootprintSize = 0  # We want the saturation spillover: it's good signal
 def setDefaults(self):
     Config.setDefaults(self)
     # Don't need the full set of apertures because the larger ones aren't affected by the convolution
     self.aperture.radii = [3.3, 4.5, 6.0]
Exemplo n.º 18
0
 def validate(self):
     Config.validate(self)
     if self.minSize and self.maxSize and self.minSize > self.maxSize:
         raise RuntimeError("minSize=%s > maxSize=%s" % (self.minSize, self.maxSize))
Exemplo n.º 19
0
 def setDefaults(self):
     Config.setDefaults(self)
     self.formatTemplateNames({"inputCoaddName": 'deep', "outputCoaddName": "deep"})
     self.skyObjects.avoidMask = ["DETECTED"]  # Nothing else is available in our custom mask
     self.quantum.dimensions = ("Tract", "Patch", "SkyMap")
Exemplo n.º 20
0
 def testEmptyConfig(self):
     result = self.task.run(Config())
     self.assertIsNone(result.apdb)
Exemplo n.º 21
0
 def setDefaults(self):
     Config.setDefaults(self)
     self.isr.doWrite = False
     self.isr.growSaturationFootprintSize = 0  # We want the saturation spillover: it's good signal