- 积分
- 26
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-7-8
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2019-7-15 15:28:16
|
显示全部楼层
王老师,我用循环可以读了。现在问题是我的文件有十多个(以后可能会更多),要是这样列出来 也很麻烦,有没有高级点的方法?
附上我的代码
meteoDir='/Users/wangyudong/waming/data/modis/0627/'
fn1 =os.path.join(meteoDir, 'MOD04_3K.A2019178.0505.061.2019182201806.hdf')
fn2=os.path.join(meteoDir, 'MOD04_3K.A2019178.0145.061.2019178131128.hdf')
fn3=os.path.join(meteoDir,'MOD04_3K.A2019178.0150.061.2019178131117.hdf')
fn4=os.path.join(meteoDir,'MOD04_3K.A2019178.0155.061.2019182200406.hdf')
fn5=os.path.join(meteoDir,'MOD04_3K.A2019178.0320.061.2019182201614.hdf')
fn6=os.path.join(meteoDir,'MOD04_3K.A2019178.0325.061.2019182201554.hdf')
fns=[]
fns.append(fn1)
fns.append(fn2)
fns.append(fn3)
fns.append(fn4)
fns.append(fn5)
fns.append(fn6)
#Plot
axesm()
geoshow('cn_province')
#geoshow('country', edgecolor='k')
levs = arange(0, 2, 0.1)
for i in range(0,len(fns)):
f = addfile(fns[i])
lon = f['Longitude'][:,:]
lat = f['Latitude'][:,:]
aod = f['Optical_Depth_Land_And_Ocean'][:,:]
aod[aod<0] = nan
layer = pcolorm(lon, lat, aod, levs)
colorbar(layer, orientation='horizontal', aspect=40)
title('AOD') |
|