当前位置: 首页>>代码示例>>Python>>正文


Python Apex.geo2apex方法代码示例

本文整理汇总了Python中apexpy.Apex.geo2apex方法的典型用法代码示例。如果您正苦于以下问题:Python Apex.geo2apex方法的具体用法?Python Apex.geo2apex怎么用?Python Apex.geo2apex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在apexpy.Apex的用法示例。


在下文中一共展示了Apex.geo2apex方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_geo2apex_undefined_warning

# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import geo2apex [as 别名]
def test_geo2apex_undefined_warning():
    A = Apex(date=2000, refh=10000)
    with warnings.catch_warnings(record=True) as w:
        ret = A.geo2apex(0, 0, 0)
        A.geo2apex(0, 0, 0)
        assert ret[0] == -9999
        assert len(w) == 2
        assert issubclass(w[-1].category, UserWarning)
        assert 'set to -9999 where' in str(w[-1].message)
开发者ID:cmeeren,项目名称:apexpy,代码行数:11,代码来源:test_Apex.py

示例2: test_geo2apex_invalid_lat

# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import geo2apex [as 别名]
def test_geo2apex_invalid_lat():
    A = Apex(date=2000, refh=300)
    with pytest.raises(ValueError):
        A.geo2apex(91, 0, 0)
    with pytest.raises(ValueError):
        A.geo2apex(-91, 0, 0)
    A.geo2apex(90, 0, 0)
    A.geo2apex(-90, 0, 0)

    assert_allclose(A.geo2apex(90+1e-5, 0, 0), A.geo2apex(90, 0, 0), rtol=0, atol=1e-8)
开发者ID:cmeeren,项目名称:apexpy,代码行数:12,代码来源:test_Apex.py

示例3: test_geo2apex_vectorization

# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import geo2apex [as 别名]
def test_geo2apex_vectorization():
    A = Apex(date=2000, refh=300)
    assert A.geo2apex([60, 60], 15, 100)[0].shape == (2,)
    assert A.geo2apex(60, [15, 15], 100)[0].shape == (2,)
    assert A.geo2apex(60, 15, [100, 100])[0].shape == (2,)
开发者ID:cmeeren,项目名称:apexpy,代码行数:7,代码来源:test_Apex.py

示例4: test_geo2apex

# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import geo2apex [as 别名]
def test_geo2apex():
    A = Apex(date=2000, refh=300)
    lat, lon = A.geo2apex(60, 15, 100)
    assert_allclose((lat, lon), A._geo2apex(60, 15, 100))
    assert type(lat) != np.ndarray
    assert type(lon) != np.ndarray
开发者ID:cmeeren,项目名称:apexpy,代码行数:8,代码来源:test_Apex.py

示例5: test_convert_geo2mlt

# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import geo2apex [as 别名]
def test_convert_geo2mlt():
    datetime = dt.datetime(2000, 3, 9, 14, 25, 58)
    A = Apex(date=2000, refh=300)
    assert_allclose(A.convert(60, 15, 'geo', 'mlt', height=100, ssheight=2e5, datetime=datetime)[1], A.mlon2mlt(A.geo2apex(60, 15, 100)[1], datetime, ssheight=2e5))
开发者ID:cmeeren,项目名称:apexpy,代码行数:6,代码来源:test_Apex.py

示例6: test_convert_geo2apex

# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import geo2apex [as 别名]
def test_convert_geo2apex():
    A = Apex(date=2000, refh=300)
    assert_allclose(A.convert(60, 15, 'geo', 'apex', height=100), A.geo2apex(60, 15, 100))
开发者ID:cmeeren,项目名称:apexpy,代码行数:5,代码来源:test_Apex.py


注:本文中的apexpy.Apex.geo2apex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。