for tt in range(0,1,1): #不包含数字2 读取时间
for lv in range(0,1,1):
#=======================读取数据=============
u = obj['u'][0][1]
v = obj['v'][0][1]
t = obj['t'][0][1]-273.15
t.attrs['units'] = 'deg C'
lat = obj['latitude'][:]
lon = obj['longitude'][:]
lons, lats = np.meshgrid(lon,lat)
dx, dy = mpcalc.lat_lon_grid_deltas(lon, lat)
# 使用metpy函数计算温度对流
adv = mpcalc.advection(t, [u, v], (dx, dy), dim_order='yx') #>>>===此步报错
#错误信息为
#TypeError: invalid indexer array, does not have integer dtype: array(None, dtype=object)