test_ease2_grid.py 文件源码

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

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

    test_path = os.path.join(
        os.path.dirname(os.path.abspath(__file__)),
        'test_data')
    test_lat = os.path.join(test_path, 'EASE2_M36km.lats.964x406x1.double')
    test_lon = os.path.join(test_path, 'EASE2_M36km.lons.964x406x1.double')
    egrid = EASE2_grid(36000)
    assert egrid.shape == (406, 964)
    nptest.assert_almost_equal(egrid.x_pixel, egrid.map_scale)
    nptest.assert_almost_equal(egrid.y_pixel, egrid.map_scale)
    nptest.assert_almost_equal(egrid.map_scale, 36032.220840583752)
    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((406, 964))[0, :])
    nptest.assert_almost_equal(egrid.latdim,
                               lat_should.reshape((406, 964))[:, 0])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号