coordinates.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:pyrsss 作者: butala 项目源码 文件源码
def mag_parallels(date, parallels=range(-75, 76, 15), height=350, N=1000):
    """
    Return a mapping between magnetic latitudes specified by
    *parallels* to the tuple of mapped geographic latitudes and
    longitudes. The mapping is made across *N* uniformly spaced
    geographic longitudes, on :class:`datetime` *date*, and at
    *height* (in [km]) in apex geomagnetic coordinates. If *date* is
    None, use the current date and time in the coordinate
    transformation.
    """
    apex = Apex(date=date)
    parallel_map = OrderedDict()
    lons = NP.linspace(-180, 180, N)
    for parallel in parallels:
        glat, glon = apex.convert(parallel,
                                  lons,
                                  source='apex',
                                  dest='geo')
        # sort by geographic longitude
        glat, glon = zip(*sorted(zip(glat, glon), key=lambda x: x[1]))
        parallel_map[parallel] = glat, glon
    return parallel_map
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号