예제 #1
0
def test_snr_from_collection_correctess():
    """ Test that snr_from_collection is equivalent to np.mean / np.std """
    images = [np.random.random((64, 64)) for _ in range(10)]
    stack = np.dstack(images)

    from_numpy = np.mean(stack, axis=2) / np.std(stack, axis=2)
    from_skued = snr_from_collection(images)

    assert np.allclose(from_numpy, from_skued)
예제 #2
0
def test_snr_from_collection_trivial():
    """ Test snr_from_collection on series of identical images """
    images = [np.ones((64, 64)) for _ in range(10)]
    snr = snr_from_collection(images)

    assert np.allclose(snr, np.zeros_like(snr))