def test_rmsclippedsubregion(self): o = numpy.ones((800, 800)) sub = statistics.subregion(o) clip = statistics.clip(sub) rms = statistics.rms(clip) self.assertEqual(rms, statistics.rms_with_clipped_subregion(o))
def test_clip(self): a = numpy.ones([50, 50]) * 10 a[20, 20] = 20 clipped = statistics.clip(a) check = numpy.array([10] * (50*50-1)) assert_array_equal(clipped, check)
def test_clip(self): a = numpy.ones([50, 50]) * 10 a[20, 20] = 20 clipped = statistics.clip(a) check = numpy.array([10] * (50 * 50 - 1)) assert_array_equal(clipped, check)