Skip to content

Commit

Permalink
Merge pull request #348 from lsst/tickets/DM-27175
Browse files Browse the repository at this point in the history
Add InstrumentLabel to new exposures
  • Loading branch information
parejkoj committed Jan 27, 2021
2 parents 3093e90 + 0159688 commit a70773b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions python/lsst/obs/base/makeRawVisitInfoViaObsInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def observationInfo2visitInfo(obsInfo, log=None):
if obsInfo.dark_time is not None:
argDict["darkTime"] = obsInfo.dark_time.to_value("s")
argDict["exposureId"] = obsInfo.detector_exposure_id
argDict["instrumentLabel"] = obsInfo.instrument

# VisitInfo uses the middle of the observation for the date
if obsInfo.datetime_begin is not None and obsInfo.datetime_end is not None:
Expand Down
4 changes: 3 additions & 1 deletion tests/test_makeRawVisitInfoViaObsInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def setUp(self):
self.header = {
"DATE-OBS": self.datetime_begin.isot,
"DATE-END": self.datetime_end.isot,
"INSTRUME": "Irrelevant",
"INSTRUME": "SomeCamera",
"TELESCOP": "LSST",
"TIMESYS": "UTC",
"EXPTIME": self.exposure_time,
Expand All @@ -86,6 +86,7 @@ def testMakeRawVisitInfoViaObsInfo(self):
self.assertEqual(visitInfo.getExposureId(), self.exposure_id)
self.assertEqual(visitInfo.getDate(), DateTime("2001-01-02T03:04:06.123456789Z", DateTime.UTC))
self.assertEqual(len(self.header), beforeLength)
self.assertEqual(visitInfo.getInstrumentLabel(), "SomeCamera")

def testObservationInfo2VisitInfo(self):

Expand All @@ -98,6 +99,7 @@ def testObservationInfo2VisitInfo(self):
self.assertAlmostEqual(visitInfo.getExposureTime(), self.exposure_time.to_value("s"))
self.assertEqual(visitInfo.getExposureId(), self.exposure_id)
self.assertEqual(visitInfo.getDate(), DateTime("2001-01-02T03:04:06.123456789Z", DateTime.UTC))
self.assertEqual(visitInfo.getInstrumentLabel(), "SomeCamera")


if __name__ == "__main__":
Expand Down

0 comments on commit a70773b

Please sign in to comment.