- 积分
- 378
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-11-6
- 最后登录
- 1970-1-1

|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
各位大神,小白请教个问题:
我利用网上找的代码画出来风云4A的真彩图,但是怎么才能将行列转化为经纬度并且投影呢?
代码附上:
from netCDF4 import Dataset
import matplotlib.pyplot as plt
from skimage import io, data, img_as_float, img_as_ubyte, img_as_uint, img_as_int, exposure
import cv2
hdf_data_path = "D:/Python_total/DATA\FY4A-_AGRI--_N_REGC_1047E_L1-_FDI-_MULT_NOM_20210720075336_20210720075753_4000M_V0001.HDF"
nc_obj = Dataset(hdf_data_path)
#print(nc_obj)
#type = nc_obj.variables
#print(type)
B = nc_obj.variables['NOMChannel01'][:]
G = nc_obj.variables['NOMChannel02'][:]
R = nc_obj.variables['NOMChannel03'][:]
# 将数据类型转成int16
B = img_as_int(B)
G = img_as_int(G)
R = img_as_int(R)
# opencv 将rgb三个通道融合
img3 = cv2.merge([R, G, B])
img3 = exposure.adjust_log(img3, inv=True)#调整对比度
img3 = exposure.adjust_gamma(img3, 1.2) # 图像调暗
T = 2
for i in range(len(img3)):
for j in range(len(img3[0])):
r = img3[j][0]
g = img3[j][1]
b = img3[j][2]
img3[j] = (r * 0.6, g, b)
if r / g > T:
img3[j] = (g, r * 0.7, b)
#选取特定行列范围的图像
plt.xlim(1000,2747)
plt.ylim(1071,0)
plt.imshow(img3, )
fig =plt.figure(figsize=(15,10))
plt.axis('off')
plt.show()
|
-
中国区域
-
|