meteva icon indicating copy to clipboard operation
meteva copied to clipboard

读取wrfout数据出错

Open lucky-4ever opened this issue 5 years ago • 4 comments

用read_griddata_from_nc读取wrfout文件出错 提示('member', 'level', 'Time', 'dtime', 'lat', 'lon') must be a permuted list of ('lon', 'lat', 'dtime', 'level', 'member', 'Time', 'south_north', 'west_east'), unless ... is included print(grd)类型为none

lucky-4ever avatar Feb 02 '21 08:02 lucky-4ever

我也遇到这个问题了。你的问题解决了吗?

wudahe avatar Feb 06 '21 08:02 wudahe

用read_griddata_from_nc读取wrfout文件出错 提示('member', 'level', 'Time', 'dtime', 'lat', 'lon') must be a permuted list of ('lon', 'lat', 'dtime', 'level', 'member', 'Time', 'south_north', 'west_east'), unless ... is included print(grd)类型为none

请问你的问题解决了吗?

wudahe avatar Feb 06 '21 08:02 wudahe

请问你读取wrfout的参数是什么, 另外能否用 ds0 = xr.open_dataset(filename)
print(ds0) 查看一下这个文件的内容

liucouhua avatar Apr 04 '21 13:04 liucouhua

1、meb.read_griddata_from_nc(filename, time=1)会提示:ValueError: conflicting sizes for dimension 'time': length 23 on 'Times' and length 1 on 'time' conflicting sizes for dimension 'time': length 23 on 'Times' and length 1 on 'time'

2、文件里是有“U”这个变量的或者换成其他变量如‘HGT’, grd = meb.read_griddata_from_nc(filename,value_name='U'),则提示 f"{dims_supplied} must be a permuted list of {dims_all}, unless ... is included" ValueError: ('member', 'level', 'Time', 'dtime', 'lat', 'lon') must be a permuted list of ('lon', 'lat', 'dtime', 'level', 'member', 'Time', 'south_north', 'west_east'), unless ... is included('member', 'level', 'Time', 'dtime', 'lat', 'lon') must be a permuted list of ('lon', 'lat', 'dtime', 'level', 'member', 'Time', 'south_north', 'west_east'), unless ... is included

用xr.open_dataset(filename)打开文件,文件信息如下: <xarray.Dataset> Dimensions: (Time: 289, bottom_top: 31, bottom_top_stag: 32, soil_layers_stag: 4, south_north: 150, south_north_stag: 151, west_east: 192, west_east_stag: 193) Coordinates: XLAT (Time, south_north, west_east) float32 ... XLONG (Time, south_north, west_east) float32 ... XTIME (Time) datetime64[ns] ... XLAT_U (Time, south_north, west_east_stag) float32 ... XLONG_U (Time, south_north, west_east_stag) float32 ... XLAT_V (Time, south_north_stag, west_east) float32 ... XLONG_V (Time, south_north_stag, west_east) float32 ... Dimensions without coordinates: Time, bottom_top, bottom_top_stag, soil_layers_stag, south_north, south_north_stag, west_east, west_east_stag Data variables: Times (Time) |S19 ... LU_INDEX (Time, south_north, west_east) float32 ... ZNU (Time, bottom_top) float32 ... ZNW (Time, bottom_top_stag) float32 ... ZS (Time, soil_layers_stag) float32 ... DZS (Time, soil_layers_stag) float32 ... VAR_SSO (Time, south_north, west_east) float32 ... U (Time, bottom_top, south_north, west_east_stag) float32 ... V (Time, bottom_top, south_north_stag, west_east) float32 ...

lucky-4ever avatar Apr 08 '21 10:04 lucky-4ever