Loading autocnet/matcher/tests/test_subpixel.py +2 −2 Original line number Diff line number Diff line Loading @@ -105,8 +105,8 @@ def test_subpixel_transformed_template(apollo_subsets, delta_x, delta_y, rotatio new_affine, strength, corrmap = sp.subpixel_template(ref_roi, moving_roi, affine, upsampling=8) new_x, new_y = new_affine((moving_roi.x, moving_roi.y))[0] new_x, new_y = new_affine((moving_roi._x, moving_roi._y))[0] assert pytest.approx(new_x, abs=1/5) == expected[0] assert pytest.approx(new_y, abs=1/5) == expected[1] Loading autocnet/transformation/roi.py +2 −2 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ class Roi(): @property def x(self): return self._x #+ self.axr return self._x + self.axr @x.setter def x(self, x): Loading @@ -59,7 +59,7 @@ class Roi(): @property def y(self): return self._y #+ self.ayr return self._y + self.ayr @y.setter def y(self, y): Loading autocnet/transformation/tests/test_roi.py +13 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,19 @@ def test_center(array_with_nodata): roi = Roi(array_with_nodata, 5, 5, size_x=5, size_y=5) assert roi.center == (5,5) @pytest.mark.parametrize("x, y, axr, ayr",[ (10.1, 10.1, .1, .1), (10.5, 10.5, .5, .5), (10.9, 10.9, .9, .9) ]) def test_roi_remainder(x, y, axr, ayr): gd = np.zeros((10,10)) roi = Roi(gd, x, y) pytest.approx(roi.axr, axr) pytest.approx(roi.ayr, ayr) assert roi.x == x assert roi.y == y @pytest.mark.parametrize("x, y, size_arr, size_roi, expected",[ (50, 50, (100,100), (10,10), [40,60,40,60]), (15, 15, (100, 100), (15, 15), [0, 30, 0, 30]), Loading Loading
autocnet/matcher/tests/test_subpixel.py +2 −2 Original line number Diff line number Diff line Loading @@ -105,8 +105,8 @@ def test_subpixel_transformed_template(apollo_subsets, delta_x, delta_y, rotatio new_affine, strength, corrmap = sp.subpixel_template(ref_roi, moving_roi, affine, upsampling=8) new_x, new_y = new_affine((moving_roi.x, moving_roi.y))[0] new_x, new_y = new_affine((moving_roi._x, moving_roi._y))[0] assert pytest.approx(new_x, abs=1/5) == expected[0] assert pytest.approx(new_y, abs=1/5) == expected[1] Loading
autocnet/transformation/roi.py +2 −2 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ class Roi(): @property def x(self): return self._x #+ self.axr return self._x + self.axr @x.setter def x(self, x): Loading @@ -59,7 +59,7 @@ class Roi(): @property def y(self): return self._y #+ self.ayr return self._y + self.ayr @y.setter def y(self, y): Loading
autocnet/transformation/tests/test_roi.py +13 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,19 @@ def test_center(array_with_nodata): roi = Roi(array_with_nodata, 5, 5, size_x=5, size_y=5) assert roi.center == (5,5) @pytest.mark.parametrize("x, y, axr, ayr",[ (10.1, 10.1, .1, .1), (10.5, 10.5, .5, .5), (10.9, 10.9, .9, .9) ]) def test_roi_remainder(x, y, axr, ayr): gd = np.zeros((10,10)) roi = Roi(gd, x, y) pytest.approx(roi.axr, axr) pytest.approx(roi.ayr, ayr) assert roi.x == x assert roi.y == y @pytest.mark.parametrize("x, y, size_arr, size_roi, expected",[ (50, 50, (100,100), (10,10), [40,60,40,60]), (15, 15, (100, 100), (15, 15), [0, 30, 0, 30]), Loading