Skip to content

Commit

Permalink
Assign instrument label during visitInfo creation
Browse files Browse the repository at this point in the history
  • Loading branch information
parejkoj committed Jan 26, 2021
1 parent 4449a12 commit b1e10d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
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
2 changes: 2 additions & 0 deletions tests/test_makeRawVisitInfoViaObsInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(), "Irrelevant")

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(), "Irrelevant")


if __name__ == "__main__":
Expand Down

0 comments on commit b1e10d9

Please sign in to comment.