Coverage for tests/test_jointcal_decam.py : 36%

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 jointcal.
2#
3# Developed for the LSST Data Management System.
4# This product includes software developed by the LSST Project
5# (https://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 <https://www.gnu.org/licenses/>.
22import unittest
23import os
25from astropy import units as u
27import lsst.geom
28import lsst.utils
29import lsst.pex.exceptions
31import jointcalTestBase
34# for MemoryTestCase
35def setup_module(module):
36 lsst.utils.tests.init()
39class JointcalTestDECAM(jointcalTestBase.JointcalTestBase, lsst.utils.tests.TestCase):
40 """NOTE: the data used in this test has some bad input astrometry
41 (particularly in visit 176837) so the data coming in to jointcal is of
42 poor quality. The fitter logs many warnings about not having enough
43 sources, and not being able to produce a good inverse model for the
44 WCS output. This data does not represent a good test case for
45 jointcal's fitter, but may serve as a useful test case for how to fail
46 on a bad fit.
47 """
48 @classmethod
49 def setUpClass(cls):
50 try:
51 cls.data_dir = lsst.utils.getPackageDir('testdata_jointcal')
52 except LookupError:
53 raise unittest.SkipTest("testdata_jointcal not setup")
54 try:
55 lsst.utils.getPackageDir('obs_decam')
56 except LookupError:
57 raise unittest.SkipTest("obs_decam not setup")
59 def setUp(self):
60 # See Readme for an explanation of this empirical value.
61 self.dist_rms_absolute = 63e-3*u.arcsecond
63 do_plot = False
65 # center of the decam validation_data catalog
66 center = lsst.geom.SpherePoint(150.1191666, 2.20583333, lsst.geom.degrees)
67 radius = 3*lsst.geom.degrees
69 input_dir = os.path.join(self.data_dir, 'decam')
70 all_visits = [176837, 176846]
71 ccdnums = '^'.join(str(x) for x in (10, 11, 12, 14, 15, 16, 17, 18))
72 other_args = ['ccdnum=' + ccdnums, ]
74 self.setUp_base(center, radius,
75 input_dir=input_dir,
76 all_visits=all_visits,
77 other_args=other_args,
78 do_plot=do_plot,
79 log_level="DEBUG")
81 def test_jointcalTask_2_visits(self):
82 self.config = lsst.jointcal.jointcal.JointcalConfig()
83 self.config.astrometryModel = "simple"
84 self.config.photometryModel = "simpleFlux"
86 # See Readme for an explanation of these empirical values.
87 relative_error = 19e-3*u.arcsecond
88 pa1 = 0.24
89 metrics = {'collected_astrometry_refStars': 7403,
90 'collected_photometry_refStars': 149481,
91 'selected_astrometry_refStars': 467,
92 'selected_photometry_refStars': 4632,
93 'associated_astrometry_fittedStars': 7839,
94 'associated_photometry_fittedStars': 7839,
95 'selected_astrometry_fittedStars': 702,
96 'selected_photometry_fittedStars': 4637,
97 'selected_astrometry_ccdImages': 15,
98 'selected_photometry_ccdImages': 15,
99 'astrometry_final_chi2': 2803.108,
100 'astrometry_final_ndof': 890,
101 'photometry_final_chi2': 16529,
102 'photometry_final_ndof': 3634,
103 }
105 self._testJointcalTask(2, relative_error, self.dist_rms_absolute, pa1, metrics=metrics)
108class MemoryTester(lsst.utils.tests.MemoryTestCase):
109 pass
112if __name__ == "__main__": 112 ↛ 113line 112 didn't jump to line 113, because the condition on line 112 was never true
113 lsst.utils.tests.init()
114 unittest.main()