Coverage for tests/test_convert2to3.py : 47%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# This file is part of obs_decam.
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/>.
22"""Unit tests for DECam gen2 to gen3 conversion.
23"""
25import itertools
26import os
27import unittest
29import lsst.utils.tests
30from lsst.obs.base.gen2to3 import convertTests
31import lsst.obs.decam
33testDataPackage = "testdata_decam"
34try:
35 testDataDirectory = lsst.utils.getPackageDir(testDataPackage)
36except LookupError:
37 testDataDirectory = None
40@unittest.skipIf(testDataDirectory is None, f"{testDataPackage} not setup")
41class DecamConvertGen2To3TestCase(convertTests.ConvertGen2To3TestCase,
42 lsst.utils.tests.TestCase):
43 def setUp(self):
44 # NOTE: this test will produce a bunch of "Skipping ingestion for" warnings,
45 # due to the bias/flat calibRegistry only having the same ccds as the
46 # raws, even though the files themselves have more.
47 self.gen2root = os.path.join(testDataDirectory, 'ingested')
48 self.gen2calib = os.path.join(testDataDirectory, 'calibingested')
49 self.instrumentName = "DECam"
50 self.instrumentClass = "lsst.obs.decam.DarkEnergyCamera"
51 self.config = os.path.join(os.path.abspath(os.path.dirname(__file__)),
52 "config", "convert2to3Config.py")
53 self.kwargs = {"calibFilterType": "abstract_filter"}
55 detectors = (5, 10, 56, 60)
56 dates = ('2015-02-18', '2015-03-13')
57 self.biasName = 'cpBias'
58 self.biases = [{'detector': detector, 'calibration_label': f"gen2/cpBias_{date}_{detector:03}",
59 'instrument': 'DECam'}
60 for detector, date in itertools.product(detectors, dates)]
61 self.flatName = 'cpFlat'
62 self.flats = [{'detector': detector,
63 'calibration_label': f"gen2/cpFlat_{date}_{detector:03}_g",
64 'instrument': 'DECam', 'physical_filter': 'g DECam SDSS c0001 4720.0 1520.0'}
65 for detector, date in itertools.product(detectors, dates)]
66 self.refcats = ['gaia', 'panstarrs']
67 super().setUp()
68 self.collections.add("calib/DECam")
71def setup_module(module):
72 lsst.utils.tests.init()
75if __name__ == "__main__": 75 ↛ 76line 75 didn't jump to line 76, because the condition on line 75 was never true
76 lsst.utils.tests.init()
77 unittest.main()