| 
 
	积分17567贡献 精华在线时间 小时注册时间2013-6-7最后登录1970-1-1 
 | 
 
 
 楼主|
发表于 2020-8-28 16:09:28
|
显示全部楼层 
| # -*- coding: utf-8 -*- """
 Created on Thu Aug 27 15:06:01 2020
 绘制风云4可见光2km通道图像
 @author: micapsadm
 """
 
 import cartopy.crs as ccrs
 import cartopy.feature as cfeature
 import matplotlib.pyplot as plt
 import h5py  #导入工具包
 import numpy as np
 import matplotlib.pyplot as plt
 import cartopy.crs as ccrs
 import cartopy.feature as cfeature
 from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
 
 f = h5py.File(r'K:\风云\FY4A-_AGRI--_N_REGC_1047E_L1-_FDI-_MULT_NOM_20190804232334_20190804232750_2000M_V0001.HDF','r')
 print(f.keys())
 a = f['NOMChannel06'][:]
 print((f['NOMChannel01']).shape)
 print(a.shape)
 print(f['NOMObsColumn'])
 print(a.max(),a.min())
 
 
 box = [70,100,25,40]
 
 xstep,ystep = 5,5
 fig = plt.figure(figsize = (8,8))
 
 #选择绘图区域
 a = a[500:2000,2000:4000]
 print(a)
 crs = ccrs.LambertConformal(central_longitude=91.13,central_latitude=29.67)
 
 ax = fig.add_subplot(1,1,1,projection=crs)
 # im = ax.imshow(a,cmap='gist_gray')
 #可见光云图,vmax设置511,1023等。红外不设置
 im = ax.imshow(a,cmap='gist_gray',vmax=511,vmin=0,origin='upper')
 
 plt.show()
 | 
 |