使用netCDF4库读取nc文件
# ***1 数据读取与处理
# 打开 NetCDF 文件
GA_id = nc.Dataset('taiwan_GA.nc', 'r')
DOV_E_id = nc.Dataset('taiwan_DOV_E.nc', 'r')
DOV_N_id = nc.Dataset('taiwan_DOV_N.nc', 'r')
VGG_id = nc.Dataset('taiwan_VGG.nc', 'r')
#变量名字
print(GA_id.variables.keys())
print(DOV_E_id.variables.keys())
print(DOV_N_id.variables.keys())
print(VGG_id.variables.keys())
读取特定变量的数据
ga_datas = GA_id.variables['GA_Finall'][:]
dove_datas = DOV_E_id.variables['East_Finall'][:]
dovn_datas = DOV_N_id.variables['North_Finall'][:]
vgg_datas = VGG_id.variables['VGG_Finall'][:]
标签:VGG,读取,python,variables,nc,GA,DOV,id
From: https://www.cnblogs.com/qt-pyq/p/18177760