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

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

import unittest 

import lsst.afw.geom as afwGeom 

import lsst.utils.tests 

from helper import skyMapTestCase 

 

try: 

import healpy 

except Exception: 

healpy = None 

 

from lsst.skymap.healpixSkyMap import HealpixSkyMap 

 

 

class HealpixTestCase(skyMapTestCase.SkyMapTestCase): 

 

def setUp(self): 

if not healpy: 

self.skipTest("Missing healpy dependency.") 

 

config = HealpixSkyMap.ConfigClass() 

nside = 2**config.log2NSide 

self.setAttributes( 

SkyMapClass=HealpixSkyMap, 

name="healpix", 

config=config, 

numTracts=healpy.nside2npix(nside), 

numNeighbors=1, 

neighborAngularSeparation=healpy.max_pixrad(nside) * afwGeom.radians, 

) 

 

def testSha1Compare(self): 

"""Test that HealpixSkyMap's extra state is included in its hash.""" 

defaultSkyMap = self.getSkyMap() 

for log2NSide in (3, 4): 

config = self.getConfig() 

config.log2NSide = log2NSide 

skyMap = self.getSkyMap(config=config) 

self.assertNotEqual(skyMap, defaultSkyMap) 

for nest in (True,): 

config = self.getConfig() 

config.nest = nest 

skyMap = self.getSkyMap(config=config) 

self.assertNotEqual(skyMap, defaultSkyMap) 

 

def tearDown(self): 

if hasattr(self, "config"): 

del self.config 

 

 

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

pass 

 

 

def setup_module(module): 

lsst.utils.tests.init() 

 

 

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

lsst.utils.tests.init() 

unittest.main()