Exemplo n.º 1
0
class Gen3DatasetIngestConfig(pexConfig.Config):
    """Settings and defaults for `Gen3DatasetIngestTask`.

    The correct target for `ingester` can be found in the documentation of
    the appropriate ``obs`` package.
    """

    ingester = pexConfig.ConfigurableField(
        target=lsst.obs.base.RawIngestTask,
        doc="Task used to perform raw data ingestion.",
    )
    visitDefiner = pexConfig.ConfigurableField(
        target=lsst.obs.base.DefineVisitsTask,
        doc="Task used to organize raw exposures into visits.",
    )
    # Normally file patterns should be user input, but put them in a config so
    # the ap_verify dataset can configure them
    dataFiles = pexConfig.ListField(
        dtype=str,
        default=["*.fits", "*.fz", "*.fits.gz"],
        doc="Names of raw science files (no path; wildcards allowed) to ingest from the ap_verify dataset.",
    )
    dataBadFiles = pexConfig.ListField(
        dtype=str,
        default=[],
        doc="Names of raw science files (no path; wildcards allowed) to not ingest, "
            "supersedes ``dataFiles``.",
    )
Exemplo n.º 2
0
class CoaddConfig(pex_config.Config):
    saveDebugImages = pex_config.Field(
        doc="Save intermediate images?",
        dtype=bool,
        default=False,
    )
    bboxMin = pex_config.ListField(
        doc="Lower left corner of bounding box used to subframe to all input"
        "images",
        dtype=int,
        default=(0, 0),
        length=2,
    )
    bboxSize = pex_config.ListField(
        doc="Size of bounding box used to subframe all input images; 0 0 for "
        "full input images",
        dtype=int,
        default=(0, 0),
        length=2,
    )
    coaddZeroPoint = pex_config.Field(
        dtype=float,
        doc="Photometric zero point of coadd (mag).",
        default=27.0,
    )
    coadd = pex_config.ConfigField(dtype=Coadd.ConfigClass, doc="")
Exemplo n.º 3
0
class BaseMakeQaTractTablesTaskConfig(pipeBase.PipelineTaskConfig,
                                      pipelineConnections=BaseMakeQaTractTablesTaskConnections):
    # TODO: remove the filterMap config song and dance once DM-28475 lands
    filterMap = pexConfig.DictField(
        keytype=str, itemtype=str,
        default={},
        doc=("Dictionary mapping canonical band to the camera's physical filter.  This is currently "
             "required for {coaddName}Coadd_obj that are indexed on the latter as the dataId supplied "
             "will only contain the former (this will likely become unnecessary once the postprocess "
             "scripts are updated to index on band).")
    )
    baseColStrList = pexConfig.ListField(
        dtype=str,
        default=["coord", "tract", "patch", "visit", "ccd", "base_PixelFlags", "base_GaussianFlux",
                 "base_PsfFlux", "base_CircularApertureFlux_9_0_instFlux", "base_CircularApertureFlux_12_0",
                 "base_CircularApertureFlux_25_0", "ext_photometryKron_KronFlux", "modelfit_CModel",
                 "base_Sdss", "slot_Centroid", "slot_Shape", "ext_shapeHSM_HsmSourceMoments_",
                 "ext_shapeHSM_HsmPsfMoments_", "ext_shapeHSM_HsmShapeRegauss_", "base_Footprint",
                 "base_FPPosition", "base_ClassificationExtendedness", "parent", "detect", "deblend_nChild",
                 "base_Blendedness_abs", "base_Blendedness_flag", "base_InputCount",
                 "merge_peak_sky", "merge_measurement", "calib", "sky_source"],
        doc=("List of \"prefix\" strings of column names to load from deepCoadd_obj parquet table. "
             "All columns that start with one of these strings will be loaded UNLESS the full column "
             "name contains one of the strings listed in the notInColumnStrList config.")
    )
    notInColStrList = pexConfig.ListField(
        dtype=str,
        default=["flag_bad", "flag_no", "missingDetector_flag", "_region_", "Truncated", "_radius",
                 "_bad_", "initial", "_exp_", "_dev_", "fracDev", "objective", "SdssCentroid_flag_",
                 "SdssShape_flag_u", "SdssShape_flag_m", "_Cov", "_child_", "_parent_"],
        doc=("List of substrings to select against when creating list of columns to load from the "
             "deepCoadd_obj parquet table.")
    )
Exemplo n.º 4
0
class SubSequence(BaseSequence):
    """Configuration for sub-sequences.
    """

    name = pexConfig.Field('The identifier for the sub-sequence.', str)
    filters = pexConfig.ListField(
        'The list of filters required for the sub-sequence.', str)
    visits_per_filter = pexConfig.ListField(
        'The number of visits required for each filter in the '
        'sub-sequence.', int)

    def setDefaults(self):
        """Default specification for SubSequence information.
        """
        BaseSequence.setDefaults(self)
        self.filters = []
        self.visits_per_filter = []

    def get_filter_string(self):
        """A string representation of the filter list parameter.

        Returns
        -------
        str
        """
        return ",".join(self.filters)
