- 积分
- 4182
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-27
- 最后登录
- 1970-1-1
|
发表于 2019-1-24 12:02:17
|
显示全部楼层
本帖最后由 孤蓝et 于 2019-1-24 12:07 编辑
谢谢老师。按照老师的FY2E示例,刚已经测试出来了。
- #Add data file
- fn = 'D:/FY/FY4A-_AGRI--_N_REGC_1047E_L1-_FDI-_MULT_NOM_20190123043000_20190123043416_4000M_V0001.HDF'
- f = addfile(fn)
- print(f)
- #Get data
- NOMChannel02 = f['NOMChannel02']
- print(NOMChannel02)
复制代码 利用上述代码:
print(f),我可以看到这个HDF的信息,包括卫星位置,高度,变量等信息;
print(NOMChannel02)可以查看到具体的变量信息,具体如下:
short NOMChannel02(null,null):
NOMChannel02: valid_range = 0US, 4095US
NOMChannel02: FillValue = -1US
NOMChannel02: Intercept = 0.0f
NOMChannel02: Slope = 1.0f
NOMChannel02: units = "DN"
NOMChannel02: center_wavelength = "0.65um"
NOMChannel02: band_names = "band2(band number is range from 1 to 14)"
NOMChannel02: long_name = "0.65um channel 1km image data layer"
NOMChannel02: _Unsigned = "true"
但是,还有三个疑问:
第一个,FY4的数据是全圆盘图和区域图穿插生成的,我此处使用的是区域图,投影是否和全圆盘图有差异?
第二个,后续,x 、y这个怎么理解?麻烦老师指点下?
- #Set x/y
- x = linspace(-5750000.0,5750000.0, 2288)
- y = linspace(-5750000.0,5750000.0, 2288)
例如其中的5750000,2288这两个量如何理解,我是否需要配合FY4的数据描述信息来修改?
第三个,如果绘制某一个变量的图形,我直接利用demo中的NOMChannel02 = f['NOMChannel02'],就可以了吗?运行程序有提示错误,是不是我读取数据的方式有问题?
>>> run script...
Traceback (most recent call last):
File "D:\FY\test.py", line 13, in <module>
layer = imshowm(x, y, NOMChannel02, 20, proj=ax.proj)
File "D:\MeteoInfo_1.6.10\MeteoInfo\pylib\mipylib\plotlib\miplot.py", line 2212, in imshowm
r = gca.imshow(*args, **kwargs)
File "D:\MeteoInfo_1.6.10\MeteoInfo\pylib\mipylib\plotlib\mapaxes.py", line 967, in imshow
gdata = minum.asgridarray(a, x, y, fill_value)
File "D:\MeteoInfo_1.6.10\MeteoInfo\pylib\mipylib\numeric\minum.py", line 1711, in asgridarray
gdata = GridArray(data.asarray(), x.asarray(), y.asarray(), fill_value)
AttributeError: DimVariable instance has no attribute 'asarray'
|
|