@@ -23,6 +23,9 @@ def test_sigma_clipping_no_failures(self):
23
23
self .assertTrue (new_xvals .all () == xvalues .all ()
24
24
and new_yvals .all () == yvalues .all ())
25
25
26
+
27
+ print ("sigma_clipping no failures passed..." )
28
+
26
29
27
30
def test_sortxy (self ):
28
31
"""
@@ -41,6 +44,8 @@ def test_sortxy(self):
41
44
self .assertTrue (list (sortedx ) == list (range (1 , 101 )))
42
45
self .assertTrue (list (sortedy ) == list (range (401 , 501 )))
43
46
47
+ print ("sortxy() passed..." )
48
+
44
49
45
50
46
51
def test_sigma_clipping_failures1 (self ):
@@ -62,6 +67,8 @@ def test_sigma_clipping_failures1(self):
62
67
self .assertTrue (np .array_equal (xvalues , new_xvals ))
63
68
self .assertTrue (np .array_equal (yvalues , new_yvals ))
64
69
70
+ print ("sigma_clipping_failures1 passed..." )
71
+
65
72
def test_sigma_clipping_failures2 (self ):
66
73
"""
67
74
Tests sigma clipping function on failing the first and last elements.
@@ -81,33 +88,25 @@ def test_sigma_clipping_failures2(self):
81
88
self .assertTrue (np .array_equal (xvalues , new_xvals ))
82
89
self .assertTrue (np .array_equal (yvalues , new_yvals ))
83
90
84
- # def test_sigma_clipping_failures3(self):
85
- # """
86
- # This ensures that the alert message is displayed if over 10% of
87
- # the pixels are removed.
88
- # """
89
- # xvalues = np.arange(10)
90
- # yvalues = np.random.normal(10, 3, 10)
91
- # yvalues[3] = -5
92
- # yvalues[5] = 100
93
-
94
- # new_xvals, new_yvals = util.sigma_clip(xvalues, yvalues)
95
-
96
- # xvalues = np.delete(xvalues, [3, 5])
97
- # yvalues = np.delete(yvalues, [3, 5])
98
-
99
- # message = "Over 10% of pixels have been rejected in the sigma_clip routine."
100
-
101
- # expected = """
102
- # ==========================
103
- # Warning: %s
104
- # ==========================
105
- # """
106
- # captured = sys.__stdout__
107
- # print(sys.__stdout__)
108
- # print(expected % message)
109
-
110
- # self.assertEqual(expected, captured)
91
+ print ("sigma_clipping_failures2 passed..." )
92
+
93
+
94
+ def test_min_ind_range (self ):
95
+ test_array1 = [1 , 3 , 4 , 5 , 9 , 0 , 3 , 4 , - 1 , 30 ]
96
+ start , end = 2 , 5
97
+ min_ind = util .min_ind_range (test_array1 , start , end )
98
+ self .assertTrue (min_ind == 2 )
99
+
100
+ start , end = 0 , len (test_array1 )// 2
101
+ min_ind = util .min_ind_range (test_array1 , start , end )
102
+ self .assertTrue (min_ind == 0 )
103
+
104
+ start , end = len (test_array1 )// 2 , len (test_array1 )
105
+ min_ind = util .min_ind_range (test_array1 , start , end )
106
+ self .assertTrue (min_ind == 8 )
107
+
108
+ print ("min_ind_range() tests passed..." )
109
+
111
110
112
111
113
112
if __name__ == "__main__" :
0 commit comments