From 8c0b8d72a6cbb9d6819feb36940599cdb04c7992 Mon Sep 17 00:00:00 2001 From: Arun Kannawadi Date: Thu, 7 Nov 2024 23:49:17 -0500 Subject: [PATCH] Use BackgroundList with no arguments instead --- python/lsst/pipe/tasks/make_direct_warp.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/python/lsst/pipe/tasks/make_direct_warp.py b/python/lsst/pipe/tasks/make_direct_warp.py index 903c995da..8f27807dd 100644 --- a/python/lsst/pipe/tasks/make_direct_warp.py +++ b/python/lsst/pipe/tasks/make_direct_warp.py @@ -68,18 +68,6 @@ ) -class _TrivialBackgroundList: - """Trivial class that quacks like BackgroundList and gives 0 as image.""" - - @classmethod - def getImage(cls) -> float: - return 0.0 - - @classmethod - def __bool__(cls) -> bool: - return False - - @dataclasses.dataclass class WarpDetectorInputs: """Inputs passed to `MakeDirectWarpTask.run` for a single detector. @@ -93,10 +81,10 @@ class WarpDetectorInputs: data_id: DataCoordinate """Butler data ID for this detector.""" - background_revert: BackgroundList | _TrivialBackgroundList | None = None + background_revert: BackgroundList | None = None """Background model to restore in (i.e. add to) the image.""" - background_apply: BackgroundList | _TrivialBackgroundList | None = None + background_apply: BackgroundList | None = None """Background model to apply to (i.e. subtract from) the image.""" _exposure: ExposureF | None = None @@ -608,8 +596,8 @@ def run(self, inputs: Mapping[int, WarpDetectorInputs], sky_info, visit_summary) noise_pseudo_inputs = dataclasses.replace( detector_inputs, exposure_or_handle=noise_calexp, - background_revert=_TrivialBackgroundList(), - background_apply=_TrivialBackgroundList(), + background_revert=BackgroundList(), + background_apply=BackgroundList(), ) warpedNoise = self.process( noise_pseudo_inputs,