Coverage for tests/test_wcsCards.py: 44%

32 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2022-12-02 03:33 +0000

1# 

2# LSST Data Management System 

3# Copyright 2016 AURA/LSST. 

4# 

5# This product includes software developed by the 

6# LSST Project (http://www.lsst.org/). 

7# 

8# This program is free software: you can redistribute it and/or modify 

9# it under the terms of the GNU General Public License as published by 

10# the Free Software Foundation, either version 3 of the License, or 

11# (at your option) any later version. 

12# 

13# This program is distributed in the hope that it will be useful, 

14# but WITHOUT ANY WARRANTY; without even the implied warranty of 

15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

16# GNU General Public License for more details. 

17# 

18# You should have received a copy of the LSST License Statement and 

19# the GNU General Public License along with this program. If not, 

20# see <https://www.lsstcorp.org/LegalNotices/>. 

21# 

22 

23import os 

24import unittest 

25import warnings 

26 

27from lsst.utils import getPackageDir 

28import lsst.utils.tests 

29 

30import lsst.daf.persistence as dafPersist 

31 

32 

33class WcsCardsTestCase(lsst.utils.tests.TestCase): 

34 """Test wcs keywords in the metadata""" 

35 

36 def setUp(self): 

37 try: 

38 datadir = getPackageDir("testdata_decam") 

39 except LookupError: 

40 message = "testdata_decam not setup. Skipping." 

41 warnings.warn(message) 

42 raise unittest.SkipTest(message) 

43 self.butler = dafPersist.Butler(root=os.path.join(datadir, "rawData")) 

44 self.dataId = {'visit': 229388, 'ccdnum': 1} 

45 

46 def tearDown(self): 

47 del self.butler 

48 

49 def testRawWcs(self): 

50 """Test wcs keywords are removed from the metadata of the raw Exposure""" 

51 exp = self.butler.get("raw", self.dataId, immediate=True) 

52 self.assertFalse(exp.getMetadata().exists('CTYPE1')) 

53 self.assertFalse(exp.getMetadata().exists('CD1_2')) 

54 self.assertFalse(exp.getMetadata().exists('CRPIX2')) 

55 self.assertFalse(exp.getMetadata().exists('PV1_4')) 

56 self.assertFalse(exp.getMetadata().exists('PV2_10')) 

57 

58 

59class MemoryTester(lsst.utils.tests.MemoryTestCase): 

60 pass 

61 

62 

63def setup_module(module): 

64 lsst.utils.tests.init() 

65 

66 

67if __name__ == "__main__": 67 ↛ 68line 67 didn't jump to line 68, because the condition on line 67 was never true

68 lsst.utils.tests.init() 

69 unittest.main()