Ejemplo n.º 1
0
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))
Ejemplo n.º 2
0
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))
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
def test_map_to_height_ApexHeightError():
    A = Apex(date=2000, refh=300)
    with pytest.raises(ApexHeightError):
        A.map_to_height(0, 15, 100, 10000)
Ejemplo n.º 6
0
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)
Ejemplo n.º 7
0
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))
Ejemplo n.º 8
0
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)
Ejemplo n.º 9
0
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))
Ejemplo n.º 10
0
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)