From 075ece2a5a2f9da290bf67e15c9a1118cc178283 Mon Sep 17 00:00:00 2001 From: John Parejko Date: Wed, 5 Jul 2023 12:14:09 -0700 Subject: [PATCH] Remove exposureId from VisitInfo --- python/lsst/obs/base/exposureAssembler.py | 3 --- python/lsst/obs/base/makeRawVisitInfoViaObsInfo.py | 5 +---- tests/test_makeRawVisitInfoViaObsInfo.py | 6 ------ 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/python/lsst/obs/base/exposureAssembler.py b/python/lsst/obs/base/exposureAssembler.py index 090472ef..bad5822a 100644 --- a/python/lsst/obs/base/exposureAssembler.py +++ b/python/lsst/obs/base/exposureAssembler.py @@ -253,9 +253,6 @@ def assemble(self, components: Dict[str, Any], pytype: Optional[Type] = None) -> info = exposure.getInfo() if "visitInfo" in components: info.setVisitInfo(components.pop("visitInfo")) - # Until DM-32138, "visitInfo" and "id" can both set the exposure ID. - # While they should always be consistent unless a component is - # corrupted, handle "id" second to ensure it takes precedence. if "id" in components: info.id = components.pop("id") info.setApCorrMap(components.pop("apCorrMap", None)) diff --git a/python/lsst/obs/base/makeRawVisitInfoViaObsInfo.py b/python/lsst/obs/base/makeRawVisitInfoViaObsInfo.py index 75de318c..70eb1fcd 100755 --- a/python/lsst/obs/base/makeRawVisitInfoViaObsInfo.py +++ b/python/lsst/obs/base/makeRawVisitInfoViaObsInfo.py @@ -78,7 +78,7 @@ def __init__(self, log=None, doStripHeader=False): self.log = log self.doStripHeader = doStripHeader - def __call__(self, md, exposureId=None): + def __call__(self, md): """Construct a VisitInfo and strip associated data from the metadata. Parameters @@ -86,8 +86,6 @@ def __call__(self, md, exposureId=None): md : `lsst.daf.base.PropertyList` or `lsst.daf.base.PropertySet` Metadata to pull from. May be modified if ``stripHeader`` is ``True``. - exposureId : `int`, optional - Ignored. Here for compatibility with `MakeRawVisitInfo`. Returns ------- @@ -131,7 +129,6 @@ def observationInfo2visitInfo(obsInfo, log=None): argDict["exposureTime"] = obsInfo.exposure_time.to_value("s") if obsInfo.dark_time is not None: argDict["darkTime"] = obsInfo.dark_time.to_value("s") - argDict["exposureId"] = obsInfo.detector_exposure_id argDict["id"] = obsInfo.exposure_id argDict["instrumentLabel"] = obsInfo.instrument if obsInfo.focus_z is not None: diff --git a/tests/test_makeRawVisitInfoViaObsInfo.py b/tests/test_makeRawVisitInfoViaObsInfo.py index 07081d14..783bed95 100644 --- a/tests/test_makeRawVisitInfoViaObsInfo.py +++ b/tests/test_makeRawVisitInfoViaObsInfo.py @@ -95,9 +95,6 @@ def testMakeRawVisitInfoViaObsInfo(self): visitInfo = maker(self.header) self.assertAlmostEqual(visitInfo.getExposureTime(), self.exposure_time.to_value("s")) - with self.assertWarns(FutureWarning): - # TODO: tested for backward-compatibility; remove on DM-32138 - self.assertEqual(visitInfo.getExposureId(), self.exposure_id) self.assertEqual(visitInfo.id, self.exposure_id) self.assertEqual(visitInfo.getDate(), DateTime("2001-01-02T03:04:06.123456789Z", DateTime.UTC)) # The header can possibly grow with header fix up provenance. @@ -134,9 +131,6 @@ def testObservationInfo2VisitInfo(self): visitInfo = MakeRawVisitInfoViaObsInfo.observationInfo2visitInfo(obsInfo) self.assertIsInstance(visitInfo, lsst.afw.image.VisitInfo) self.assertAlmostEqual(visitInfo.getExposureTime(), self.exposure_time.to_value("s")) - with self.assertWarns(FutureWarning): - # TODO: tested for backward-compatibility; remove on DM-32138 - self.assertEqual(visitInfo.getExposureId(), self.exposure_id) self.assertEqual(visitInfo.id, self.exposure_id) self.assertEqual(visitInfo.getDate(), DateTime("2001-01-02T03:04:06.123456789Z", DateTime.UTC)) self.assertEqual(visitInfo.getInstrumentLabel(), "SomeCamera")