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

import pyfits 

import math 

import numpy 

import os 

 

from lsst.sims.catalogs.decorators import cached 

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

 

__all__ = ["EBVmixin"] 

 

 

class EBVmixin(EBVbase): 

""" 

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

calculateEbv in the EBVbase class 

""" 

 

#and finally, here is the getter 

@cached 

def get_EBV(self): 

""" 

Getter for the InstanceCatalog framework 

""" 

 

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

 

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

return EBV_out 

 

@cached 

def get_galacticAv(self): 

""" 

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

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

""" 

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