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

from .baseMetric import BaseMetric 

from .simpleMetrics import Coaddm5Metric 

from lsst.sims.photUtils import Sed 

 

__all__ = ['ExgalM5'] 

 

class ExgalM5(BaseMetric): 

""" 

Calculate co-added five-sigma limiting depth after dust extinction. 

 

Uses photUtils 

""" 

def __init__(self, m5Col='fiveSigmaDepth', units='mag', 

lsstFilter='r', wavelen_min=None , wavelen_max=None , wavelen_step=1., **kwargs ): 

""" 

Args: 

m5Col (str): Column name that ('fiveSigmaDepth') 

units (str): units of the metric ('mag') 

lsstFilter (str): Which LSST filter to calculate m5 for 

wavelen_min (float): Minimum wavength of your filter (None) 

wavelen_max (float): (None) 

wavelen_step (float): (1.) 

**kwargs: 

""" 

maps = ['DustMap'] 

waveMins={'u':330.,'g':403.,'r':552.,'i':691.,'z':818.,'y':950.} 

waveMaxes={'u':403.,'g':552.,'r':691.,'i':818.,'z':922.,'y':1070.} 

 

if lsstFilter is not None: 

wavelen_min = waveMins[lsstFilter] 

wavelen_max = waveMaxes[lsstFilter] 

 

self.m5Col = m5Col 

super(ExgalM5, self).__init__(col=[self.m5Col], 

maps=maps, units=units, **kwargs) 

 

testsed = Sed() 

testsed.setFlatSED(wavelen_min = wavelen_min, 

wavelen_max = wavelen_max, wavelen_step = 1) 

self.a,self.b = testsed.setupCCM_ab() 

self.R_v = 3.1 

self.Coaddm5Metric = Coaddm5Metric(m5Col=m5Col) 

 

 

def run(self, dataSlice, slicePoint=None): 

""" 

Compute the co-added m5 depth and then apply extinction to that magnitude. 

 

Args: 

dataSlice (np.array): 

slicePoint (dict): 

Returns: 

float that is the dust atennuated co-added m5-depth. 

""" 

 

m5 = self.Coaddm5Metric.run(dataSlice) 

A_x = (self.a[0]+self.b[0]/self.R_v)*(self.R_v*slicePoint['ebv']) 

result = m5-A_x 

return result