Coverage for tests/test_ucdcam.py: 44%

37 statements  

« prev     ^ index     » next       coverage.py v7.2.4, created at 2023-04-30 03:01 -0700

1# This file is part of obs_lsst. 

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 COPYRIGHT file at the top-level directory of this distribution 

7# for details of code ownership. 

8# 

9# This program is free software: you can redistribute it and/or modify 

10# it under the terms of the GNU General Public License as published by 

11# the Free Software Foundation, either version 3 of the License, or 

12# (at your option) any later version. 

13# 

14# This program is distributed in the hope that it will be useful, 

15# but WITHOUT ANY WARRANTY; without even the implied warranty of 

16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

17# GNU General Public License for more details. 

18# 

19# You should have received a copy of the GNU General Public License 

20# along with this program. If not, see <http://www.gnu.org/licenses/>. 

21# 

22import sys 

23import unittest 

24 

25import lsst.utils.tests 

26from lsst.geom import arcseconds, Extent2I 

27import lsst.afw.image 

28 

29from lsst.obs.lsst.testHelper import ObsLsstButlerTests, ObsLsstObsBaseOverrides 

30from lsst.obs.lsst import LsstUCDCam 

31 

32 

33class TestUcdCam(ObsLsstObsBaseOverrides, ObsLsstButlerTests): 

34 instrumentDir = "ucd" 

35 

36 @classmethod 

37 def getInstrument(cls): 

38 return LsstUCDCam() 

39 

40 def setUp(self): 

41 dataIds = {'raw': {'exposure': 20180530150355, 'name_in_raft': 'S00', 'raft': 'R02'}, 

42 'bias': unittest.SkipTest, 

43 'flat': unittest.SkipTest, 

44 'dark': unittest.SkipTest 

45 } 

46 self.setUp_tests(self._butler, dataIds) 

47 

48 ccdExposureId_bits = 48 

49 exposureIds = {'raw': 201805301503552} 

50 filters = {'raw': 'r'} 

51 exptimes = {'raw': 0.5} 

52 detectorIds = {'raw': 2} 

53 detector_names = {'raw': 'R02_S00'} 

54 detector_serials = {'raw': 'ITL-3800C-002'} 

55 dimensions = {'raw': Extent2I(0, 0)} 

56 sky_origin = unittest.SkipTest 

57 raw_subsets = (({}, 2), 

58 ({'physical_filter': 'r'}, 2), 

59 ({'physical_filter': 'foo'}, 0), 

60 ({'exposure': 20180530150355}, 1), 

61 ) 

62 linearizer_type = unittest.SkipTest 

63 self.setUp_butler_get(ccdExposureId_bits=ccdExposureId_bits, 

64 exposureIds=exposureIds, 

65 filters=filters, 

66 exptimes=exptimes, 

67 detectorIds=detectorIds, 

68 detector_names=detector_names, 

69 detector_serials=detector_serials, 

70 dimensions=dimensions, 

71 sky_origin=sky_origin, 

72 raw_subsets=raw_subsets, 

73 linearizer_type=linearizer_type 

74 ) 

75 

76 self.raw_filename = '20180530150355-S00-det002.fits' 

77 

78 self.setUp_camera(camera_name='LSST-UCDCam', 

79 n_detectors=4, 

80 first_detector_name='R00_S00', 

81 plate_scale=20.0 * arcseconds, 

82 ) 

83 

84 super().setUp() 

85 

86 

87class MemoryTester(lsst.utils.tests.MemoryTestCase): 

88 pass 

89 

90 

91def setup_module(module): 

92 lsst.utils.tests.init() 

93 

94 

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

96 setup_module(sys.modules[__name__]) 

97 unittest.main()