Exemplo n.º 5
0
class OpticsLoopCorr(pexConfig.Config):
    """Configuration of the LSST Optics Loop Corrections.
    """

    tel_optics_ol_slope = pexConfig.Field('Delay factor for Open Loop optics correction '
                                          '(units=seconds/degrees in ALT slew)', float)

    # Table of delay factors for Closed Loop optics correction according to the ALT slew range.
    tel_optics_cl_alt_limit = pexConfig.ListField('Altitude (units=degrees) limits for the delay ranges.',
                                                  float)

    tel_optics_cl_delay = pexConfig.ListField('Time delay (units=seconds) for the corresponding ALT slew '
                                              'range in the Closed Loop optics correction.', float)

    def setDefaults(self):
        """Set defaults for the LSST Optics Loop Corrections.
        """
        self.tel_optics_ol_slope = 1.0 / 3.5
        self.tel_optics_cl_alt_limit = [0.0, 9.0, 90.0]
        self.tel_optics_cl_delay = [0.0, 20.0]

    def set_array(self, conf, param):
        """Set a DDS topic array parameter.

        Parameters
        ----------
        conf : SALPY_scheduler.scheduler_opticsLoopCorrConfigC
            The optics loop corrections configuration instance.
        param : str
            The name of the topic parameter to fill.
        """
        array = getattr(conf, param)
        local_param = getattr(self, param)
        for i, v in enumerate(local_param):
            array[i] = v
Exemplo n.º 6
0
class RequireFlags(pexConfig.Config):
    """Select sources using flags

    This object can be used as a `lsst.pex.config.Config` for configuring
    the limit, and then the `apply` method can be used to identify sources
    in the catalog that match the configured limit.
    """
    good = pexConfig.ListField(dtype=str, default=[],
                               doc="List of source flag fields that must be set for a source to be used.")
    bad = pexConfig.ListField(dtype=str, default=[],
                              doc="List of source flag fields that must NOT be set for a source to be used.")

    def apply(self, catalog):
        """Apply the flag requirements to a catalog

        Returns whether the source is selected.

        Parameters
        ----------
        catalog : `lsst.afw.table.SourceCatalog`
            Catalog of sources to which the requirements will be applied.

        Returns
        -------
        selected : `numpy.ndarray`
            Boolean array indicating for each source whether it is selected
            (True means selected).
        """
        selected = np.ones(len(catalog), dtype=bool)
        for flag in self.good:
            selected &= catalog[flag]
        for flag in self.bad:
            selected &= ~catalog[flag]
        return selected
Exemplo n.º 7
0
class ExampleConfig(pexConfig.Config):
    """Config for argument parser example
    """
    oneInt = pexConfig.Field(
        dtype=int,
        doc="Example integer value",
        default=1,
    )
    oneFloat = pexConfig.Field(
        dtype=float,
        doc="Example float value",
        default=3.14159265358979,
    )
    oneStr = pexConfig.Field(
        dtype=str,
        doc="Example string value",
        default="default value",
    )
    intList = pexConfig.ListField(
        dtype=int,
        doc="example list of integers",
        default=[-1, 0, 1],
    )
    floatList = pexConfig.ListField(
        dtype=float,
        doc="example list of floats",
        default=[-2.7, 0, 3.7e42],
    )
    strList = pexConfig.ListField(
        dtype=str,
        doc="example list of strings",
        default=["a", "bb", "ccc"],
    )
Exemplo n.º 8
0
class Survey(pexConfig.Config):
    """Configuration for the survey.
    """
    start_date = pexConfig.Field("The start date (format=YYYY-MM-DD) of the survey.", str)
    duration = pexConfig.Field("The fractional duration (units=years) of the survey.", float)
    idle_delay = pexConfig.Field("The delay (units=seconds) to skip the simulation time forward when "
                                 "not receiving a target.", float)
    general_proposals = pexConfig.ListField("The list of available general proposals.", str)
    sequence_proposals = pexConfig.ListField("The list of available sequence proposals.", str)
    alt_proposal_dir = pexConfig.Field("An alternative directory location for proposals.", str, optional=True)

    def setDefaults(self):
        """Set defaults for the survey.
        """
        self.start_date = "2022-10-01"
        self.duration = 10.0
        self.idle_delay = 60.0
        sci_prop = ScienceProposals()
        self.general_proposals = sci_prop.general_proposals
        self.sequence_proposals = sci_prop.sequence_proposals

    @property
    def full_duration(self):
        """The full duration of the survey in days.

        Returns
        -------
        double
        """
        days_duration = self.duration * DAYS_IN_YEAR
        if days_duration > BASELINE_SURVEY_DURATION:
            return days_duration
        else:
            return BASELINE_SURVEY_DURATION
