Coverage for python/lsst/sims/maf/metrics/exgalM5.py : 41%

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
1from .baseMetric import BaseMetric
2from .simpleMetrics import Coaddm5Metric
3from lsst.sims.photUtils import Dust_values
5__all__ = ['ExgalM5']
8class ExgalM5(BaseMetric):
9 """
10 Calculate co-added five-sigma limiting depth after dust extinction.
12 Uses photUtils to calculate dust extinction.
14 Parameters
15 ----------
16 m5Col : str, opt
17 Column name for five sigma depth. Default 'fiveSigmaDepth'.
18 unit : str, opt
19 Label for units. Default 'mag'.
20 """
21 def __init__(self, m5Col='fiveSigmaDepth', metricName='ExgalM5', units='mag',
22 filterCol='filter', **kwargs):
23 # Set the name for the dust map to use. This is gathered into the MetricBundle.
24 maps = ['DustMap']
25 self.m5Col = m5Col
26 self.filterCol = filterCol
27 super().__init__(col=[self.m5Col, self.filterCol], maps=maps, metricName=metricName, units=units, **kwargs)
28 # Set the default wavelength limits for the lsst filters. These are approximately correct.
29 dust_properties = Dust_values()
30 self.Ax1 = dust_properties.Ax1
31 # We will call Coaddm5Metric to calculate the coadded depth. Set it up here.
32 self.Coaddm5Metric = Coaddm5Metric(m5Col=m5Col)
34 def run(self, dataSlice, slicePoint):
35 """
36 Compute the co-added m5 depth and then apply dust extinction to that magnitude.
37 """
38 m5 = self.Coaddm5Metric.run(dataSlice)
39 # Total dust extinction along this line of sight. Correct default A to this EBV value.
40 A_x = self.Ax1[dataSlice[self.filterCol][0]] * slicePoint['ebv']
41 return m5 - A_x