diff --git a/python/lsst/pipe/tasks/prettyPictureMaker/_task.py b/python/lsst/pipe/tasks/prettyPictureMaker/_task.py index c01f66fdf..71a3a5be9 100644 --- a/python/lsst/pipe/tasks/prettyPictureMaker/_task.py +++ b/python/lsst/pipe/tasks/prettyPictureMaker/_task.py @@ -55,6 +55,7 @@ PipelineTaskConnections, Struct, InMemoryDatasetHandle, + NoWorkFound ) import cv2 @@ -274,7 +275,7 @@ def setDefaults(self): class PrettyPictureTask(PipelineTask): """Turns inputs into an RGB image.""" - _DefaultName = "prettyPictureTask" + _DefaultName = "prettyPicture" ConfigClass = PrettyPictureConfig config: ConfigClass @@ -418,6 +419,9 @@ def run(self, images: Mapping[str, Exposure]) -> Struct: imageBArray = np.zeros(shape, dtype=np.float32) for band, image in channels.items(): + if band not in self.config.channelConfig: + self.log.info(f"{band} image found but not requested in RGB image, skipping") + continue mix = self.config.channelConfig[band] if mix.r: imageRArray += mix.r * image @@ -500,6 +504,9 @@ def runQuantum( ) -> None: imageRefs: list[DatasetRef] = inputRefs.inputCoadds sortedImages = self.makeInputsFromRefs(imageRefs, butlerQC) + if not sortedImages: + requested = ', '.join(self.config.channelConfig.keys()) + raise NoWorkFound(f"No input images of band(s) {requested}") outputs = self.run(sortedImages) butlerQC.put(outputs, outputRefs) @@ -524,6 +531,9 @@ def makeInputsFromRefs( sortedImages: dict[str, Exposure] = {} for ref in refs: key: str = cast(str, ref.dataId["band"]) + if key not in self.config.channelConfig: + self.log.info(f"{key}-band image found but not requested in RGB image, skipping") + continue image = butler.get(ref) sortedImages[key] = image return sortedImages @@ -609,7 +619,7 @@ class PrettyPictureBackgroundFixerTask(PipelineTask): """ - _DefaultName = "prettyPictureBackgroundFixerTask" + _DefaultName = "prettyPictureBackgroundFixer" ConfigClass = PrettyPictureBackgroundFixerConfig config: ConfigClass @@ -832,7 +842,7 @@ class PrettyPictureStarFixerTask(PipelineTask): bright stars for which there is no data. """ - _DefaultName = "prettyPictureStarFixerTask" + _DefaultName = "prettyPictureStarFixer" ConfigClass = PrettyPictureStarFixerConfig config: ConfigClass @@ -954,7 +964,7 @@ class PrettyMosaicConfig(PipelineTaskConfig, pipelineConnections=PrettyMosaicCon class PrettyMosaicTask(PipelineTask): """Combines multiple RGB arrays into one mosaic.""" - _DefaultName = "prettyMosaicTask" + _DefaultName = "prettyMosaic" ConfigClass = PrettyMosaicConfig config: ConfigClass diff --git a/python/lsst/pipe/tasks/rgb2hips/_high_order_hips.py b/python/lsst/pipe/tasks/rgb2hips/_high_order_hips.py index 68587396b..664357fa1 100644 --- a/python/lsst/pipe/tasks/rgb2hips/_high_order_hips.py +++ b/python/lsst/pipe/tasks/rgb2hips/_high_order_hips.py @@ -428,9 +428,8 @@ def runQuantum( # All boxes in a given skymap will have the same inner dimensions # for x and y and will be the same for all patches imageWcs = skymap[tract][patch].getWcs() - box = skymap[tract][patch].getInnerBBox() + box = skymap[tract][patch].getOuterBBox() patch_grow = skymap[tract][patch].getCellInnerDimensions().getX() - box = box.dilatedBy(patch_grow) imageHandle = butlerQC.get(input_image_ref) container = inputs_by_tract.setdefault(tract, list()) container.append((imageHandle, imageWcs, box))