Coverage for tests / test_latiss.py: 48%

40 statements  

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

32 

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

34 

35 

36class TestLatiss(ObsLsstObsBaseOverrides, ObsLsstButlerTests): 

37 instrumentDir = "latiss" 

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

39 

40 @classmethod 

41 def getInstrument(cls): 

42 return Latiss() 

43 

44 def setUp(self): 

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

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

47 'flat': unittest.SkipTest, 

48 'dark': unittest.SkipTest 

49 } 

50 self.setUp_tests(self._butler, dataIds) 

51 

52 ccdExposureId_bits = 52 

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

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

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

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

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

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

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

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

61 sky_origin = unittest.SkipTest 

62 raw_subsets = (({}, 1), 

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

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

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

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

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

68 ) 

69 linearizer_type = unittest.SkipTest 

70 self.setUp_butler_get(ccdExposureId_bits=ccdExposureId_bits, 

71 exposureIds=exposureIds, 

72 filters=filters, 

73 exptimes=exptimes, 

74 detectorIds=detectorIds, 

75 detector_names=detector_names, 

76 detector_serials=detector_serials, 

77 dimensions=dimensions, 

78 sky_origin=sky_origin, 

79 raw_subsets=raw_subsets, 

80 linearizer_type=linearizer_type 

81 ) 

82 

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

84 

85 self.setUp_camera(camera_name='LATISS', 

86 n_detectors=1, 

87 first_detector_name='RXX_S00', 

88 plate_scale=9.5695 * arcseconds, 

89 ) 

90 

91 super().setUp() 

92 

93 

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

95 pass 

96 

97 

98def setup_module(module): 

99 lsst.utils.tests.init() 

100 

101 

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

103 setup_module(sys.modules[__name__]) 

104 unittest.main()