Coverage for tests / test_comCamSim.py: 48%

40 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-21 10:45 +0000

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 os.path 

23import sys 

24import unittest 

25 

26import lsst.utils.tests 

27from lsst.geom import arcseconds, Extent2I 

28import lsst.afw.image 

29 

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

31from lsst.obs.lsst import LsstComCamSim 

32 

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

34 

35 

36class TestLsstCam(ObsLsstObsBaseOverrides, ObsLsstButlerTests): 

37 instrumentDir = "comCamSim" 

38 DATAROOT = os.path.join(TESTDIR, "data", "input") 

39 

40 @classmethod 

41 def getInstrument(cls): 

42 return LsstComCamSim() 

43 

44 def setUp(self): 

45 dataIds = {'raw': {'exposure': 7024032100720, 'name_in_raft': 'S11', 'raft': 'R22'}, 

46 'bias': unittest.SkipTest, 

47 'flat': unittest.SkipTest, 

48 'dark': unittest.SkipTest, 

49 } 

50 self.setUp_tests(self._butler, dataIds) 

51 

52 ccdExposureId_bits = 52 

53 exposureIds = {'raw': 7024032100720000, 

54 } 

55 filters = {'raw': 'r_03', 

56 } 

57 exptimes = {'raw': 30.0, 

58 } 

59 detectorIds = {'raw': 4, 

60 } 

61 detector_names = {'raw': 'R22_S11', 

62 } 

63 # This name comes from the camera and not from the butler 

64 detector_serials = {'raw': 'ITL-3800C-283', 

65 } 

66 dimensions = {'raw': Extent2I(4608, 4096), 

67 } 

68 sky_origin = unittest.SkipTest 

69 raw_subsets = (({}, 1), 

70 ({'physical_filter': 'r_03'}, 1), 

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

72 ({'exposure': 7024032100720}, 1), 

73 ) 

74 linearizer_type = unittest.SkipTest 

75 self.setUp_butler_get(ccdExposureId_bits=ccdExposureId_bits, 

76 exposureIds=exposureIds, 

77 filters=filters, 

78 exptimes=exptimes, 

79 detectorIds=detectorIds, 

80 detector_names=detector_names, 

81 detector_serials=detector_serials, 

82 dimensions=dimensions, 

83 sky_origin=sky_origin, 

84 raw_subsets=raw_subsets, 

85 linearizer_type=linearizer_type 

86 ) 

87 

88 self.raw_filename = '7024032100720-R22-S11-det004.fits.fz' 

89 

90 self.setUp_camera(camera_name='LSSTComCamSim', 

91 n_detectors=9, 

92 first_detector_name='R22_S00', 

93 plate_scale=20.0 * arcseconds, 

94 ) 

95 

96 super().setUp() 

97 

98 

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

100 pass 

101 

102 

103def setup_module(module): 

104 lsst.utils.tests.init() 

105 

106 

107if __name__ == '__main__': 107 ↛ 108line 107 didn't jump to line 108 because the condition on line 107 was never true

108 setup_module(sys.modules[__name__]) 

109 unittest.main()