def test_calculatefirstderivative_yaxis_hard(self): '''Step1 - derivative: testing the first derivative calculation of hard data set - axis y''' [xdata, ydata, edata] = loadCsvFile(self.top_folder + '/hard_data_set.csv') peakfinder = LowResFinder(xdata, ydata, edata) [xdata_first, ydata_first] = peakfinder.get_first_derivative() ydata10= ydata_first[0:10] self.assertEqual(ydata10, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 28.0, -10.0, 18.0])
def test_calculate_first_derivative_xaxis_easy(self): '''Step1 - derivative: testing the first derivative calculation of easy data set - axis x''' [xdata, ydata, edata] = loadCsvFile(self.top_folder + '/easy_data_set.csv') peakfinder = LowResFinder(xdata, ydata, edata) [xdata_first, ydata_first] = peakfinder.get_first_derivative() xdata10= xdata_first[0:10] self.assertEqual(xdata10, [0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5])
def test_calculatefirstderivative_yaxis_easy(self): '''Step1 - derivative: testing the first derivative calculation of easy data set - axis y''' [xdata, ydata, edata] = loadCsvFile(self.top_folder + '/easy_data_set.csv') peakfinder = LowResFinder(xdata, ydata, edata) [xdata_first, ydata_first] = peakfinder.get_first_derivative() ydata10 = ydata_first[0:10] self.assertEqual(ydata10, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 11.0, 0.0])
def test_calculate_first_derivative_xaxis_easy(self): '''Step1 - derivative: testing the first derivative calculation of easy data set - axis x''' [xdata, ydata, edata] = loadCsvFile(self.top_folder + '/easy_data_set.csv') peakfinder = LowResFinder(xdata, ydata, edata) [xdata_first, ydata_first] = peakfinder.get_first_derivative() xdata10 = xdata_first[0:10] self.assertEqual(xdata10, [0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5])