Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# This file is part of astro_metadata_translator. 

2# 

3# Developed for the LSST Data Management System. 

4# This product includes software developed by the LSST Project 

5# (http://www.lsst.org). 

6# See the LICENSE file at the top-level directory of this distribution 

7# for details of code ownership. 

8# 

9# Use of this source code is governed by a 3-clause BSD-style 

10# license that can be found in the LICENSE file. 

11 

12import os.path 

13import unittest 

14import astropy.units as u 

15 

16from astro_metadata_translator.tests import MetadataAssertHelper 

17 

18TESTDIR = os.path.abspath(os.path.dirname(__file__)) 

19 

20 

21class SdssTestCase(unittest.TestCase, MetadataAssertHelper): 

22 datadir = os.path.join(TESTDIR, "data") 

23 

24 def test_sdss_translator(self): 

25 test_data = (("fitsheader-sdss-fpC-006377-g4-0399.yaml", 

26 dict(telescope="SDSS 2.5m", 

27 instrument="Imager on SDSS 2.5m", 

28 boresight_rotation_coord="sky", 

29 dark_time=0.0*u.s, 

30 detector_exposure_id=6377140399, 

31 detector_name="54", 

32 detector_unique_name="g4", 

33 detector_group="4", 

34 detector_num=15, 

35 detector_serial="UNKNOWN", 

36 exposure_id=6377, 

37 exposure_group="6377", 

38 exposure_time=53.907456*u.s, 

39 object="82 S", 

40 observation_id="6377 4 g 407", 

41 observation_type="science", 

42 observation_reason="science", 

43 physical_filter="g", 

44 pressure=None, 

45 relative_humidity=None, 

46 science_program="82 S", 

47 temperature=None, 

48 visit_id=6377, 

49 wcs_params=dict(max_sep=10.0))), 

50 ) 

51 for file, expected in test_data: 

52 with self.subTest(f"Testing {file}"): 

53 self.assertObservationInfoFromYaml(file, dir=self.datadir, **expected) 

54 

55 

56if __name__ == "__main__": 56 ↛ 57line 56 didn't jump to line 57, because the condition on line 56 was never true

57 unittest.main()