- 积分
- 19295
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-3-2
- 最后登录
- 1970-1-1
![未绑定新浪微博用户 新浪微博达人勋](source/plugin/sina_login/img/gray.png)
|
发表于 2019-4-9 10:30:05
|
显示全部楼层
- def fy4disk(rawfile,dim):
- sz = np.fromfile(rawfile, dtype=float, count=dim*dim*2)
- latlon = np.reshape(sz,(dim,dim,2))
- lat = latlon[:,:,0]
- lon = latlon[:,:,1]
- lat[lat > 100] = -9999.
- lon[lon < 0 ] = lon[lon < 0 ] + 360.
- lon[lon > 361] = -9999.
- return lon, lat
- if __name__ == '__main__':
- rawfile = r'FullMask_Grid_4000.raw'
- # dim = 5496 # 2km
- dim = 2748 # 4km
- # Two ways of reading an binary file
- # lon, lat = fy4raw(rawfile,dim)
- lon, lat = fy4disk(rawfile,dim)
复制代码 |
|