- 积分
- 2085
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2020-2-1
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2020-4-4 17:08:19
|
显示全部楼层
for i in range (0,61,1):
#使用os模块将路径和文件名拼接起来
path_H2O = os.path.join('D:\Graduation thesis\TES1\H2O',dric_H2O)
path_HDO = os.path.join('D:\Graduation thesis\TES1\HDO',dric_HDO)
print(path_H2O ) #查看一下拼接结果
#读取文件
f_H2O = h5py.File(path_H2O, 'r')
f_HDO = h5py.File(path_HDO, 'r')
#将每个文件的数据读取存到一个数组里面
H2O_1[i,:,:,:]= f_H2O.get('HDFEOS/GRIDS/NadirGrid/Data Fields/H2O')
HDO_1[i,:,:,:]= f_HDO.get('HDFEOS/GRIDS/NadirGrid/Data Fields/HDO')
lon = f_H2O.get('HDFEOS/GRIDS/NadirGrid/Data Fields/Longitude')
lat = f_H2O.get('HDFEOS/GRIDS/NadirGrid/Data Fields/Latitude')
lev = f_H2O.get('HDFEOS/GRIDS/NadirGrid/Data Fields/Pressure')
|
|