- 积分
- 1071
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-11-21
- 最后登录
- 1970-1-1
|
发表于 2020-12-24 14:25:59
|
显示全部楼层
最近也是碰到了FY4的数据了,搞了一份输出AWX的。
# 输出为AWX格式
def outAWX(out_filen, head_bin, CalibrationData, grid_data):
grid_data = np.round(grid_data / 16) ##写AWX用
print("output file:" + out_filen)
head = AWXHead()
with open(out_filen, 'wb')as fp:
fp.write(head_bin)
for i in CalibrationData:
i_bin_CalibrationData = struct.pack("H", i)
fp.write(i_bin_CalibrationData)
for i in range(head.FillDataLength):
fill_bin = struct.pack("B", 0)
fp.write(fill_bin)
for idata in grid_data.flatten():
idata_bin = struct.pack("B", int(idata))
fp.write(idata_bin) |
|