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

from lsst.sims.maf.maps import BaseMap 

from .EBVhp import EBVhp 

import warnings 

 

__all__ = ['DustMap'] 

 

class DustMap(BaseMap): 

""" 

Compute the E(B-V) for each point in a given spatial distribution of slicePoints. 

""" 

 

def __init__(self, interp=False, nside=128): 

""" 

interp: should the dust map be interpolated (True) or just use the nearest value (False). 

""" 

self.keynames = ['ebv'] 

self.interp = interp 

self.nside = nside 

 

def run(self, slicePoints): 

# If the slicer has nside, it's a healpix slicer so we can read the map directly 

if 'nside' in slicePoints: 

if slicePoints['nside'] != self.nside: 

warnings.warn('Slicer value of nside (%i) different from map value (%i), using slicer value' 

% (slicePoints['nside'],self.nside )) 

slicePoints['ebv'] = EBVhp(slicePoints['nside'], pixels=slicePoints['sid']) 

# Not a healpix slicer, look up values based on RA,dec with possible interpolation 

else: 

slicePoints['ebv'] = EBVhp(self.nside, ra=slicePoints['ra'], 

dec=slicePoints['dec'], interp=self.interp) 

 

return slicePoints