Skip to content

Commit

Permalink
Add tests for calib metadata in header.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed Nov 17, 2024
1 parent d89e058 commit 45d1789
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/test_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,21 @@ def test_scienceOutput(self):
# collection.
dataId = {'detector': 0, 'exposure': 2021052500198, 'instrument': 'LATISS'}
collections = ['ci_cpp_science']
self.assertIsInstance(self.getExpectedProduct('postISRCCD', dataId=dataId, collections=collections),
Exposure)
exp = self.getExpectedProduct('postISRCCD', dataId=dataId, collections=collections)
self.assertIsInstance(exp, Exposure)

metadata = exp.metadata

for calib in ["bias", "camera", "crosstalk", "dark", "defects", "flat", "linearizer", "ptc"]:
refs = self.butler.query_datasets(calib, data_id=dataId, collections=collections)
key = f"LSST CALIB RUN {calib.upper()}"
self.assertIn(key, metadata)
self.assertEqual(metadata[key], refs[0].run)
key = f"LSST CALIB UUID {calib.upper()}"
self.assertIn(key, metadata)
self.assertEqual(metadata[key], str(refs[0].id))
key = f"LSST CALIB DATE {calib.upper()}"
self.assertIn(key, metadata)

def test_skyOutput(self):
self.assertIsInstance(self.getExpectedProduct('sky'), Exposure)
Expand Down

0 comments on commit 45d1789

Please sign in to comment.