Exemplo n.º 9
0
class PsfMatchConfigAL(PsfMatchConfig):
    """The parameters specific to the "Alard-Lupton" (sum-of-Gaussian) Psf-matching basis"""

    def setDefaults(self):
        PsfMatchConfig.setDefaults(self)
        self.kernelBasisSet = "alard-lupton"
        self.maxConditionNumber = 5.0e7

    alardNGauss = pexConfig.Field(
        dtype=int,
        doc="Number of base Gaussians in alard-lupton kernel basis function generation.",
        default=3,
        check=lambda x: x >= 1
    )
    alardDegGauss = pexConfig.ListField(
        dtype=int,
        doc="Polynomial order of spatial modification of base Gaussians. "
            "List length must be `alardNGauss`.",
        default=(4, 2, 2),
    )
    alardSigGauss = pexConfig.ListField(
        dtype=float,
        doc="Default sigma values in pixels of base Gaussians. "
            "List length must be `alardNGauss`.",
        default=(0.7, 1.5, 3.0),
    )
    alardGaussBeta = pexConfig.Field(
        dtype=float,
        doc="Used if `scaleByFwhm==True`, scaling multiplier of base "
            "Gaussian sigmas for automated sigma determination",
        default=2.0,
        check=lambda x: x >= 0.0,
    )
    alardMinSig = pexConfig.Field(
        dtype=float,
        doc="Used if `scaleByFwhm==True`, minimum sigma (pixels) for base Gaussians",
        default=0.7,
        check=lambda x: x >= 0.25
    )
    alardDegGaussDeconv = pexConfig.Field(
        dtype=int,
        doc="Used if `scaleByFwhm==True`, degree of spatial modification of ALL base Gaussians "
            "in AL basis during deconvolution",
        default=3,
        check=lambda x: x >= 1
    )
    alardMinSigDeconv = pexConfig.Field(
        dtype=float,
        doc="Used if `scaleByFwhm==True`, minimum sigma (pixels) for base Gaussians during deconvolution; "
            "make smaller than `alardMinSig` as this is only indirectly used",
        default=0.4,
        check=lambda x: x >= 0.25
    )
    alardNGaussDeconv = pexConfig.Field(
        dtype=int,
        doc="Used if `scaleByFwhm==True`, number of base Gaussians in AL basis during deconvolution",
        default=3,
        check=lambda x: x >= 1
    )
Exemplo n.º 10
0
class SnapCombineConfig(pexConfig.Config):
    doRepair = pexConfig.Field(
        dtype=bool,
        doc="Repair images (CR reject and interpolate) before combining",
        default=True,
    )
    repairPsfFwhm = pexConfig.Field(
        dtype=float,
        doc="Psf FWHM (pixels) used to detect CRs",
        default=2.5,
    )
    doDiffIm = pexConfig.Field(
        dtype=bool,
        doc="Perform difference imaging before combining",
        default=False,
    )
    doPsfMatch = pexConfig.Field(
        dtype=bool,
        doc="Perform PSF matching for difference imaging (ignored if doDiffIm false)",
        default=True,
    )
    doMeasurement = pexConfig.Field(
        dtype=bool,
        doc="Measure difference sources (ignored if doDiffIm false)",
        default=True,
    )
    badMaskPlanes = pexConfig.ListField(
        dtype=str,
        doc="Mask planes that, if set, the associated pixels are not included in the combined exposure; "
        "DETECTED excludes cosmic rays",
        default=("DETECTED",),
    )
    averageKeys = pexConfig.ListField(
        dtype=str,
        doc="List of float metadata keys to average when combining snaps, e.g. float positions and dates; "
        "non-float data must be handled by overriding the fixMetadata method",
        optional=True,

    )
    sumKeys = pexConfig.ListField(
        dtype=str,
        doc="List of float or int metadata keys to sum when combining snaps, e.g. exposure time; "
        "non-float, non-int data must be handled by overriding the fixMetadata method",
        optional=True,
    )

    repair = pexConfig.ConfigurableField(target=RepairTask, doc="")
    diffim = pexConfig.ConfigurableField(target=SnapPsfMatchTask, doc="")
    detection = pexConfig.ConfigurableField(target=SourceDetectionTask, doc="")
    initialPsf = pexConfig.ConfigField(dtype=InitialPsfConfig, doc="")
    measurement = pexConfig.ConfigurableField(target=SingleFrameMeasurementTask, doc="")

    def setDefaults(self):
        self.detection.thresholdPolarity = "both"

    def validate(self):
        if self.detection.thresholdPolarity != "both":
            raise ValueError("detection.thresholdPolarity must be 'both' for SnapCombineTask")
