Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-42980: Remove deprecated DetectionConfig #361

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 1 addition & 98 deletions python/lsst/ip/diffim/psfMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

__all__ = ["DetectionConfig", "PsfMatchConfig", "PsfMatchConfigAL", "PsfMatchConfigDF", "PsfMatchTask"]
__all__ = ["PsfMatchConfig", "PsfMatchConfigAL", "PsfMatchConfigDF", "PsfMatchTask"]

import abc
import time
Expand All @@ -38,98 +38,6 @@
from . import diffimLib


# Remove this class on DM-42980.
# Not deprecated-decorated to prevent excessive warnings when using PsfMatchTask.
class DetectionConfig(pexConfig.Config):
"""Configuration for detecting sources on images for building a
PSF-matching kernel

Configuration for turning detected lsst.afw.detection.FootPrints into an
acceptable (unmasked, high signal-to-noise, not too large or not too small)
list of `lsst.ip.diffim.KernelSources` that are used to build the
Psf-matching kernel"""

detThreshold = pexConfig.Field(
deprecated="This field is no longer used and will be removed after v27.",
dtype=float,
doc="Value of footprint detection threshold",
default=10.0,
check=lambda x: x >= 3.0
)
detThresholdType = pexConfig.ChoiceField(
deprecated="This field is no longer used and will be removed after v27.",
dtype=str,
doc="Type of detection threshold",
default="pixel_stdev",
allowed={
"value": "Use counts as the detection threshold type",
"stdev": "Use standard deviation of image plane",
"variance": "Use variance of image plane",
"pixel_stdev": "Use stdev derived from variance plane"
}
)
detOnTemplate = pexConfig.Field(
dtype=bool,
doc="""If true run detection on the template (image to convolve);
if false run detection on the science image""",
deprecated="This field is no longer used and will be removed after v27.",
default=True
)
badMaskPlanes = pexConfig.ListField(
dtype=str,
doc="""Mask planes that lead to an invalid detection.
Options: NO_DATA EDGE SAT BAD CR INTRP""",
default=("NO_DATA", "EDGE", "SAT")
)
fpNpixMin = pexConfig.Field(
dtype=int,
doc="Minimum number of pixels in an acceptable Footprint",
default=5,
deprecated="This field is no longer used and will be removed after v27.",
check=lambda x: x >= 5
)
fpNpixMax = pexConfig.Field(
dtype=int,
doc="""Maximum number of pixels in an acceptable Footprint;
too big and the subsequent convolutions become unwieldy""",
default=500,
deprecated="This field is no longer used and will be removed after v27.",
check=lambda x: x <= 500
)
fpGrowKernelScaling = pexConfig.Field(
dtype=float,
doc="""If config.scaleByFwhm, grow the footprint based on
the final kernelSize. Each footprint will be
2*fpGrowKernelScaling*kernelSize x
2*fpGrowKernelScaling*kernelSize. With the value
of 1.0, the remaining pixels in each KernelCandiate
after convolution by the basis functions will be
equal to the kernel size itself.""",
default=1.0,
deprecated="This field is no longer used and will be removed after v27.",
check=lambda x: x >= 1.0
)
fpGrowPix = pexConfig.Field(
dtype=int,
doc="""Growing radius (in pixels) for each raw detection
footprint. The smaller the faster; however the
kernel sum does not converge if the stamp is too
small; and the kernel is not constrained at all if
the stamp is the size of the kernel. The grown stamp
is 2 * fpGrowPix pixels larger in each dimension.
This is overridden by fpGrowKernelScaling if scaleByFwhm""",
default=30,
deprecated="This field is no longer used and will be removed after v27.",
check=lambda x: x >= 10
)
scaleByFwhm = pexConfig.Field(
dtype=bool,
doc="Scale fpGrowPix by input Fwhm?",
deprecated="This field is no longer used and will be removed after v27.",
default=True,
)


class PsfMatchConfig(pexConfig.Config):
"""Base configuration for Psf-matching

Expand All @@ -138,11 +46,6 @@ class PsfMatchConfig(pexConfig.Config):

warpingConfig = pexConfig.ConfigField("Config for warping exposures to a common alignment",
afwMath.WarperConfig)
# Remove this field on DM-42980.
detectionConfig = pexConfig.ConfigField(
"Controlling the detection of sources for kernel building",
DetectionConfig,
deprecated="This field is no longer used and will be removed after v27.")
afwBackgroundConfig = pexConfig.ConfigField("Controlling the Afw background fitting",
SubtractBackgroundConfig)

Expand Down