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

from .baseMetric import BaseMetric 

from .exgalM5 import ExgalM5 

from ..maps import DustMap 

 

 

__all__ = ['WeakLensingNvisits'] 

 

class WeakLensingNvisits(BaseMetric): 

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

systematics mitigation. 

 

Note: 

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

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

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

dithered RA and Dec should be provided. 

""" 

 

 

def __init__(self, 

maps, 

depthlim=24.5, 

ebvlim=0.2, 

metricName='WeakLensingNvisits', 

**kwargs): 

"""Weak Lensing systematics metric 

 

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

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

""" 

 

super().__init__( 

metricName=metricName, 

col=['fiveSigmaDepth'], 

maps=maps, 

**kwargs 

) 

self.ExgalM5 = ExgalM5() 

self.depthlim = depthlim 

self.ebvlim = ebvlim 

 

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

"""runs the metric 

 

Args: 

dataSlice (ndarray): positional data from querying the database 

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

Returns: 

the number of visits that can observe this healpix point. 

""" 

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

return self.badval 

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

if ExgalM5 < self.depthlim: 

return self.badval 

return len(dataSlice)