Exemplo n.º 11
0
class PsfMatchConfigAL(PsfMatchConfig):
    """!The parameters specific to the "Alard-Lupton" (sum-of-Gaussian) Psf-matching basis"""

    def setDefaults(self):
        PsfMatchConfig.setDefaults(self)
        self.kernelBasisSet = "alard-lupton"
        self.maxConditionNumber = 5.0e7

    alardNGauss = pexConfig.Field(
        dtype=int,
        doc="Number of Gaussians in alard-lupton basis",
        default=3,
        check=lambda x: x >= 1
    )
    alardDegGauss = pexConfig.ListField(
        dtype=int,
        doc="Polynomial order of spatial modification of Gaussians.  Must in number equal alardNGauss",
        default=(4, 2, 2),
    )
    alardSigGauss = pexConfig.ListField(
        dtype=float,
        doc="""Sigma in pixels of Gaussians (FWHM = 2.35 sigma).  Must in number equal alardNGauss""",
        default=(0.7, 1.5, 3.0),
    )
    alardGaussBeta = pexConfig.Field(
        dtype=float,
        doc="""Default scale factor between Gaussian sigmas """,
        default=2.0,
        check=lambda x: x >= 0.0,
    )
    alardMinSig = pexConfig.Field(
        dtype=float,
        doc="""Minimum Sigma (pixels) for Gaussians""",
        default=0.7,
        check=lambda x: x >= 0.25
    )
    alardDegGaussDeconv = pexConfig.Field(
        dtype=int,
        doc="""Degree of spatial modification of ALL gaussians in AL basis during deconvolution""",
        default=3,
        check=lambda x: x >= 1
    )
    alardMinSigDeconv = pexConfig.Field(
        dtype=float,
        doc="""Minimum Sigma (pixels) for Gaussians during deconvolution;
        make smaller than alardMinSig as this is only indirectly used""",
        default=0.4,
        check=lambda x: x >= 0.25
    )
    alardNGaussDeconv = pexConfig.Field(
        dtype=int,
        doc="Number of Gaussians in AL basis during deconvolution",
        default=3,
        check=lambda x: x >= 1
    )
Exemplo n.º 12
0
class PhotCompareQaConfig(pexConfig.Config):

    cameras = pexConfig.ListField(dtype=str,
                                  doc="Cameras to run PhotCompareQaTask",
                                  default=("lsstSim", "hscSim", "suprimecam",
                                           "cfht", "sdss", "coadd"))
    magCut = pexConfig.Field(
        dtype=float,
        doc="Faintest magnitude for establishing photometric RMS",
        default=20.0)
    deltaMin = pexConfig.Field(dtype=float,
                               doc="Minimum allowed delta",
                               default=-0.02)
    deltaMax = pexConfig.Field(dtype=float,
                               doc="Maximum allowed delta",
                               default=0.02)
    rmsMax = pexConfig.Field(
        dtype=float,
        doc="Maximum allowed photometric RMS on bright end",
        default=0.02)
    derrMax = pexConfig.Field(
        dtype=float,
        doc="Maximum allowed error bar underestimate on bright end",
        default=0.01)
    slopeMinSigma = pexConfig.Field(
        dtype=float,
        doc="Minimum (positive valued) std.devs. of slope below slope=0",
        default=3.5)
    slopeMaxSigma = pexConfig.Field(
        dtype=float,
        doc="Maximum std.dev. of slope above slope=0",
        default=3.5)

    compareTypes = pexConfig.ListField(
        dtype=str,
        doc="Photometric Error: qaAnalysis.PhotCompareQaAnalysis",
        default=("psf cat", "psf ap", "psf mod", "ap cat", "psf inst",
                 "inst cat", "mod cat", "mod inst"))

    # allowed = {
    #    "psf cat"  : "Compare Psf magnitudes to catalog magnitudes",
    #    "psf ap"   : "Compare Psf and aperture magnitudes",
    #    "psf mod"  : "Compare Psf and model magnitudes",
    #    "ap cat"   : "Compare Psf and model magnitudes",
    #    "psf inst" : "Compare PSF and instrument magnitudes",
    #    "inst cat" : "Compare Inst (Gaussian) and catalog magnitudes",
    #    "mod cat"  : "Compare model and catalog magnitudes",
    #    "mod inst" : "Separate stars/gxys for model and inst (Gaussian) magnitudes"
    # }
    #

    starGalaxyToggle = pexConfig.ListField(
        dtype=str,
        doc="Make separate figures for stars and galaxies.",
        default=("mod cat", "inst cat", "ap cat", "psf cat"))
