def test_small_identical_inputs_noisy(self): """ Tests for input of identical images after noise is added. """ drift = calculation.CalculateDrift(self.small_data, self.small_data_noisy, 1) numpy.testing.assert_almost_equal(drift, (0, 0), 0)
def test_random_drift_noisy(self): """ Tests for image drifted by random drift value after noise is added. """ drift = calculation.CalculateDrift(self.data[0], self.data_random_drifted_noisy, 10) numpy.testing.assert_almost_equal(drift, (self.deltac, self.deltar), 1)
def test_known_drift_noisy(self): """ Tests for image drifted by known drift value after noise is added. """ drift = calculation.CalculateDrift(self.data[0], self.data_drifted_noisy, 1) numpy.testing.assert_almost_equal(drift, (-3, 5), 1)
def test_small_random_drift(self): """ Tests for image drifted by random drift value. """ drift = calculation.CalculateDrift(self.small_data, self.small_data_random_drifted, 10) numpy.testing.assert_almost_equal( drift, (self.small_deltac, self.small_deltar), 0)
def test_different_precisions(self): """ Tests for image drifted by random drift value using different precisions. """ drift = calculation.CalculateDrift(self.data[0], self.data_random_drifted, 1) numpy.testing.assert_almost_equal(drift, (self.deltac, self.deltar), 0) drift = calculation.CalculateDrift(self.data[0], self.data_random_drifted, 10) numpy.testing.assert_almost_equal(drift, (self.deltac, self.deltar), 1) drift = calculation.CalculateDrift(self.data[0], self.data_random_drifted, 100) numpy.testing.assert_almost_equal(drift, (self.deltac, self.deltar), 2) drift = calculation.CalculateDrift(self.data[0], self.data_random_drifted, 1000) numpy.testing.assert_almost_equal(drift, (self.deltac, self.deltar), 3)
def test_identical_inputs(self): """ Tests for input of identical images. """ drift = calculation.CalculateDrift(self.data[0], self.data[0], 1) numpy.testing.assert_almost_equal(drift, (0, 0), 1)