Skip to content

Commit

Permalink
Responding to comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
delucchi-cmu committed Jul 10, 2023
1 parent 50b7143 commit c4c84ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion tests/.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ max-bool-expr=5
max-branches=20

# Maximum number of locals for function / method body.
max-locals=15
# We set this higher in tests to allow a more narrative style.
max-locals=30

# Maximum number of parents for a class (see R0901).
max-parents=7
Expand Down
14 changes: 9 additions & 5 deletions tests/hipscat/pixel_math/test_margin_bounding.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,23 @@ def test_get_margin_bounds_and_wcs():
test_ra3 = 50.61225197
test_dec3 = 14.4767556

test_sc = SkyCoord(
np.array([test_ra1, test_ra2, test_ra3]), np.array([test_dec1, test_dec2, test_dec3]), unit="deg"
)
test_ra = np.array([test_ra1, test_ra2, test_ra3])
test_dec = np.array([test_dec1, test_dec2, test_dec3])

test_sc = SkyCoord(test_ra, test_dec, unit="deg")

scale = pm.get_margin_scale(3, 0.1)
polygon, wcs_margin = pm.get_margin_bounds_and_wcs(3, 4, scale)[0]

assert polygon.area == pytest.approx(756822775.0000424, 0.001)

coord_x, coord_y = wcs_margin.world_to_pixel(test_sc)
expected = np.array([False, True, True])
expected_pixel_coord = PixCoord(coord_x, coord_y)
expected_contains_checks = np.array([False, True, True])

contains_checks = polygon.contains(expected_pixel_coord)

npt.assert_array_equal(polygon.contains(PixCoord(coord_x, coord_y)), expected)
npt.assert_array_equal(contains_checks, expected_contains_checks)


def get_checks_for_bounds(bounds, test_sky_coords):
Expand Down

0 comments on commit c4c84ca

Please sign in to comment.