def test_bspline_fit(): # Generate data x = np.linspace(0,np.pi,50) y = np.sin(x) # Fit dfit = xafits.func_fit(x, y, 'bspline', 3, everyn=25) x2 = np.linspace(0,np.pi,100) y2 = xafits.func_val(x2,dfit) np.testing.assert_allclose(y2[50], 0.9941836965580888)
def test_legend_fit(): # Generate data x = np.linspace(0,np.pi,50) y = np.sin(x) # Fit dfit = xafits.func_fit(x, y, 'legendre', 4) x2 = np.linspace(0,np.pi,100) y2 = xafits.func_val(x2,dfit) np.testing.assert_allclose(y2[50], 0.99940823486206976)
def test_poly_fit(): # Generate data x = np.linspace(0,np.pi,50) y = np.sin(x) # Fit dfit = xafits.func_fit(x, y, 'polynomial', 3) x2 = np.linspace(0,np.pi,100) y2 = xafits.func_val(x2,dfit) np.testing.assert_allclose(y2[50], 0.97854984428713754)
def test_bspline_fit(): # Generate data x = np.linspace(0, np.pi, 50) y = np.sin(x) # Fit dfit = xafits.func_fit(x, y, 'bspline', 3, everyn=25) x2 = np.linspace(0, np.pi, 100) y2 = xafits.func_val(x2, dfit) np.testing.assert_allclose(y2[50], 0.9941836965580888)
def test_legend_fit(): # Generate data x = np.linspace(0, np.pi, 50) y = np.sin(x) # Fit dfit = xafits.func_fit(x, y, 'legendre', 4) x2 = np.linspace(0, np.pi, 100) y2 = xafits.func_val(x2, dfit) np.testing.assert_allclose(y2[50], 0.99940823486206976)
def test_poly_fit(): # Generate data x = np.linspace(0, np.pi, 50) y = np.sin(x) # Fit dfit = xafits.func_fit(x, y, 'polynomial', 3) x2 = np.linspace(0, np.pi, 100) y2 = xafits.func_val(x2, dfit) np.testing.assert_allclose(y2[50], 0.97854984428713754)