Coverage for python/lsst/sims/catUtils/mixins/EBVmixin.py : 73%

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
5from lsst.sims.catalogs.decorators import cached
6from lsst.sims.catUtils.dust import EBVmap, EBVbase
8__all__ = ["EBVmixin"]
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 """
17 #and finally, here is the getter
18 @cached
19 def get_EBV(self):
20 """
21 Getter for the InstanceCatalog framework
22 """
24 galacticCoordinates=numpy.array([self.column_by_name('glon'),self.column_by_name('glat')])
26 EBV_out=numpy.array(self.calculateEbv(galacticCoordinates=galacticCoordinates,interp=True))
27 return EBV_out
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')