Coverage for tests / test_latiss.py: 44%

37 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-22 08:58 +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 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 Latiss 

31 

32 

33class TestLatiss(ObsLsstObsBaseOverrides, ObsLsstButlerTests): 

34 instrumentDir = "latiss" 

35 

36 @classmethod 

37 def getInstrument(cls): 

38 return Latiss() 

39 

40 def setUp(self): 

41 dataIds = {'raw': {'exposure': 3018092000065, 'detector': 0}, 

42 'bias': {'detector': 0, 'exposure': 3018092000065}, 

43 'flat': unittest.SkipTest, 

44 'dark': unittest.SkipTest 

45 } 

46 self.setUp_tests(self._butler, dataIds) 

47 

48 ccdExposureId_bits = 52 

49 exposureIds = {'raw': 3018092000065, 'bias': 3018092000065} 

50 filters = {'raw': 'unknown~unknown', 'bias': '_unknown_'} 

51 exptimes = {'raw': 27.0, 'bias': 0} 

52 detectorIds = {'raw': 0, 'bias': 0} 

53 detector_names = {'raw': 'RXX_S00', 'bias': 'RXX_S00'} 

54 detector_serials = {'raw': 'ITL-3800C-068', 'bias': 'ITL-3800C-098'} 

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

56 'bias': Extent2I(4072, 4000)} 

57 sky_origin = unittest.SkipTest 

58 raw_subsets = (({}, 1), 

59 ({'physical_filter': 'unknown~unknown'}, 1), 

60 ({'physical_filter': 'SDSSg'}, 0), 

61 ({'exposure.day_obs': 20180920}, 1), 

62 ({'exposure': 3018092000065}, 1), 

63 ({'exposure': 9999999999999}, 0), 

64 ) 

65 linearizer_type = unittest.SkipTest 

66 self.setUp_butler_get(ccdExposureId_bits=ccdExposureId_bits, 

67 exposureIds=exposureIds, 

68 filters=filters, 

69 exptimes=exptimes, 

70 detectorIds=detectorIds, 

71 detector_names=detector_names, 

72 detector_serials=detector_serials, 

73 dimensions=dimensions, 

74 sky_origin=sky_origin, 

75 raw_subsets=raw_subsets, 

76 linearizer_type=linearizer_type 

77 ) 

78 

79 self.raw_filename = '3018092000065-det000.fits' 

80 

81 self.setUp_camera(camera_name='LATISS', 

82 n_detectors=1, 

83 first_detector_name='RXX_S00', 

84 plate_scale=9.5695 * arcseconds, 

85 ) 

86 

87 super().setUp() 

88 

89 

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

91 pass 

92 

93 

94def setup_module(module): 

95 lsst.utils.tests.init() 

96 

97 

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

99 setup_module(sys.modules[__name__]) 

100 unittest.main()