def test_map_to_height_conjugate(): A = Apex(date=2000, refh=300) assert_allclose( A.map_to_height(60, 15, 100, 10000, conjugate=True, precision=1e-10), (-25.424892425537109, 27.310417175292969, 1.2074182222931995e-6)) assert_allclose( A.map_to_height(30, 170, 100, 500, conjugate=True, precision=1e-2), (-13.76642894744873, 164.24259948730469, 0.00056820799363777041))
def test_map_to_height(): A = Apex(date=2000, refh=300) assert_allclose( A.map_to_height(60, 15, 100, 10000, conjugate=False, precision=1e-10), (31.841459274291992, 17.916629791259766, 0)) assert_allclose( A.map_to_height(30, 170, 100, 500, conjugate=False, precision=1e-2), (25.727252960205078, 169.60546875, 0.00017655163537710905))
def test_map_to_height_vectorization(): apex_out = Apex(date=2000, refh=300) assert_allclose(apex_out.map_to_height([60, 60], 15, 100, 100), ([60] * 2, [15] * 2, [3.4150946248701075e-6] * 2), rtol=1e-5) assert_allclose(apex_out.map_to_height(60, [15, 15], 100, 100), ([60] * 2, [15] * 2, [3.4150946248701075e-6] * 2), rtol=1e-5) assert_allclose(apex_out.map_to_height(60, 15, [100, 100], 100), ([60] * 2, [15] * 2, [3.4150946248701075e-6] * 2), rtol=1e-5) assert_allclose(apex_out.map_to_height(60, 15, 100, [100, 100]), ([60] * 2, [15] * 2, [3.4150946248701075e-6] * 2), rtol=1e-5)
def test_map_to_height_same_height(): apex_out = Apex(date=2000, refh=300) assert_allclose(apex_out.map_to_height(60, 15, 100, 100, conjugate=False, precision=1e-10), (60, 15, 3.4150946248701075e-6), rtol=1e-5)
def test_map_to_height_ApexHeightError(): A = Apex(date=2000, refh=300) with pytest.raises(ApexHeightError): A.map_to_height(0, 15, 100, 10000)
def test_map_to_height_vectorization(): A = Apex(date=2000, refh=300) assert_allclose(A.map_to_height([60, 60], 15, 100, 100), ([60]*2, [15]*2, [3.4150946248701075e-6]*2), rtol=1e-5) assert_allclose(A.map_to_height(60, [15, 15], 100, 100), ([60]*2, [15]*2, [3.4150946248701075e-6]*2), rtol=1e-5) assert_allclose(A.map_to_height(60, 15, [100, 100], 100), ([60]*2, [15]*2, [3.4150946248701075e-6]*2), rtol=1e-5) assert_allclose(A.map_to_height(60, 15, 100, [100, 100]), ([60]*2, [15]*2, [3.4150946248701075e-6]*2), rtol=1e-5)
def test_map_to_height_conjugate(): A = Apex(date=2000, refh=300) assert_allclose(A.map_to_height(60, 15, 100, 10000, conjugate=True, precision=1e-10), (-25.424892425537109, 27.310417175292969, 1.2074182222931995e-6)) assert_allclose(A.map_to_height(30, 170, 100, 500, conjugate=True, precision=1e-2), (-13.76642894744873, 164.24259948730469, 0.00056820799363777041))
def test_map_to_height_same_height(): A = Apex(date=2000, refh=300) assert_allclose(A.map_to_height(60, 15, 100, 100, conjugate=False, precision=1e-10), (60, 15, 3.4150946248701075e-6), rtol=1e-5)
def test_map_to_height(): A = Apex(date=2000, refh=300) assert_allclose(A.map_to_height(60, 15, 100, 10000, conjugate=False, precision=1e-10), (31.841459274291992, 17.916629791259766, 0)) assert_allclose(A.map_to_height(30, 170, 100, 500, conjugate=False, precision=1e-2), (25.727252960205078, 169.60546875, 0.00017655163537710905))
def test_map_to_height_ApexHeightError(): apex_out = Apex(date=2000, refh=300) with pytest.raises(ApexHeightError): apex_out.map_to_height(0, 15, 100, 10000)