Exemplo n.º 13
0
class FgcmMakeLutConfig(pexConfig.Config):
    """Config for FgcmMakeLutTask"""

    filterNames = pexConfig.ListField(
        doc="Filter names to build LUT ('short' names)",
        dtype=str,
        default=None,
    )
    stdFilterNames = pexConfig.ListField(
        doc=("Standard filterNames ('short' names). "
             "Each filter in filterName will be calibrated to a matched "
             "stdFilterName.  In regular usage, one has g->g, r->r, ... "
             "In the case of HSC, one would have g->g, r->r2, r2->r2, ... "
             "which allows replacement (or time-variable) filters to be "
             "properly cross-calibrated."),
        dtype=str,
        default=None,
    )
    atmosphereTableName = pexConfig.Field(
        doc="FGCM name or filename of precomputed atmospheres",
        dtype=str,
        default=None,
        optional=True,
    )
    parameters = pexConfig.ConfigField(
        doc="Atmosphere parameters (required if no atmosphereTableName)",
        dtype=FgcmMakeLutParametersConfig,
        default=None,
        check=None)

    def validate(self):
        """
        Validate the config parameters.

        This method behaves differently from the parent validate in the case
        that atmosphereTableName is set.  In this case, the config values
        for standard values, step sizes, and ranges are loaded
        directly from the specified atmosphereTableName.
        """
        # check that filterNames and stdFilterNames are okay
        self._fields['filterNames'].validate(self)
        self._fields['stdFilterNames'].validate(self)

        # check if we have an atmosphereTableName, and if valid
        if self.atmosphereTableName is not None:
            try:
                fgcm.FgcmAtmosphereTable.initWithTableName(
                    self.atmosphereTableName)
            except IOError:
                raise RuntimeError("Could not find atmosphereTableName: %s" %
                                   (self.atmosphereTableName))
        else:
            # Validate the parameters
            self._fields['parameters'].validate(self)
Exemplo n.º 14
0
class PsfMatchConfigAL(PsfMatchConfig):
    """The parameters specific to the "Alard-Lupton" (sum-of-Gaussian) Psf-matching basis"""
    def setDefaults(self):
        PsfMatchConfig.setDefaults(self)
        self.kernelBasisSet = "alard-lupton"
        self.maxConditionNumber = 5.0e7

    alardNGauss = pexConfig.Field(
        dtype=int,
        doc="Number of Gaussians in alard-lupton basis",
        default=3,
        check=lambda x: x >= 1)
    alardDegGauss = pexConfig.ListField(
        dtype=int,
        doc=
        "Polynomial order of spatial modification of Gaussian basis functions. "
        "List length must be `alardNGauss`.",
        default=(4, 2, 2),
    )
    alardSigGauss = pexConfig.ListField(
        dtype=float,
        doc="Default sigma values in pixels of Gaussian kernel base functions. "
        "List length must be `alardNGauss`.",
        default=(0.7, 1.5, 3.0),
    )
    alardGaussBeta = pexConfig.Field(
        dtype=float,
        doc=
        """Multiplier of Gaussian sigmas between adjacent elements of the kernel basis list.""",
        default=2.0,
        check=lambda x: x >= 0.0,
    )
    alardMinSig = pexConfig.Field(
        dtype=float,
        doc="""Minimum Sigma (pixels) for Gaussians""",
        default=0.7,
        check=lambda x: x >= 0.25)
    alardDegGaussDeconv = pexConfig.Field(
        dtype=int,
        doc=
        """Degree of spatial modification of ALL gaussians in AL basis during deconvolution""",
        default=3,
        check=lambda x: x >= 1)
    alardMinSigDeconv = pexConfig.Field(
        dtype=float,
        doc="Minimum Sigma (pixels) for Gaussians during deconvolution; "
        "make smaller than alardMinSig as this is only indirectly used",
        default=0.4,
        check=lambda x: x >= 0.25)
    alardNGaussDeconv = pexConfig.Field(
        dtype=int,
        doc="Number of Gaussians in AL basis during deconvolution",
        default=3,
        check=lambda x: x >= 1)
Exemplo n.º 15
0
class QuantumConfig(pexConfig.Config):
    """Configuration class which defines PipelineTask quanta dimensions.

    In addition to a list of dataUnit names this also includes optional list of
    SQL statements to be executed against Registry database. Exact meaning and
    format of SQL will be determined at later point.
    """
    dimensions = pexConfig.ListField(
        dtype=str, doc="list of Dimensions which define quantum")
    sql = pexConfig.ListField(dtype=str,
                              doc="sequence of SQL statements",
                              optional=True)
Exemplo n.º 16
0
class MergeMeasurementsConfig(PipelineTaskConfig, pipelineConnections=MergeMeasurementsConnections):
    """!
    @anchor MergeMeasurementsConfig_

    @brief Configuration parameters for the MergeMeasurementsTask
    """
    pseudoFilterList = pexConfig.ListField(
        dtype=str,
        default=["sky"],
        doc="Names of filters which may have no associated detection\n"
        "(N.b. should include MergeDetectionsConfig.skyFilterName)"
    )
    snName = pexConfig.Field(
        dtype=str,
        default="base_PsfFlux",
        doc="Name of flux measurement for calculating the S/N when choosing the reference band."
    )
    minSN = pexConfig.Field(
        dtype=float,
        default=10.,
        doc="If the S/N from the priority band is below this value (and the S/N "
        "is larger than minSNDiff compared to the priority band), use the band with "
        "the largest S/N as the reference band."
    )
    minSNDiff = pexConfig.Field(
        dtype=float,
        default=3.,
        doc="If the difference in S/N between another band and the priority band is larger "
        "than this value (and the S/N in the priority band is less than minSN) "
        "use the band with the largest S/N as the reference band"
    )
    flags = pexConfig.ListField(
        dtype=str,
        doc="Require that these flags, if available, are not set",
        default=["base_PixelFlags_flag_interpolatedCenter", "base_PsfFlux_flag",
                 "ext_photometryKron_KronFlux_flag", "modelfit_CModel_flag", ]
    )
    priorityList = pexConfig.ListField(
        dtype=str,
        default=[],
        doc="Priority-ordered list of filter bands for the merge."
    )
    coaddName = pexConfig.Field(
        dtype=str,
        default="deep",
        doc="Name of coadd"
    )

    def validate(self):
        super().validate()
        if len(self.priorityList) == 0:
            raise RuntimeError("No priority list provided")
