Skip to content

Commit

Permalink
Exclude detectors without calibs from warps
Browse files Browse the repository at this point in the history
  • Loading branch information
arunkannawadi committed Nov 5, 2024
1 parent 76e40ab commit eeae60e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions python/lsst/pipe/tasks/make_direct_warp.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,12 @@ def run(self, inputs: Mapping[int, WarpDetectorInputs], sky_info, visit_summary)
destBBox=target_bbox,
)

if warpedExposure is None:
self.log.debug(
"Skipping exposure %s because it could not be warped.", detector_inputs.data_id
)
continue

if final_warp.photoCalib is not None:
ratio = (
final_warp.photoCalib.getInstFluxAtZeroMagnitude()
Expand Down Expand Up @@ -624,7 +630,7 @@ def process(
visit_summary=None,
maxBBox=None,
destBBox=None,
):
) -> ExposureF | None:
"""Process an exposure.
There are three processing steps that are applied to the input:
Expand Down Expand Up @@ -655,19 +661,23 @@ def process(
Returns
-------
warped_exposure : `~lsst.afw.image.Exposure`
The processed and warped exposure.
warped_exposure : `~lsst.afw.image.Exposure` | None
The processed and warped exposure, if all the calibrations could
be applied successfully. Otherwise, None.
"""

if self.config.doPreWarpInterpolation:
self.preWarpInterpolation.run(detector_inputs.exposure.maskedImage)

self._apply_all_calibrations(
success = self._apply_all_calibrations(
detector_inputs,
visit_summary=visit_summary,
includeScaleUncertainty=self.config.includeCalibVar,
)

if not success:
return None

with self.timer("warp"):
warped_exposure = warper.warpExposure(
target_wcs,
Expand Down

0 comments on commit eeae60e

Please sign in to comment.