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

1import math 

2import numpy 

3import os 

4 

5from lsst.sims.catalogs.decorators import cached 

6from lsst.sims.catUtils.dust import EBVmap, EBVbase 

7 

8__all__ = ["EBVmixin"] 

9 

10 

11class EBVmixin(EBVbase): 

12 """ 

13 This mixin class contains the getters which a catalog object will use to call 

14 calculateEbv in the EBVbase class 

15 """ 

16 

17 #and finally, here is the getter 

18 @cached 

19 def get_EBV(self): 

20 """ 

21 Getter for the InstanceCatalog framework 

22 """ 

23 

24 galacticCoordinates=numpy.array([self.column_by_name('glon'),self.column_by_name('glat')]) 

25 

26 EBV_out=numpy.array(self.calculateEbv(galacticCoordinates=galacticCoordinates,interp=True)) 

27 return EBV_out 

28 

29 @cached 

30 def get_galacticAv(self): 

31 """ 

32 Getter to return galactic(Milky Way) Av based on EBV values 

33 from getter (reading dustmaps) and the RV value from galacticRv 

34 """ 

35 return self.column_by_name('EBV')*self.column_by_name('galacticRv') 

36 

37