Exemplo n.º 17
0
class CloudModelConfig(pexConfig.Config):
    """A pex_config configuration class for default seeing model parameters.
    """
    efd_columns = pexConfig.ListField(doc="List of data required from EFD",
                                      dtype=str,
                                      default=['cloud'])
    efd_delta_time = pexConfig.Field(
        doc="Length (delta time) of history to request from the EFD (seconds)",
        dtype=float,
        default=0)
    target_columns = pexConfig.ListField(
        doc="Names of the keys for (altitude, azimuth) from the "
        "scheduler target maps",
        dtype=str,
        default=['altitude', 'azimuth'])
class NoiseCoaddConfig(pexConfig.Config):
    saveDebugImages = pexConfig.Field(
        dtype=bool,
        doc="Save warped intermediate images?",
        default=False,
    )
    imageShape = pexConfig.ListField(
        dtype=int,
        doc="Constant value of variance pixels",
        length=2,
        default=(256, 256),
    )
    imageSigma = pexConfig.Field(
        dtype=float,
        doc="Sigma of Gaussian noise for image pixels",
        default=1.0,
    )
    variance = pexConfig.Field(
        dtype=float,
        doc="Constant value of variance pixels",
        default=1.0,
    )
    warp = pexConfig.ConfigField(
        dtype=afwMath.Warper.ConfigClass,
        doc="Policy to control warping.",
    )
    coadd = pexConfig.ConfigField(
        dtype=coaddChiSq.Coadd.ConfigClass,
        doc="Policy to control coadd.",
    )
Exemplo n.º 19
0
class TransformConfig(pexConfig.Config):
    """!Configuration for TransformTask."""
    copyFields = pexConfig.ListField(
        dtype=str,
        doc=
        "Fields to copy from input to output catalog without transformation",
        default=('id', 'coord_ra', 'coord_dec'))
Exemplo n.º 20
0
class DowntimeModelConfig(pexConfig.Config):
    """A pex_config configuration class for default seeing model parameters.
    """
    efd_columns = pexConfig.ListField(
        doc="List of data required from EFD",
        dtype=str,
        default=['scheduled_downtimes', 'unscheduled_downtimes'])
    efd_delta_time = pexConfig.Field(
        doc="Length (delta time) of history to request from the EFD (seconds)",
        dtype=float,
        default=0)
    target_columns = pexConfig.ListField(
        doc="Names of the keys required in the "
        "scheduler target maps (time)",
        dtype=str,
        default=['time'])
Exemplo n.º 21
0
class BandFilter(pexConfig.Config):
    """Configuration for a proposal filter.
    """
    name = pexConfig.Field('Band name of the filter.', str)
    bright_limit = pexConfig.Field('Brightest magnitude limit for filter.',
                                   float)
    dark_limit = pexConfig.Field('Darkest magnitude limit for filter.', float)
    max_seeing = pexConfig.Field('The maximum seeing limit for filter', float)
    exposures = pexConfig.ListField(
        'The list of exposure times (units=seconds) for the filter', float)

    def setDefaults(self):
        """Default specification for a filter.
        """
        self.name = "u"
        self.bright_limit = 21.0
        self.dark_limit = 30.0
        self.max_seeing = 2.0
        self.exposures = [15.0, 15.0]

    def validate(self):
        """Validate configuration parameters.
        """
        pexConfig.Config.validate(self)
        if self.bright_limit > self.dark_limit:
            self.bright_limit, self.dark_limit = self.dark_limit, self.bright_limit
Exemplo n.º 22
0
class Simple(pexConfig.Config):
    i = pexConfig.Field("integer test", int, optional=True)
    f = pexConfig.Field("float test", float, default=3.0)
    b = pexConfig.Field("boolean test", bool, default=False, optional=False)
    c = pexConfig.ChoiceField("choice test",
                              str,
                              default="Hello",
                              allowed={
                                  "Hello": "First choice",
                                  "World": "second choice"
                              })
    r = pexConfig.RangeField("Range test",
                             float,
                             default=3.0,
                             optional=False,
                             min=3.0,
                             inclusiveMin=True)
    ll = pexConfig.ListField("list test",
                             int,
                             default=[1, 2, 3],
                             maxLength=5,
                             itemCheck=lambda x: x is not None and x > 0)
    d = pexConfig.DictField("dict test",
                            str,
                            str,
                            default={"key": "value"},
                            itemCheck=lambda x: x.startswith('v'))
    n = pexConfig.Field("nan test", float, default=float("NAN"))
