Skip to content

Commit

Permalink
fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestfwilliams committed May 29, 2024
1 parent f312889 commit c0fb7f5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_create_browse.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ def test_normalize_image_array():


def test_create_browse_arry():
test_vv = np.array([[0, 1], [2, 3], [np.nan, np.nan]])
test_vh = np.array([[np.nan, np.nan], [4, 5], [6, 7]])
vv_min, vv_max = 0.02, 0.3
test_vv = np.array([[0, vv_min], [(vv_min + vv_max) / 2, vv_max], [np.nan, np.nan]])
vh_min, vh_max = 0.003, 0.08
test_vh = np.array([[np.nan, np.nan], [(vh_min + vh_max) / 2, vh_max], [0, vh_min]])
output_array = create_browse.create_browse_array(test_vv, test_vh)
assert output_array.shape == (3, 2, 4)
assert np.array_equal(output_array[:, :, 0], np.array([[0, 145], [210, 255], [0, 0]]))
assert np.array_equal(output_array[:, :, 1], np.array([[0, 0], [0, 145], [210, 255]]))
assert np.array_equal(output_array[:, :, 0], np.array([[0, 0], [180, 255], [0, 0]]))
assert np.array_equal(output_array[:, :, 1], np.array([[0, 0], [180, 255], [0, 0]]))
assert np.array_equal(output_array[:, :, 0], output_array[:, :, 2])
assert np.array_equal(output_array[:, :, 3], np.array([[0, 0], [255, 255], [0, 0]]))

0 comments on commit c0fb7f5

Please sign in to comment.