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

1from .baseMetric import BaseMetric 

2from .exgalM5 import ExgalM5 

3from ..maps import DustMap 

4 

5 

6__all__ = ['WeakLensingNvisits'] 

7 

8class WeakLensingNvisits(BaseMetric): 

9 """A proxy metric for WL systematics. Higher value indicated better  

10 systematics mitigation. 

11  

12 Note: 

13 Should be run with the HealpixSlicer. If using dithering (which 

14 should be the case unless dithering is already implemented in the run) 

15 then should be run with a stacker and appropriate column names for  

16 dithered RA and Dec should be provided. 

17 """ 

18 

19 

20 def __init__(self, 

21 maps, 

22 depthlim=24.5, 

23 ebvlim=0.2, 

24 metricName='WeakLensingNvisits', 

25 **kwargs): 

26 """Weak Lensing systematics metric 

27 

28 Computes the average number of visits per point on a HEALPix grid 

29 after a maximum E(B-V) cut and a minimum co-added depth cut. 

30 """ 

31 

32 super().__init__( 

33 metricName=metricName, 

34 col=['fiveSigmaDepth'], 

35 maps=maps, 

36 **kwargs 

37 ) 

38 self.ExgalM5 = ExgalM5() 

39 self.depthlim = depthlim 

40 self.ebvlim = ebvlim 

41 

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

43 """runs the metric 

44 

45 Args: 

46 dataSlice (ndarray): positional data from querying the database 

47 slicePoint (dict): queried data along with data from stackers 

48 Returns: 

49 the number of visits that can observe this healpix point. 

50 """ 

51 if slicePoint['ebv'] > self.ebvlim: 

52 return self.badval 

53 ExgalM5 = self.ExgalM5.run(dataSlice=dataSlice, slicePoint=slicePoint) 

54 if ExgalM5 < self.depthlim: 

55 return self.badval 

56 return len(dataSlice) 

57