class DiaSourceAnalystConfig(pexConfig.Config):
    srcBadMaskPlanes = pexConfig.ListField(
        dtype=str,
        doc="""Mask planes that lead to an invalid detection.
                 Options: NO_DATA EDGE SAT BAD CR INTRP
                 E.g. : NO_DATA SAT BAD allows CR-masked and interpolated pixels""",
        default=("NO_DATA", "EDGE", "SAT", "BAD"))
    fBadPixels = pexConfig.Field(
        dtype=float,
        doc="Fraction of bad pixels allowed in footprint",
        default=0.1)
    fluxPolarityRatio = pexConfig.Field(
        dtype=float,
        doc="Minimum fraction of flux in correct-polarity pixels",
        default=0.75)
    nPolarityRatio = pexConfig.Field(
        dtype=float,
        doc="Minimum fraction of correct-polarity pixels in unmasked subset",
        default=0.7)
    nMaskedRatio = pexConfig.Field(
        dtype=float,
        doc="Minimum fraction of correct-polarity unmasked to masked pixels",
        default=0.6,
    )
    nGoodRatio = pexConfig.Field(
        dtype=float,
        doc="Minimum fraction of correct-polarity unmasked to all pixels",
        default=0.5)
Exemplo n.º 24
0
class ComputeExposureSummaryStatsConfig(pexConfig.Config):
    """Config for ComputeExposureSummaryTask"""
    sigmaClip = pexConfig.Field(
        dtype=float,
        doc="Sigma for outlier rejection for sky noise.",
        default=3.0,
    )
    clipIter = pexConfig.Field(
        dtype=int,
        doc="Number of iterations of outlier rejection for sky noise.",
        default=2,
    )
    badMaskPlanes = pexConfig.ListField(
        dtype=str,
        doc=
        "Mask planes that, if set, the associated pixel should not be included sky noise calculation.",
        default=("NO_DATA", "SUSPECT"),
    )
    starSelection = pexConfig.Field(
        doc=
        "Field to select sources to be used in the PSF statistics computation.",
        dtype=str,
        default="calib_psf_used")
    starShape = pexConfig.Field(
        doc=
        "Base name of columns to use for the source shape in the PSF statistics computation.",
        dtype=str,
        default="base_SdssShape")
    psfShape = pexConfig.Field(
        doc=
        "Base name of columns to use for the PSF shape in the PSF statistics computation.",
        dtype=str,
        default="base_SdssShape_psf")
class AssembleCcdConfig(pexConfig.Config):
    setGain = pexConfig.Field(
        doc="set gain?",
        dtype=bool,
        default=True,
    )
    doRenorm = pexConfig.Field(
        doc="renormalize to a gain of 1? (ignored if setGain false). "
        "Setting to True gives 1 ADU per electron. "
        "Setting to True is not recommended for mosaic cameras because it breaks normalization across "
        "the focal plane. However, if the CCDs are sufficiently flat then the resulting error "
        "may be acceptable.",
        dtype=bool,
        default=False,
    )
    doTrim = pexConfig.Field(
        doc="trim out non-data regions?",
        dtype=bool,
        default=True,
    )
    keysToRemove = pexConfig.ListField(
        doc=
        "FITS headers to remove (in addition to DATASEC, BIASSEC, TRIMSEC and perhaps GAIN)",
        dtype=str,
        default=(),
    )
Exemplo n.º 26
0
class BaseSkyMapConfig(pexConfig.Config):
    patchInnerDimensions = pexConfig.ListField(
        doc="dimensions of inner region of patches (x,y pixels)",
        dtype=int,
        length=2,
        default=(4000, 4000),
    )
    patchBorder = pexConfig.Field(
        doc="border between patch inner and outer bbox (pixels)",
        dtype=int,
        default=100,
    )
    tractOverlap = pexConfig.Field(
        doc="minimum overlap between adjacent sky tracts, on the sky (deg)",
        dtype=float,
        default=1.0,
    )
    pixelScale = pexConfig.Field(doc="nominal pixel scale (arcsec/pixel)",
                                 dtype=float,
                                 default=0.333)
    projection = pexConfig.Field(
        doc="one of the FITS WCS projection codes, such as:"
        "- STG: stereographic projection"
        "- MOL: Molleweide's projection"
        "- TAN: tangent-plane projection",
        dtype=str,
        default="STG",
    )
    rotation = pexConfig.Field(
        doc="Rotation for WCS (deg)",
        dtype=float,
        default=0,
    )
