Hide keyboard shortcuts

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

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

import unittest 

import numpy as np 

from lsst.sims.catUtils.dust import EBV 

import lsst.utils.tests 

from lsst.sims.utils.CodeUtilities import sims_clean_up 

 

 

class TestDustMap(unittest.TestCase): 

 

@classmethod 

def tearDownClass(cls): 

sims_clean_up() 

 

def testCreate(self): 

""" Test that we can create the dustmap""" 

 

# Test that we can load without error 

dustmap = EBV.EBVbase() 

dustmap.load_ebvMapNorth() 

dustmap.load_ebvMapSouth() 

 

# Test the interpolation 

ra = np.array([0., 0., np.radians(30.)]) 

dec = np.array([0., np.radians(30.), np.radians(-30.)]) 

 

ebvMap = dustmap.calculateEbv(equatorialCoordinates=np.array([ra, dec]), 

interp=False) 

assert(np.size(ebvMap) == np.size(ra)) 

 

 

class TestMemory(lsst.utils.tests.MemoryTestCase): 

pass 

 

 

def setup_module(module): 

lsst.utils.tests.init() 

 

 

39 ↛ 40line 39 didn't jump to line 40, because the condition on line 39 was never trueif __name__ == "__main__": 

lsst.utils.tests.init() 

unittest.main()