diff --git a/test/test_losreader.py b/test/test_losreader.py index 3a2b3fb92..fdca1e7c6 100644 --- a/test/test_losreader.py +++ b/test/test_losreader.py @@ -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])), diff --git a/tools/RAiDER/losreader.py b/tools/RAiDER/losreader.py index d0fbcfb26..bacd452dc 100644 --- a/tools/RAiDER/losreader.py +++ b/tools/RAiDER/losreader.py @@ -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)