Пример #1
0
class CullPeaksConfig(Config):
    """!
    @anchor CullPeaksConfig_

    @brief Configuration for culling garbage peaks after merging footprints.

    Peaks may also be culled after detection or during deblending; this configuration object
    only deals with culling after merging Footprints.

    These cuts are based on three quantities:
     - nBands: the number of bands in which the peak was detected
     - peakRank: the position of the peak within its family, sorted from brightest to faintest.
     - peakRankNormalized: the peak rank divided by the total number of peaks in the family.

    The formula that identifie peaks to cull is:

      nBands < nBandsSufficient
        AND (rank >= rankSufficient)
        AND (rank >= rankConsider OR rank >= rankNormalizedConsider)

    To disable peak culling, simply set nBandsSufficient=1.
    """

    nBandsSufficient = RangeField(dtype=int, default=2, min=1,
                                  doc="Always keep peaks detected in this many bands")
    rankSufficient = RangeField(dtype=int, default=20, min=1,
                                doc="Always keep this many peaks in each family")
    rankConsidered = RangeField(dtype=int, default=30, min=1,
                                doc=("Keep peaks with less than this rank that also match the "
                                     "rankNormalizedConsidered condition."))
    rankNormalizedConsidered = RangeField(dtype=float, default=0.7, min=0.0,
                                          doc=("Keep peaks with less than this normalized rank that"
                                               " also match the rankConsidered condition."))
Пример #2
0
class BackgroundConfig(Config):
    """Configuration for background measurement"""
    statistic = ChoiceField(dtype=str, default="MEANCLIP", doc="type of statistic to use for grid points",
                            allowed={"MEANCLIP": "clipped mean",
                                     "MEAN": "unclipped mean",
                                     "MEDIAN": "median",})
    xBinSize = RangeField(dtype=int, default=32, min=1, doc="Superpixel size in x")
    yBinSize = RangeField(dtype=int, default=32, min=1, doc="Superpixel size in y")
    algorithm = ChoiceField(dtype=str, default="NATURAL_SPLINE", optional=True,
                            doc="How to interpolate the background values. "
                                "This maps to an enum; see afw::math::Background",
                            allowed={
                                "CONSTANT": "Use a single constant value",
                                "LINEAR": "Use linear interpolation",
                                "NATURAL_SPLINE": "cubic spline with zero second derivative at endpoints",
                                "AKIMA_SPLINE": "higher-level nonlinear spline that is more robust to outliers",
                                "NONE": "No background estimation is to be attempted",
                            })
    mask = ListField(dtype=str, default=["SAT", "BAD", "EDGE", "DETECTED", "DETECTED_NEGATIVE", "NO_DATA",],
                     doc="Names of mask planes to ignore while estimating the background")
class ANetBasicAstrometryConfig(LoadAstrometryNetObjectsTask.ConfigClass):

    maxCpuTime = RangeField(
        doc="Maximum CPU time to spend solving, in seconds",
        dtype=float,
        default=0.,
        min=0.,
    )
    matchThreshold = RangeField(
        doc="Matching threshold for Astrometry.net solver (log-odds)",
        dtype=float,
        default=math.log(1e12),
        min=math.log(1e6),
    )
    maxStars = RangeField(
        doc="Maximum number of stars to use in Astrometry.net solving",
        dtype=int,
        default=50,
        min=10,
    )
    useWcsPixelScale = Field(
        doc="Use the pixel scale from the input exposure\'s WCS headers?",
        dtype=bool,
        default=True,
    )
    useWcsRaDecCenter = Field(
        doc=
        "Use the RA,Dec center information from the input exposure\'s WCS headers?",
        dtype=bool,
        default=True,
    )
    useWcsParity = Field(
        doc=
        "Use the parity (flip / handedness) of the image from the input exposure\'s WCS headers?",
        dtype=bool,
        default=True,
    )
    raDecSearchRadius = RangeField(
        doc=
        "When useWcsRaDecCenter=True, this is the radius, in degrees, around the RA,Dec center "
        + "specified in the input exposure\'s WCS to search for a solution.",
        dtype=float,
        default=1.0,
        min=0.0,
    )
    pixelScaleUncertainty = RangeField(
        doc=
        "Range of pixel scales, around the value in the WCS header, to search. "
        + "If the value of this field is X and the nominal scale is S, " +
        "the range searched will be  S/X to S*X",
        dtype=float,
        default=1.1,
        min=1.001,
    )
    catalogMatchDist = RangeField(
        doc=
        "Matching radius (arcsec) for matching sources to reference objects",
        dtype=float,
        default=1.0,
        min=0.0,
    )
    cleaningParameter = RangeField(
        doc="Sigma-clipping parameter in sip/cleanBadPoints.py",
        dtype=float,
        default=3.0,
        min=0.0,
    )
    calculateSip = Field(
        doc="Compute polynomial SIP distortion terms?",
        dtype=bool,
        default=True,
    )
    sipOrder = RangeField(
        doc="Polynomial order of SIP distortion terms",
        dtype=int,
        default=4,
        min=2,
    )
    badFlags = ListField(
        doc="List of flags which cause a source to be rejected as bad",
        dtype=str,
        default=[
            "slot_Centroid_flag",  # bad centroids
            "base_PixelFlags_flag_edge",
            "base_PixelFlags_flag_saturated",
            "base_PixelFlags_flag_crCenter",  # cosmic rays
        ],
    )
    allFluxes = Field(
        doc="Retrieve all available fluxes (and errors) from catalog?",
        dtype=bool,
        default=True,
    )
    maxIter = RangeField(
        doc="maximum number of iterations of match sources and fit WCS" +
        "ignored if not fitting a WCS",
        dtype=int,
        default=5,
        min=1,
    )
    matchDistanceSigma = RangeField(
        doc="The match and fit loop stops when maxMatchDist minimized: "
        " maxMatchDist = meanMatchDist + matchDistanceSigma*stdDevMatchDistance "
        +
        " (where the mean and std dev are computed using outlier rejection);" +
        " ignored if not fitting a WCS",
        dtype=float,
        default=2,
        min=0,
    )