Skip to content
Open
Show file tree
Hide file tree
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
18 changes: 14 additions & 4 deletions python/lsst/pipe/tasks/prettyPictureMaker/_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
PipelineTaskConnections,
Struct,
InMemoryDatasetHandle,
NoWorkFound
)
import cv2

Expand Down Expand Up @@ -274,7 +275,7 @@ def setDefaults(self):
class PrettyPictureTask(PipelineTask):
"""Turns inputs into an RGB image."""

_DefaultName = "prettyPictureTask"
_DefaultName = "prettyPicture"
ConfigClass = PrettyPictureConfig

config: ConfigClass
Expand Down Expand Up @@ -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:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this. I forgot something like this was on a branch from DP1 around FL, and just came across it too while porting things back from that whole mess. However, by this time the data has already been pulled from the butler. If you make the change down below in my other comment, it will save memory and run time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be done in adjustQuantum instead, to slightly shrink the QG and keep the task from being blocked by an upstream failure in an irrelevant band. Probably not worth it for this ticket, this late in the game.

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
Expand Down Expand Up @@ -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)

Expand All @@ -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
Expand Down Expand Up @@ -609,7 +619,7 @@ class PrettyPictureBackgroundFixerTask(PipelineTask):

"""

_DefaultName = "prettyPictureBackgroundFixerTask"
_DefaultName = "prettyPictureBackgroundFixer"
ConfigClass = PrettyPictureBackgroundFixerConfig

config: ConfigClass
Expand Down Expand Up @@ -832,7 +842,7 @@ class PrettyPictureStarFixerTask(PipelineTask):
bright stars for which there is no data.
"""

_DefaultName = "prettyPictureStarFixerTask"
_DefaultName = "prettyPictureStarFixer"
ConfigClass = PrettyPictureStarFixerConfig

config: ConfigClass
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions python/lsst/pipe/tasks/rgb2hips/_high_order_hips.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down