Skip to content

Commit

Permalink
Merge pull request #460 from lsst/tickets/DM-32138
Browse files Browse the repository at this point in the history
DM-32138: Remove exposureId from VisitInfo
  • Loading branch information
parejkoj authored Jul 6, 2023
2 parents e375ff5 + 075ece2 commit 53382a3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
3 changes: 0 additions & 3 deletions python/lsst/obs/base/exposureAssembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
5 changes: 1 addition & 4 deletions python/lsst/obs/base/makeRawVisitInfoViaObsInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,14 @@ 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
----------
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
-------
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 0 additions & 6 deletions tests/test_makeRawVisitInfoViaObsInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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")
Expand Down

2 comments on commit 53382a3

@thisisrahulg
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can anyone let me know when this verision is made; g53382a35d2+9591db2f86
Thanks,
Rahul

@TallJimbo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes will first appear in the v26 stable release, and they're already in the w_2023_27 weekly release. I think it'll be at least a month, and probably two, before the v26 release comes out. It will be announced on community.lsst.org when it does.

Please sign in to comment.