Coverage for tests / test_lsstCamSim.py: 50%
38 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-05-01 08:49 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-05-01 08:49 +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 LsstCamSim
33TESTDIR = os.path.abspath(os.path.dirname(__file__))
36class TestLsstCamSim(ObsLsstObsBaseOverrides, ObsLsstButlerTests):
37 instrumentDir = "lsstCamSim"
38 DATAROOT = os.path.join(TESTDIR, "data", "input")
40 @classmethod
41 def getInstrument(cls):
42 return LsstCamSim()
44 def setUp(self):
45 dataIds = {
46 "raw": {"exposure": 7024032100720, "name_in_raft": "S11", "raft": "R22"},
47 "bias": unittest.SkipTest,
48 "flat": unittest.SkipTest,
49 "dark": unittest.SkipTest,
50 }
51 self.setUp_tests(self._butler, dataIds)
53 filters = {
54 "raw": "r_57",
55 }
56 exptimes = {
57 "raw": 30.0,
58 }
59 detectorIds = {
60 "raw": 94,
61 }
62 detector_names = {
63 "raw": "R22_S11",
64 }
65 # This name comes from the camera and not from the butler
66 detector_serials = {
67 "raw": "E2V-CCD250-382",
68 }
69 dimensions = {
70 "raw": Extent2I(4608, 4096),
71 }
72 sky_origin = unittest.SkipTest
73 raw_subsets = (
74 ({}, 1),
75 ({"physical_filter": "r_57"}, 1),
76 ({"physical_filter": "foo"}, 0),
77 ({"exposure": 7024032100720}, 1),
78 )
79 linearizer_type = unittest.SkipTest
80 self.setUp_butler_get(
81 filters=filters,
82 exptimes=exptimes,
83 detectorIds=detectorIds,
84 detector_names=detector_names,
85 detector_serials=detector_serials,
86 dimensions=dimensions,
87 sky_origin=sky_origin,
88 raw_subsets=raw_subsets,
89 linearizer_type=linearizer_type,
90 )
92 self.raw_filename = "7024032100720-R22-S11-det094.fits.fz"
94 # Use plate-scale from policy/cameraTransforms.yaml, since
95 # input/data/lsstCamSim was created after DM-42837, where
96 # lsstCam distortion coefficients were updated.
97 self.setUp_camera(
98 camera_name="LSSTCamSim",
99 n_detectors=205,
100 first_detector_name="R01_S00",
101 plate_scale=20.005867576692737 * arcseconds,
102 )
104 super().setUp()
107class MemoryTester(lsst.utils.tests.MemoryTestCase):
108 pass
111def setup_module(module):
112 lsst.utils.tests.init()
115if __name__ == "__main__": 115 ↛ 116line 115 didn't jump to line 116 because the condition on line 115 was never true
116 setup_module(sys.modules[__name__])
117 unittest.main()