import netCDF4 import wrf # 读取数据############################################################### data_nc = netCDF4.Dataset(r"./data/WRF/wrfout_d01_2023-01-15_12%3A00%3A00") # print(data_nc) print(data_nc.TITLE) print(data_nc.START_DATE) print(data_nc.dimensions['Time'].size) Time_Id = 72 slp = wrf.getvar(data_nc, "slp", timeidx=Time_Id) # 读取计算海表面气压 # times = wrf.getvar(data_nc, "times", timeidx=ALL_TIMES) print(slp.Time) Time_Id = 0 slp = wrf.getvar(data_nc, "slp", timeidx=Time_Id) # 读取计算海表面气压 # times = wrf.getvar(data_nc, "times", timeidx=ALL_TIMES) print(slp.Time)