File tree 1 file changed +24
-1
lines changed
1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,30 @@ def passed(result):
93
93
)
94
94
95
95
def test_qc2 (self ):
96
- pass
96
+ plot_dir = os .path .join (self .output_dir , "test_qc2" )
97
+ if not os .path .exists (plot_dir ):
98
+ os .makedirs (plot_dir )
99
+
100
+ hergqc = hERGQC (sampling_rate = self .sampling_rate ,
101
+ plot_dir = plot_dir ,
102
+ voltage = self .voltage )
103
+
104
+ # qc2 checks that raw and subtracted SNR are above a minimum threshold
105
+ recording = np .asarray ([0 , 1 ] * 500 + [0 , 10 ] * 500 ) # snr = 70.75
106
+ result = hergqc .qc2 (recording )
107
+ self .assertTrue (result [0 ], f"({ result [1 ]} )" )
108
+
109
+ recording = np .asarray ([0 , 1 ] * 500 + [0 , 6.03125 ] * 500 ) # snr = 25.02
110
+ result = hergqc .qc2 (recording )
111
+ self .assertTrue (result [0 ], f"({ result [1 ]} )" )
112
+
113
+ recording = np .asarray ([0 , 1 ] * 500 + [0 , 6.015625 ] * 500 ) # snr = 24.88
114
+ result = hergqc .qc2 (recording )
115
+ self .assertFalse (result [0 ], f"({ result [1 ]} )" )
116
+
117
+ recording = np .asarray ([0 , 1 ] * 1000 ) # snr = 1.0
118
+ result = hergqc .qc2 (recording )
119
+ self .assertFalse (result [0 ], f"({ result [1 ]} )" )
97
120
98
121
def test_qc3 (self ):
99
122
pass
You can’t perform that action at this time.
0 commit comments