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
33# testDataPackage = "testdata_decam"
34testDataPackage = "ap_verify_ci_hits2015"
35try:
36 testDataDirectory = lsst.utils.getPackageDir(testDataPackage)
37except LookupError:
38 testDataDirectory = None
41@unittest.skipIf(testDataDirectory is None, f"{testDataPackage} not setup")
42class DecamConvertGen2To3TestCase(convertTests.ConvertGen2To3TestCase,
43 lsst.utils.tests.TestCase):
44 def setUp(self):
45 # self.gen2root = os.path.join(testDataDirectory, 'rawData')
46 # self.gen2calib = os.path.join(testDataDirectory, 'rawData/cpCalib')
47 # NOTE: this test will produce a bunch fo "Skipping ingestion for" warnings,
48 # due to the bias/flat calibRegistry only having the same ccds as the
49 # raws, even though the files themselves have more.
50 self.gen2root = os.path.join(testDataDirectory, 'gen2-output/ingested')
51 self.gen2calib = os.path.join(testDataDirectory, 'gen2-output/calibingested')
52 self.instrumentName = "DECam"
53 self.instrumentClass = "lsst.obs.decam.DarkEnergyCamera"
54 self.config = os.path.join(os.path.abspath(os.path.dirname(__file__)),
55 "config", "convert2to3Config.py")
56 self.args = ("--calibFilterType", "abstract_filter")
57 self.collections = set(['skymaps'])
59 detectors = (5, 10, 56, 60)
60 dates = ('2015-02-18', '2015-03-13')
61 self.biasName = 'cpBias'
62 self.biases = [{'detector': detector, 'calibration_label': f"gen2/cpBias_{date}_{detector:03}",
63 'instrument': 'DECam'}
64 for detector, date in itertools.product(detectors, dates)]
65 self.flatName = 'cpFlat'
66 self.flats = [{'detector': detector,
67 'calibration_label': f"gen2/cpFlat_{date}_{detector:03}_g",
68 'instrument': 'DECam', 'physical_filter': 'g DECam SDSS c0001 4720.0 1520.0'}
69 for detector, date in itertools.product(detectors, dates)]
70 self.refcats = ['gaia', 'panstarrs']
71 super().setUp()
74def setup_module(module):
75 lsst.utils.tests.init()
78if __name__ == "__main__": 78 ↛ 79line 78 didn't jump to line 79, because the condition on line 78 was never true
79 lsst.utils.tests.init()
80 unittest.main()