功能:从WRF输出文献中冷漠办法经纬度的2m温度、2m湿度以及10m风速信息物联网软件开发公司。
本站仅提供存储工作,总计本色均由用户发布,如发现存害或侵权本色,请点击举报。# -*- coding: utf-8 -*-
"""
[扫码下载app,中过数字彩1千万以上的专家都在这儿!]
山东泰山入籍国脚费南多“三停”的事情有了最新进展,有消息称“小摩托”续约的条件是大幅上涨薪资,没有得到泰山俱乐部的回应,长沙专业物联网软件开发他有意转投上海申花。
@author: Daimu
"""
from netCDF4 import Dataset
import numpy as np
from wrf import getvar,interpz3d,destagger,to_np, ALL_TIMES
from scipy.interpolate import griddata
import pandas as pd
小程序开发from tqdm import tqdm
# 怒放NetCDF文献
file_path = r'E:\BaiduSyncdisk\wrfout_d03_2022-05-01_00_00_00'
ncfile = Dataset(file_path, 'r')
# 寻找办法点
lon_m=123.465538
lat_m=41.72472
# 经纬度
lon = np.array(ncfile['XLONG'])[0,:,:]
lat = np.array(ncfile['XLAT'])[0,:,:]
time = np.array(ncfile['Times'])
merged_strings = [''.join(row.astype(str)) for row in time]
time = np.array(merged_strings)
# 湿度 风速
rh = to_np(getvar(ncfile, "rh2",timeidx=ALL_TIMES))
tc = to_np(getvar(ncfile, "T2",timeidx=ALL_TIMES))
# 风速
wspd = getvar(ncfile, "wspd_wdir10", units="m/s",timeidx=ALL_TIMES)[0,:,:,:]
result=pd.DataFrame(columns=['时辰','2m温度','2m湿度','10m风速','26m压强'])
for i in tqdm(np.arange(np.size(rh,0))):
rh_t=rh[i,:]
tc_t=tc[i,:]
wspd_t=to_np(wspd[i,:])
rh_m = griddata((lon.flatten(), lat.flatten()), rh_t.flatten(), (lon_m, lat_m), method='linear')
tc_m = griddata((lon.flatten(), lat.flatten()), tc_t.flatten(), (lon_m, lat_m), method='linear')
wspd_m = griddata((lon.flatten(), lat.flatten()), wspd_t.flatten(), (lon_m, lat_m), method='linear')
result.at[i,'时辰']=time[i]
result.at[i,'2m温度']=tc_m-273.15
result.at[i,'2m湿度']=rh_m
result.at[i,'10m风速']=wspd_m
result.to_csv(r'E:\02205.csv'物联网软件开发公司,encoding='gbk')