test_ease2_grid.py 文件源码

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

项目:ease_grid 作者: TUW-GEO 项目源码 文件源码
def test_EASE2_global_25km():

    test_path = os.path.join(
        os.path.dirname(os.path.abspath(__file__)),
        'test_data')
    test_lat = os.path.join(test_path, 'EASE2_M25km.lats.1388x584x1.double')
    test_lon = os.path.join(test_path, 'EASE2_M25km.lons.1388x584x1.double')
    egrid = EASE2_grid(25000, map_scale=25025.2600081)
    assert egrid.shape == (584, 1388)
    nptest.assert_almost_equal(egrid.map_scale, 25025.2600081)
    lat_should = np.fromfile(test_lat, dtype=np.float64)
    lon_should = np.fromfile(test_lon, dtype=np.float64)
    nptest.assert_almost_equal(egrid.londim,
                               lon_should.reshape((584, 1388))[100, :])
    nptest.assert_almost_equal(egrid.latdim,
                               lat_should.reshape((584, 1388))[:, 120])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号