Skip to content

Commit

Permalink
Add unit test for pixel inversion with small image
Browse files Browse the repository at this point in the history
  • Loading branch information
mcara committed Feb 7, 2024
1 parent f8536b4 commit 2d98b97
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drizzle/tests/test_overlap_calc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
from math import sqrt
from itertools import product

import numpy as np

Expand Down Expand Up @@ -70,6 +71,17 @@ def test_invert_pixmap():
assert np.allclose(xyin, [xr, yr], atol=0.05)


def test_invert_small_pixmap():
yin, xin = np.indices((2, 2), dtype=float)
pixmap = np.dstack([xin, yin])

test_coords = list(product(*(2 * [[-0.5, 1.5]])))

for xr, yr in test_coords:
xyin = invert_pixmap(pixmap, [xr, yr], [[-0.5, 1.5], [-0.5, 1.5]])
assert np.allclose(xyin, [xr, yr], atol=0.05)


def test_poly_intersection_with_self():
p = [(0, 0), (1, 0), (1, 1), (0, 1)]

Expand Down

0 comments on commit 2d98b97

Please sign in to comment.