Exemple #1
0
 def perform(p0, p1, cm, A):
     assert moments(A, p0, p1, cm) == _slow(A, p0,p1,cm)
Exemple #2
0
 def f(im):
     return moments(im, p0, p1, cm=mh.center_of_mass(im), normalize=1)
Exemple #3
0
def test_smoke():
    assert moments(np.zeros((100,23)), 2, 2) == 0.0
    assert moments(np.ones((100,23)), 2, 2) != 0.0
    assert moments(np.ones((100,23)), 0, 0) == 100*23
    assert moments(np.ones((100,23)), 2, 2) != moments(np.ones((100,23)), 2, 2, cm=(50,12))
Exemple #4
0
 def f(im):
     return moments(im, p0, p1, cm=mh.center_of_mass(im), normalize=1)
Exemple #5
0
def test_against_slow(p0, p1, cm):
    A = (np.arange(2048) % 14).reshape((32, -1))
    assert moments(A, p0, p1, cm) == _slow(A, p0, p1, cm)
Exemple #6
0
def test_smoke():
    assert moments(np.zeros((100, 23)), 2, 2) == 0.0
    assert moments(np.ones((100, 23)), 2, 2) != 0.0
    assert moments(np.ones((100, 23)), 0, 0) == 100 * 23
    assert moments(np.ones(
        (100, 23)), 2, 2) != moments(np.ones((100, 23)), 2, 2, cm=(50, 12))
 def perform(p0, p1, cm, A):
     assert moments(A, p0, p1, cm) == _slow(A, p0, p1, cm)