Coverage for tests/test_convert2to3.py: 76%
61 statements
« prev ^ index » next coverage.py v6.4.1, created at 2022-07-11 08:24 +0000
« prev ^ index » next coverage.py v6.4.1, created at 2022-07-11 08:24 +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/>.
22import os
23import unittest
25import lsst.utils.tests
26from lsst.obs.base.gen2to3 import convertTests
28testDataPackage = "obs_lsst"
29try:
30 testDataDirectory = lsst.utils.getPackageDir(testDataPackage)
31except LookupError:
32 testDataDirectory = None
35class ConvertGen2To3TestCase(convertTests.ConvertGen2To3TestCase):
36 detectorKey = "detector"
37 exposureKey = "expId"
38 config = os.path.join(os.path.abspath(os.path.dirname(__file__)),
39 "config", "convert2to3Config.py")
41 def setUp(self):
42 rawpath = os.path.join(testDataDirectory, f"data/input/{self.instrumentDir}")
43 calibpath = os.path.join(testDataDirectory, f"{rawpath}/CALIB")
45 self.gen2root = rawpath
46 if os.path.exists(calibpath):
47 self.gen2calib = calibpath
49 super().setUp()
52class LatissGen2To3TestCase(ConvertGen2To3TestCase, lsst.utils.tests.TestCase):
53 instrumentName = "LATISS"
54 instrumentDir = "latiss"
55 instrumentClassName = "lsst.obs.lsst.Latiss"
56 biases = [{"detector": 0, "instrument": instrumentName}]
59class TS8Gen2To3TestCase(ConvertGen2To3TestCase, lsst.utils.tests.TestCase):
60 instrumentName = "LSST-TS8"
61 instrumentDir = "ts8"
62 instrumentClassName = "lsst.obs.lsst.LsstTS8"
63 biases = [{"detector": 67, "instrument": instrumentName}]
65 def check_defects(self, gen3Butler, detectors):
66 # Disable defects tests, because there are no defects.
67 pass
70class TS3Gen2To3TestCase(ConvertGen2To3TestCase, lsst.utils.tests.TestCase):
71 instrumentDir = "ts3"
72 instrumentClassName = "lsst.obs.lsst.LsstTS3"
74 def check_defects(self, gen3Butler, detectors):
75 # Disable defects tests, because there are no defects.
76 pass
79class UCDCamGen2To3TestCase(ConvertGen2To3TestCase, lsst.utils.tests.TestCase):
80 instrumentDir = "ucd"
81 instrumentClassName = "lsst.obs.lsst.LsstUCDCam"
83 def check_defects(self, gen3Butler, detectors):
84 # Disable defects tests, because there are no defects.
85 pass
88class PhoSimGen2To3TestCase(ConvertGen2To3TestCase, lsst.utils.tests.TestCase):
89 instrumentDir = "phosim"
90 instrumentClassName = "lsst.obs.lsst.LsstCamPhoSim"
92 def check_defects(self, gen3Butler, detectors):
93 # Disable defects tests, because there are no defects.
94 pass
97class ImSimGen2To3TestCase(ConvertGen2To3TestCase, lsst.utils.tests.TestCase):
98 instrumentName = "LSSTCam-imSim"
99 instrumentDir = "imsim"
100 instrumentClassName = "lsst.obs.lsst.LsstCamImSim"
101 biases = [{"detector": 42, "instrument": instrumentName}]
102 darks = [{"detector": 42, "instrument": instrumentName}]
103 flats = [{"detector": 42, "instrument": instrumentName, "physical_filter": "i_sim_1.4"}]
105 def check_defects(self, gen3Butler, detectors):
106 # Disable defects tests, because there are no defects.
107 pass
110def setup_module(module):
111 lsst.utils.tests.init()
114if __name__ == "__main__": 114 ↛ 115line 114 didn't jump to line 115, because the condition on line 114 was never true
115 lsst.utils.tests.init()
116 unittest.main()