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-43080: Remove maskStreaks from CalibrateImageTask #897

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 5 additions & 13 deletions python/lsst/pipe/tasks/calibrateImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from lsst.pipe.base import connectionTypes
from lsst.utils.timer import timeMethod

from . import measurePsf, repair, photoCal, computeExposureSummaryStats, maskStreaks, snapCombine
from . import measurePsf, repair, photoCal, computeExposureSummaryStats, snapCombine


class CalibrateImageConnections(pipeBase.PipelineTaskConnections,
Expand Down Expand Up @@ -207,10 +207,6 @@ class CalibrateImageConfig(pipeBase.PipelineTaskConfig, pipelineConnections=Cali
target=lsst.meas.algorithms.SkyObjectsTask,
doc="Task to generate sky sources ('empty' regions where there are no detections).",
)
star_mask_streaks = pexConfig.ConfigurableField(
target=maskStreaks.MaskStreaksTask,
doc="Task for masking streaks. Adds a STREAK mask plane to an exposure.",
)
star_deblend = pexConfig.ConfigurableField(
target=lsst.meas.deblender.SourceDeblendTask,
doc="Split blended sources into their components."
Expand Down Expand Up @@ -322,10 +318,6 @@ def setDefaults(self):
# Only measure the apertures we need for star selection.
self.star_measurement.plugins["base_CircularApertureFlux"].radii = [12.0]

# Keep track of which footprints contain streaks
self.star_measurement.plugins['base_PixelFlags'].masksFpAnywhere = ['STREAK']
self.star_measurement.plugins['base_PixelFlags'].masksFpCenter = ['STREAK']

# Select isolated stars with reliable measurements and no bad flags.
self.star_selector["science"].doFlags = True
self.star_selector["science"].doUnresolved = True
Expand Down Expand Up @@ -399,7 +391,6 @@ def __init__(self, initial_stars_schema=None, **kwargs):
afwTable.CoordKey.addErrorFields(initial_stars_schema)
self.makeSubtask("star_detection", schema=initial_stars_schema)
self.makeSubtask("star_sky_sources", schema=initial_stars_schema)
self.makeSubtask("star_mask_streaks")
self.makeSubtask("star_deblend", schema=initial_stars_schema)
self.makeSubtask("star_measurement", schema=initial_stars_schema)
self.makeSubtask("star_apply_aperture_correction", schema=initial_stars_schema)
Expand Down Expand Up @@ -491,6 +482,10 @@ def run(self, *, exposures, id_generator=None):

exposure = self._handle_snaps(exposures)

# TODO remove on DM-43083: work around the fact that we don't want
# to run streak detection in this task in production.
exposure.mask.addMaskPlane("STREAK")

psf_stars, background, candidates = self._compute_psf(exposure)

self._measure_aperture_correction(exposure, psf_stars)
Expand Down Expand Up @@ -665,9 +660,6 @@ def _find_stars(self, exposure, background, id_generator):
sources = detections.sources
self.star_sky_sources.run(exposure.mask, id_generator.catalog_id, sources)

# Mask streaks
self.star_mask_streaks.run(exposure)

# TODO investigation: Could this deblender throw away blends of non-PSF sources?
self.star_deblend.run(exposure=exposure, sources=sources)
# The deblender may not produce a contiguous catalog; ensure
Expand Down