读取PUP雷达数据官网示例:
运行示例代码
from cinrad.io import PUP
pup_file='Z_RADR_I_Z9591_20210901004700_P_DOR_SA_V_10_230_60.591.bin'
f = PUP(path+pup_file)
data = f.get_data()
解决办法:
在路径的程序中添加代码,延长连接时间阈值 timeout=100,如图;
HTTPSConnectionPool(host=‘github.com’, port=443): Max retries exceeded with url: /Unidata/MetPy/raw/v1.0.1/staticdata/airport-codes.csv (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001EA124FA370>, ‘Connection to github.com timed out. (connect timeout=3)’))
解决方法:
仍在刚才的程序中,添加代码
s = requests.session()
s.keep_alive = False
# 忽略警告:InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised.
# HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url
requests.packages.urllib3.disable_warnings()
response = requests.get(url, **kwargs,timeout=100,verify=False,) ####
解决办法:
将相对路径改为绝对路径