Coverage for tests / test_ts3.py: 48%
40 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-21 10:45 +0000
« 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
26import lsst.utils.tests
27from lsst.geom import arcseconds, Extent2I
28import lsst.afw.image
30from lsst.obs.lsst.testHelper import ObsLsstButlerTests, ObsLsstObsBaseOverrides
31from lsst.obs.lsst import LsstTS3
33TESTDIR = os.path.abspath(os.path.dirname(__file__))
36class TestTs3(ObsLsstObsBaseOverrides, ObsLsstButlerTests):
37 instrumentDir = "ts3"
38 DATAROOT = os.path.join(TESTDIR, "data", "input")
40 @classmethod
41 def getInstrument(cls):
42 return LsstTS3()
44 def setUp(self):
45 dataIds = {'raw': {'exposure': 201607220607067, 'name_in_raft': 'S00', 'raft': 'R071'},
46 'bias': unittest.SkipTest,
47 'flat': unittest.SkipTest,
48 'dark': unittest.SkipTest
49 }
50 self.setUp_tests(self._butler, dataIds)
52 ccdExposureId_bits = 58
53 exposureIds = {'raw': 201607220607067071}
54 filters = {'raw': '550CutOn'}
55 exptimes = {'raw': 30.611}
56 detectorIds = {'raw': 71}
57 detector_names = {'raw': 'R071_S00'}
58 detector_serials = {'raw': 'ITL-3800C-098'}
59 dimensions = {'raw': Extent2I(4352, 4096),
60 }
61 sky_origin = unittest.SkipTest
62 raw_subsets = (({}, 2),
63 ({'physical_filter': '550CutOn'}, 2),
64 ({'detector': 71}, 1),
65 ({'detector.raft': 'R433'}, 1),
66 ({'detector.raft': 'R999'}, 0),
67 ({'exposure': 201607220607067}, 1),
68 ({'exposure': 201607220607068}, 0),
69 ({'physical_filter': '550CutOn'}, 2),
70 ({'physical_filter': 'foo'}, 0)
71 )
72 linearizer_type = unittest.SkipTest
73 self.setUp_butler_get(ccdExposureId_bits=ccdExposureId_bits,
74 exposureIds=exposureIds,
75 filters=filters,
76 exptimes=exptimes,
77 detectorIds=detectorIds,
78 detector_names=detector_names,
79 detector_serials=detector_serials,
80 dimensions=dimensions,
81 sky_origin=sky_origin,
82 raw_subsets=raw_subsets,
83 linearizer_type=linearizer_type
84 )
86 self.raw_filename = '201607220607067-R071-S00-det071.fits'
88 self.setUp_camera(camera_name='LSST-TS3',
89 n_detectors=435,
90 first_detector_name='R000_S00',
91 plate_scale=20.0 * arcseconds,
92 )
94 super().setUp()
97class MemoryTester(lsst.utils.tests.MemoryTestCase):
98 pass
101def setup_module(module):
102 lsst.utils.tests.init()
105if __name__ == '__main__': 105 ↛ 106line 105 didn't jump to line 106 because the condition on line 105 was never true
106 setup_module(sys.modules[__name__])
107 unittest.main()