Esempio n. 1
0
 def test_make_src1D_with_ext_6_src_translated(self):
     X = np.array([0.0, 0.1, 0.2, 0.3]) - 10.0
     (X_src, R) = sd.make_src_1D(X=X, ext_x=0.1, n_src=6, R_init=0.2)
     expected_X_src = np.array([-0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5]) - 10.0
     for i, src in enumerate(X_src):
         self.assertAlmostEqual(src, expected_X_src[i], places=6)
Esempio n. 2
0
 def test_make_src1D_negative_coords_4_src(self):
     X = np.array([-0.5, -0.3, -0.1, 0.1])
     (X_src, R) = sd.make_src_1D(X=X, ext_x=0.0, n_src=4, R_init=0.2)
     for i in range(len(X_src)):
         self.assertAlmostEqual(X_src[i], X[i], places=6)
Esempio n. 3
0
 def test_make_src1D_with_ext_6_src(self):
     X = np.array([0.0, 0.1, 0.2, 0.3])
     (X_src, R) = sd.make_src_1D(X=X, ext_x=0.1, n_src=6, R_init=0.2)
     expected_X_src = [-0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5]
     for i in range(len(X_src)):
         self.assertAlmostEqual(X_src[i], expected_X_src[i], places=6)
Esempio n. 4
0
 def test_make_src1D_no_ext_4_src(self):
     X = np.array([0.0, 0.1, 0.2, 0.3])
     (X_src, R) = sd.make_src_1D(X=X, ext_x=0.0, n_src=4, R_init=0.2)
     for i in range(len(X_src)):
         self.assertAlmostEqual(X_src[i], X[i], places=6)
Esempio n. 5
0
 def test_make_src1D_with_ext_6_src_translated(self):
     X = np.array([0.0, 0.1, 0.2, 0.3]) - 10.0
     (X_src, R) = sd.make_src_1D(X=X, ext_x=0.1, n_src=6, R_init=0.2)
     expected_X_src = np.array([-0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5]) - 10.0
     for i, src in enumerate(X_src):
         self.assertAlmostEqual(src, expected_X_src[i], places=6)
Esempio n. 6
0
 def test_make_src1D_with_ext_6_src(self):
     X = np.array([0.0, 0.1, 0.2, 0.3])
     (X_src, R) = sd.make_src_1D(X=X, ext_x=0.1, n_src=6, R_init=0.2)
     expected_X_src = [-0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5]
     for i in xrange(len(X_src)):
         self.assertAlmostEqual(X_src[i], expected_X_src[i], places=6)
Esempio n. 7
0
 def test_make_src1D_negative_coords_4_src(self):
     X = np.array([-0.5, -0.3, -0.1, 0.1])
     (X_src, R) = sd.make_src_1D(X=X, ext_x=0.0, n_src=4, R_init=0.2)
     for i in xrange(len(X_src)):
         self.assertAlmostEqual(X_src[i], X[i], places=6)
Esempio n. 8
0
 def test_make_src1D_no_ext_4_src(self):
     X = np.array([0.0, 0.1, 0.2, 0.3])
     (X_src, R) = sd.make_src_1D(X=X, ext_x=0.0, n_src=4, R_init=0.2)
     for i in xrange(len(X_src)):
         self.assertAlmostEqual(X_src[i], X[i], places=6)