Skip to content

Commit

Permalink
Remove gen2 handling of empty BSS instances
Browse files Browse the repository at this point in the history
  • Loading branch information
MorganSchmitz committed Apr 26, 2021
1 parent 71cb103 commit 226115a
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions python/lsst/pipe/tasks/extended_psf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from lsst.pipe.tasks.assembleCoadd import AssembleCoaddTask
import lsst.pex.config as pexConfig
from lsst.geom import Extent2I
from lsst.daf.butler import DeferredDatasetHandle


@dataclass
Expand Down Expand Up @@ -353,15 +352,8 @@ def run(self, bss_ref_list, region_name=None):
log_message += f' for region "{region_name}".'
self.log.info(log_message)
# read in example set of full stamps
for bss_ref in bss_ref_list:
if not isinstance(bss_ref, DeferredDatasetHandle):
if not bss_ref.datasetExists("brightStarStamps"):
self.log.warn("Could not find %s %s; skipping it", "brightStarStamps", bss_ref.dataId)
bss_ref_list.remove(bss_ref)
continue
bss = bss_ref.get(datasetType="brightStarStamps", immediate=True)
break
example_stamp = bss[0].stamp_im
example_bss = bss_ref_list[0].get(datasetType="brightStarStamps", immediate=True)
example_stamp = example_bss[0].stamp_im
# create model image
ext_psf = afwImage.MaskedImageF(example_stamp.getBBox())
# divide model image into smaller subregions
Expand All @@ -378,11 +370,6 @@ def run(self, bss_ref_list, region_name=None):
for jbbox, bbox in enumerate(sub_bboxes):
all_stars = None
for bss_ref in bss_ref_list:
if not isinstance(bss_ref, DeferredDatasetHandle):
if not bss_ref.datasetExists("brightStarStamps"):
self.log.warn("Could not find %s %s; skipping it", "brightStarStamps", bss_ref.dataId)
bss_ref_list.remove(bss_ref)
continue
read_stars = bss_ref.get(datasetType="brightStarStamps", parameters={'bbox': bbox})
if self.config.do_mag_cut:
read_stars = read_stars.selectByMag(magMax=self.config.mag_limit)
Expand Down Expand Up @@ -487,7 +474,7 @@ def select_detector_refs(self, ref_list):
def runQuantum(self, butlerQC, inputRefs, outputRefs):
input_data = butlerQC.get(inputRefs)
bss_ref_list = input_data['input_brightStarStamps']
# Handle default cause of a single region with empty detector list
# Handle default case of a single region with empty detector list
if not self.config.detectors_focal_plane_regions:
self.log.info("No detector groups were provided to MeasureExtendedPsfTask; computing a single, "
"constant extended PSF model over all available observations.")
Expand Down

0 comments on commit 226115a

Please sign in to comment.