Coverage for tests/test_lsstCamSim.py: 49%
35 statements
« prev ^ index » next coverage.py v7.5.1, created at 2024-05-16 04:33 -0700
« prev ^ index » next coverage.py v7.5.1, created at 2024-05-16 04:33 -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
25import lsst.utils.tests
26from lsst.geom import arcseconds, Extent2I
27import lsst.afw.image
29from lsst.obs.lsst.testHelper import ObsLsstButlerTests, ObsLsstObsBaseOverrides
30from lsst.obs.lsst import LsstCamSim
33class TestLsstCamSim(ObsLsstObsBaseOverrides, ObsLsstButlerTests):
34 instrumentDir = "lsstCamSim"
36 @classmethod
37 def getInstrument(cls):
38 return LsstCamSim()
40 def setUp(self):
41 dataIds = {
42 "raw": {"exposure": 7024032100720, "name_in_raft": "S11", "raft": "R22"},
43 "bias": unittest.SkipTest,
44 "flat": unittest.SkipTest,
45 "dark": unittest.SkipTest,
46 }
47 self.setUp_tests(self._butler, dataIds)
49 filters = {
50 "raw": "r_57",
51 }
52 exptimes = {
53 "raw": 30.0,
54 }
55 detectorIds = {
56 "raw": 94,
57 }
58 detector_names = {
59 "raw": "R22_S11",
60 }
61 # This name comes from the camera and not from the butler
62 detector_serials = {
63 "raw": "E2V-CCD250-382",
64 }
65 dimensions = {
66 "raw": Extent2I(4608, 4096),
67 }
68 sky_origin = unittest.SkipTest
69 raw_subsets = (
70 ({}, 1),
71 ({"physical_filter": "r_57"}, 1),
72 ({"physical_filter": "foo"}, 0),
73 ({"exposure": 7024032100720}, 1),
74 )
75 linearizer_type = unittest.SkipTest
76 self.setUp_butler_get(
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 )
88 self.raw_filename = "7024032100720-R22-S11-det094.fits.fz"
90 # Use plate-scale from policy/cameraTransforms.yaml, since
91 # input/data/lsstCamSim was created after DM-42837, where
92 # lsstCam distortion coefficients were updated.
93 self.setUp_camera(
94 camera_name="LSSTCamSim",
95 n_detectors=205,
96 first_detector_name="R01_S00",
97 plate_scale=20.005867576692737 * arcseconds,
98 )
100 super().setUp()
103class MemoryTester(lsst.utils.tests.MemoryTestCase):
104 pass
107def setup_module(module):
108 lsst.utils.tests.init()
111if __name__ == "__main__": 111 ↛ 112line 111 didn't jump to line 112, because the condition on line 111 was never true
112 setup_module(sys.modules[__name__])
113 unittest.main()