Skip to content

Commit

Permalink
Transfer the unit test comparing warps
Browse files Browse the repository at this point in the history
  • Loading branch information
arunkannawadi committed Dec 3, 2024
1 parent 788ce74 commit 1683f8a
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions tests/test_makeWarp.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@

import lsst.afw.image
from lsst.daf.butler import DataCoordinate, DimensionUniverse
from lsst.pipe.base import InMemoryDatasetHandle
from lsst.pipe.tasks.make_direct_warp import MakeDirectWarpTask, WarpDetectorInputs
from lsst.pipe.tasks.makeWarp import (MakeWarpTask, MakeWarpConfig)
from lsst.pipe.tasks.coaddBase import makeSkyInfo
import lsst.skymap as skyMap
Expand Down Expand Up @@ -237,53 +235,6 @@ def test_psfMatched(self):
result2.exposures['direct'].maskedImage
)

def test_compare_warps(self):
"""Test that the warp from MakeWarpTask and MakeDirectWarpTask agree.
"""
dataIdList = [{'visit_id': self.visit, 'detector_id': self.detector, "band": "i"}]

dataRefs = [
InMemoryDatasetHandle(self.exposure, dataId=self.generate_data_id(**dataId))
for dataId in dataIdList
]

for dataId in dataIdList:
dataId["detector"] = dataId.pop("detector_id")
dataId["visit"] = dataId.pop("visit_id")

self.config.makePsfMatched = True
makeWarp = MakeWarpTask(config=self.config)
result0 = makeWarp.run(
calExpList=[self.exposure],
ccdIdList=[self.detector],
skyInfo=self.skyInfo,
visitId=self.visit,
dataIdList=dataIdList,
)

config = MakeDirectWarpTask.ConfigClass()
config.doPreWarpInterpolation = False
config.doSelectPreWarp = False
config.useVisitSummaryPsf = False
task = MakeDirectWarpTask(config=config)
warp_detector_inputs = {
dataRef.dataId.detector.id: WarpDetectorInputs(
exposure_or_handle=self.exposure,
data_id=dataRef.dataId,
)
for dataRef in dataRefs
}
result1 = task.run(
warp_detector_inputs,
sky_info=self.skyInfo,
visit_summary=None
)

warp0 = result0.exposures["direct"]
warp1 = result1.warp[warp0.getBBox()]

self.assertMaskedImagesAlmostEqual(warp0.maskedImage, warp1.maskedImage, rtol=3e-7, atol=6e-6)


def setup_module(module):
lsst.utils.tests.init()
Expand Down

0 comments on commit 1683f8a

Please sign in to comment.