Coverage for tests/testDustMap.py : 54%

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
1import unittest
2import numpy as np
3from lsst.sims.catUtils.dust import EBV
4import lsst.utils.tests
5from lsst.sims.utils.CodeUtilities import sims_clean_up
8class TestDustMap(unittest.TestCase):
10 @classmethod
11 def tearDownClass(cls):
12 sims_clean_up()
14 def testCreate(self):
15 """ Test that we can create the dustmap"""
17 # Test that we can load without error
18 dustmap = EBV.EBVbase()
19 dustmap.load_ebvMapNorth()
20 dustmap.load_ebvMapSouth()
22 # Test the interpolation
23 ra = np.array([0., 0., np.radians(30.)])
24 dec = np.array([0., np.radians(30.), np.radians(-30.)])
26 ebvMap = dustmap.calculateEbv(equatorialCoordinates=np.array([ra, dec]),
27 interp=False)
28 assert(np.size(ebvMap) == np.size(ra))
31class TestMemory(lsst.utils.tests.MemoryTestCase):
32 pass
35def setup_module(module):
36 lsst.utils.tests.init()
39if __name__ == "__main__": 39 ↛ 40line 39 didn't jump to line 40, because the condition on line 39 was never true
40 lsst.utils.tests.init()
41 unittest.main()