Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions test/test_losreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,25 +192,42 @@ def test_los_to_lv_3c():

def test_los_to_lv_4():
assert np.allclose(
inc_hd_to_enu(35, 0),
np.array([0, np.sin(np.radians(35)), np.cos(np.radians(35))])
inc_hd_to_enu(90, 0),
np.array([0, 1, 0])
)


def test_los_to_lv_5():
assert np.allclose(
inc_hd_to_enu(35, 180),
np.array([0, -np.sin(np.radians(35)), np.cos(np.radians(35))])
inc_hd_to_enu(90, 90),
np.array([1, 0, 0])
)


def test_los_to_lv_6():
assert np.allclose(
inc_hd_to_enu(35, 90),
np.array([-np.sin(np.radians(35)), 0, np.cos(np.radians(35))])
inc_hd_to_enu(90, 180),
np.array([0, -1, 0])
)


def test_los_to_lv_7():
assert np.allclose(
inc_hd_to_enu(90, 270),
np.array([-1, 0, 0])
)

def test_los_to_lv_8():
assert np.allclose(
inc_hd_to_enu(45, 90),
np.array([np.sqrt(2)/2, 0, np.sqrt(2)/2])
)

def test_los_to_lv_9():
assert np.allclose(
inc_hd_to_enu(45, 180),
np.array([0, -np.sqrt(2)/2, np.sqrt(2)/2])
)

def test_zenith_1():
assert np.allclose(
getZenithLookVecs(np.array([0]), np.array([0]), np.array([0])),
Expand Down
2 changes: 1 addition & 1 deletion tools/RAiDER/losreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def inc_hd_to_enu(incidence, heading):
if np.any(incidence < 0):
raise ValueError('inc_hd_to_enu: Incidence angle cannot be less than 0')

east = sind(incidence) * cosd(heading + 90)
east = - sind(incidence) * cosd(heading + 90)
north = sind(incidence) * sind(heading + 90)
up = cosd(incidence)

Expand Down