Exemplo n.º 27
0
class DiaForcedSourcedConfig(pexConfig.Config):
    """Configuration for the generic DiaForcedSourcedTask class.
    """
    forcedMeasurement = pexConfig.ConfigurableField(
        target=ForcedMeasurementTask,
        doc="Subtask to force photometer DiaObjects in the direct and "
            "difference images.",
    )
    dropColumns = pexConfig.ListField(
        dtype=str,
        doc="Columns produced in forced measurement that can be dropped upon "
            "creation and storage of the final pandas data.",
    )

    def setDefaults(self):
        self.forcedMeasurement.plugins = ["ap_assoc_TransformedCentroid",
                                          "base_PsfFlux"]
        self.forcedMeasurement.doReplaceWithNoise = False
        self.forcedMeasurement.copyColumns = {
            "id": "diaObjectId",
            "coord_ra": "coord_ra",
            "coord_dec": "coord_dec"}
        self.forcedMeasurement.slots.centroid = "ap_assoc_TransformedCentroid"
        self.forcedMeasurement.slots.psfFlux = "base_PsfFlux"
        self.forcedMeasurement.slots.shape = None
        self.dropColumns = ['coord_ra', 'coord_dec', 'parent',
                            'ap_assoc_TransformedCentroid_x',
                            'ap_assoc_TransformedCentroid_y',
                            'base_PsfFlux_instFlux',
                            'base_PsfFlux_instFluxErr', 'base_PsfFlux_area',
                            'slot_PsfFlux_area', 'base_PsfFlux_flag',
                            'slot_PsfFlux_flag',
                            'base_PsfFlux_flag_noGoodPixels',
                            'slot_PsfFlux_flag_noGoodPixels',
                            'base_PsfFlux_flag_edge', 'slot_PsfFlux_flag_edge']
Exemplo n.º 28
0
class _DatasetTypeConfig(_BaseDatasetTypeConfig):
    """Configuration class which defines dataset type used by PipelineTask.

    Consists of DatasetType name, list of Dimension names and StorageCass name.
    PipelineTasks typically define one or more input and output datasets. This
    class should not be used directly, instead one of `InputDatasetConfig` or
    `OutputDatasetConfig` should be used in PipelineTask config.
    """
    dimensions = pexConfig.ListField(
        dtype=str, doc="list of Dimensions for this DatasetType")
    scalar = pexConfig.Field(
        dtype=bool,
        default=False,
        optional=True,
        doc=("If set to True then only a single dataset is expected "
             "on input or produced on output. In that case list of "
             "objects/DataIds will be unpacked before calling task "
             "methods, returned data is expected to contain single "
             "objects as well."))
    manualLoad = pexConfig.Field(
        dtype=bool,
        default=False,
        optional=True,
        doc=("If this is set to True, the class intends to load "
             "the data associated with this Configurable Field "
             "manually, and runQuantum should not load it. Should "
             "not be set by configuration override"))
Exemplo n.º 29
0
class IndexExposureConfig(pex_config.Config):
    """Configuration for :class:`.IndexExposureTask`."""

    allow_replace = pex_config.Field(
        "Allow replacement of previously indexed exposures",
        bool, default=False
    )

    init_statements = pex_config.ListField(
        "List of initialization statements (e.g. PRAGMAs) to run when the "
        "SQLite 3 database is first created. Useful for performance tuning.",
        str, default=[]
    )

    defer_writes = pex_config.Field(
        "If False, then exposure information is inserted directly into the "
        "database by IndexExposureTask. Otherwise, all exposure index "
        "information is collected by IndexExposureRunner and inserted after "
        "task processing is complete. This avoids an implicit serialization "
        "point in task processing (SQLite 3 does not support concurrent "
        "database writes), and amortizes the overhead of connecting and "
        "running a transaction over many inserts.",
        bool, default=True
    )

    pad_pixels = pex_config.Field(
        "Number of pixels by which the pixel-space bounding box of an "
        "exposure is grown before it is converted to a spherical polygon. "
        "Positive values expand the box, while negative values shrink it. "
        "If the padded box is empty, the corresponding exposure will not "
        "appear in the index.",
        int, default=0
    )
Exemplo n.º 30
0
class ImageReducerSubtaskConfig(pexConfig.Config):
    """Configuration parameters for the ImageReducerSubtask
    """
    reduceOperation = pexConfig.ChoiceField(
        dtype=str,
        doc="""Operation to use for reducing subimages into new image.""",
        default="average",
        allowed={
            "none": """simply return a list of values and don't re-map results into
                       a new image (noop operation)""",
            "copy": """copy pixels directly from subimage into correct location in
                       new exposure (potentially non-deterministic for overlaps)""",
            "sum": """add pixels from overlaps (probably never wanted; used for testing)
                       into correct location in new exposure""",
            "average": """same as copy, but also average pixels from overlapped regions
                       (NaNs ignored)""",
            "coaddPsf": """Instead of constructing an Exposure, take a list of returned
                       PSFs and use CoaddPsf to construct a single PSF that covers the
                       entire input exposure""",
        }
    )
    badMaskPlanes = pexConfig.ListField(
        dtype=str,
        doc="""Mask planes to set for invalid pixels""",
        default=('INVALID_MAPREDUCE', 'BAD', 'NO_DATA')
    )