Skip to content

Commit

Permalink
Use BackgroundList with no arguments instead
Browse files Browse the repository at this point in the history
  • Loading branch information
arunkannawadi committed Nov 8, 2024
1 parent 3a22246 commit 8c0b8d7
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions python/lsst/pipe/tasks/make_direct_warp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 8c0b8d7

Please sign in to comment.